:root {
  --ink: #172b27;
  --negative: #c62828;
  --positive: #1f5fbf;
  --muted: #687873;
  --line: #e3e9e5;
  --paper: #fff;
  --canvas: #f5f7f4;
  --green: #d8232a;
  --green2: #fff0f0;
  --lime: #f7d7d8;
  --red: #a91e25;
  --shadow: 0 10px 32px #292b2d0a;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font:
    15px/1.5 Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
select {
  font: inherit;
  color: var(--ink);
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  background: transparent;
  appearance: auto;
}
.shell {
  max-width: 1260px;
  margin: auto;
  padding: 34px 34px 54px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 38px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.brand-logo {
  height: 50px;
  width: auto;
  display: block;
}
.brand-divider {
  height: 30px;
  border-left: 1px solid var(--line);
}
.brand-product {
  font-size: 13px;
  color: #555b5f;
  font-weight: 650;
  letter-spacing: 0;
}
.mark {
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: -0.06em;
}
.status {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 8px;
  height: 8px;
  background: #d8232a;
  border-radius: 50%;
}
.intro {
  margin-bottom: 26px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 8px;
}
.intro h1 {
  font-size: clamp(29px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.045em;
  margin: 0 0 10px;
}
.intro p {
  margin: 0;
  color: var(--muted);
  max-width: 700px;
}
.layout {
  display: block;
}
.left {
  display: grid;
  gap: 18px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 23px;
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.section-title {
  display: flex;
  gap: 12px;
  align-items: center;
}
.step {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--green2);
  color: var(--green);
  font-weight: 750;
  font-size: 13px;
}
.section-title h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
  margin: 0;
}
.section-title p {
  color: var(--muted);
  font-size: 12px;
  margin: 2px 0 0;
}
.pill {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 11px;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.field {
  min-width: 0;
}
.field label,
.expense-label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 6px;
}
.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
  margin-left: 4px;
}
.input-wrap {
  display: flex;
  border: 1px solid #d8e1dc;
  background: #fff;
  border-radius: 9px;
  overflow: hidden;
  transition: 0.15s;
}
.input-wrap:focus-within {
  border-color: #d8232a;
  box-shadow: 0 0 0 3px #d8232a18;
}
.prefix,
.suffix {
  padding: 10px 11px;
  background: #f7f9f7;
  color: #77847f;
  font-size: 13px;
}
.prefix {
  border-right: 1px solid var(--line);
}
.suffix {
  border-left: 1px solid var(--line);
}
input {
  font: inherit;
  color: var(--ink);
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  background: transparent;
  font-variant-numeric: tabular-nums;
}
input[type="number"] {
  appearance: textfield;
}
input::-webkit-inner-spin-button {
  appearance: none;
}
.revenue .input-wrap {
  max-width: 430px;
}
.revenue input {
  font-size: 18px;
  font-weight: 650;
  padding: 12px;
}
.channel-subnav {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
}
.channel-subbutton {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 8px 13px;
  color: var(--green);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.freight-price-nav {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.freight-price-button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  padding: 9px 12px;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.freight-price-button.active {
  color: var(--green);
  border-color: var(--green);
}
.freight-price-panel {
  display: none;
}
.freight-price-panel.active {
  display: block;
}
.expense-list {
  display: grid;
  gap: 0;
}
.expense-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(200px, 0.9fr) 95px;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #eeeeef;
}
.expense-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.expense-label {
  margin: 0;
}
.expense-label small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px;
}
.credit-tag {
  display: inline-flex;
  margin-top: 5px;
  color: var(--green);
  background: var(--green2);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 650;
}
.credit-tag.none {
  color: #727e79;
  background: #f1f3f1;
}
.expense-row .input-wrap input {
  padding: 8px 9px;
  font-size: 13px;
}
.ratio {
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.ratio strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}
.expense-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f7f9f7;
  border-radius: 9px;
  padding: 12px 14px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}
.expense-total strong {
  color: var(--ink);
  font-size: 15px;
}
.rates {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.rates-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.rates-head strong {
  font-size: 12px;
}
.rates-head span {
  font-size: 11px;
  color: var(--muted);
}
.rate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.rate-grid .field label {
  font-size: 11px;
  color: var(--muted);
}
.rate-grid input {
  text-align: right;
  padding: 8px;
  font-size: 13px;
}
.rate-grid .input-wrap {
  background: #fafbfa;
}
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.product-grid .field label {
  font-size: 12px;
}
.product-grid .input-wrap input {
  font-size: 16px;
  font-weight: 600;
  padding: 11px;
}
.result {
  position: sticky;
  top: 20px;
  padding: 0;
  overflow: hidden;
}
.result-top {
  background: var(--green);
  color: white;
  padding: 24px;
}
.result-label {
  font-size: 12px;
  color: #f4dfe0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.result-amount {
  font-size: clamp(37px, 4vw, 48px);
  letter-spacing: -0.055em;
  line-height: 1.15;
  font-weight: 730;
  margin: 9px 0 4px;
  font-variant-numeric: tabular-nums;
}
.result-sub {
  font-size: 12px;
  color: #f4dfe0;
}
.result-bottom {
  padding: 20px 23px 22px;
}
.breakdown-title {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 12px;
}
.break-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 9px 0;
  font-size: 12px;
  color: var(--muted);
}
.break-row b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.break-row.total {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 13px;
  color: var(--ink);
  font-weight: 700;
}
.break-row.total b {
  font-size: 14px;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 17px 0;
}
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.metric {
  background: #f7f9f7;
  border-radius: 9px;
  padding: 12px;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.metric strong {
  font-size: 15px;
  display: block;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.formula {
  margin-top: 15px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #f7f9f7;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.formula b {
  color: var(--ink);
}
.alert {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff1ec;
  color: var(--red);
  font-size: 12px;
}
.alert.show {
  display: block;
}
.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  min-height: 42px;
}
.checkline input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}
.checkhelp {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.result {
  position: static;
  margin-top: 18px;
  padding: 23px;
  overflow: hidden;
}
.result-label {
  font-size: 12px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 750;
  letter-spacing: 0.05em;
}
.result-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 17px;
}
.compare-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.compare {
  border-collapse: collapse;
  width: 100%;
  min-width: 800px;
  font-variant-numeric: tabular-nums;
}
.compare th,
.compare td {
  padding: 11px 14px;
  text-align: right;
  border-bottom: 1px solid #edf1ee;
}
.compare thead th {
  background: #f6f8f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.compare thead th:first-child,
.compare tbody th {
  text-align: left;
}
.compare thead .price-head {
  background: var(--green);
  color: #fff;
  text-align: center;
}
.price-head strong {
  display: block;
  color: #fff;
  font-size: 22px;
  letter-spacing: -0.04em;
  margin-top: 4px;
}
.price-head small {
  font-size: 10px;
  color: #f4dfe0;
  font-weight: 450;
}
.compare tbody th {
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
}
.compare td {
  width: 25%;
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}
.compare td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 450;
}
.compare tr.group th {
  padding-top: 15px;
  color: var(--green);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  background: #fafbf9;
}
.compare tr.total-row th,
.compare tr.total-row td {
  border-top: 1px solid var(--line);
  background: #fff7f7;
  font-weight: 750;
  color: var(--ink);
}
.result-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.alert {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff1ec;
  color: var(--red);
  font-size: 12px;
}
.alert.show {
  display: block;
}
.result {
  position: static;
  margin-top: 18px;
  padding: 23px;
  overflow: hidden;
}
.result-label {
  font-size: 12px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 750;
  letter-spacing: 0.05em;
}
.result-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 17px;
}
.compare-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.compare {
  border-collapse: collapse;
  width: 100%;
  min-width: 800px;
  font-variant-numeric: tabular-nums;
}
.compare th,
.compare td {
  padding: 11px 14px;
  text-align: right;
  border-bottom: 1px solid #edf1ee;
}
.compare thead th {
  background: #f6f8f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.compare thead th:first-child,
.compare tbody th {
  text-align: left;
}
.compare thead .price-head {
  background: var(--green);
  color: #fff;
  text-align: center;
}
.price-head strong {
  display: block;
  color: #fff;
  font-size: 22px;
  letter-spacing: -0.04em;
  margin-top: 4px;
}
.price-head small {
  font-size: 10px;
  color: #f4dfe0;
  font-weight: 450;
}
.compare tbody th {
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
}
.compare td {
  width: 25%;
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}
.compare td small,
.compare th small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 450;
}
.compare tr.group th {
  padding-top: 15px;
  color: var(--green);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  background: #fafbf9;
}
.compare tr.total-row th,
.compare tr.total-row td {
  border-top: 1px solid var(--line);
  background: #fff7f7;
  font-weight: 750;
  color: var(--ink);
}
.result-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.foot {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 20px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.foot svg {
  flex: 0 0 15px;
  margin-top: 1px;
}
.foot a {
  color: var(--green);
  text-decoration: none;
}
.foot a:hover {
  text-decoration: underline;
}
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 13px;
}
.text-button {
  border: 0;
  background: none;
  padding: 5px 0;
  color: var(--green);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.save-state {
  font-size: 11px;
  color: var(--muted);
}
.expense-list {
  display: grid;
  gap: 12px;
}
.expense-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  display: grid;
  grid-template-columns:
    minmax(180px, 1fr) minmax(170px, 0.7fr) minmax(260px, 1.2fr)
    auto;
  gap: 12px;
  align-items: center;
}
.expense-item .expense-name {
  font-weight: 650;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px;
}
.expense-item .expense-name:not([readonly]) {
  border-color: #d8e1dc;
  background: #fff;
}
.expense-name-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.expense-name-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.expense-name-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  padding: 6px 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.expense-name-actions [data-save-expense-name] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.expense-credit-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}
.expense-credit-options label {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.expense-credit-options input[type="checkbox"] {
  width: 14px;
  height: 14px;
  padding: 0;
  accent-color: var(--green);
}
.expense-icms-rate {
  width: 72px;
  border: 1px solid #d8e1dc;
  border-radius: 6px;
  padding: 5px;
  text-align: right;
}
.expense-remove,
.tax-remove {
  border: 0;
  background: none;
  color: var(--red);
  cursor: pointer;
  font-size: 18px;
}
.additional-tax-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 10px;
}
.additional-tax-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px auto;
  gap: 10px;
  align-items: center;
}
.additional-tax-row input {
  border: 1px solid #d8e1dc;
  border-radius: 8px;
  background: white;
  padding: 8px;
}
.additional-tax-row .tax-rate {
  width: 100%;
  text-align: right;
}
.additional-tax-empty {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}
.config-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
}
.config-subbutton {
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  padding: 10px 13px;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.config-subbutton.active {
  color: var(--green);
  border-color: var(--green);
}
.config-subpanel {
  display: none;
}
.config-subpanel.active {
  display: block;
}
#taxSettings .rates {
  margin-top: 0;
}
.tab-nav {
  display: flex;
  gap: 8px;
  margin: -18px 0 24px;
  border-bottom: 1px solid var(--line);
}
.tab-button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  padding: 11px 15px;
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.tab-button.active {
  color: var(--green);
  border-color: var(--green);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.profit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.profit-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}
.profit-table th,
.profit-table td {
  padding: 11px 13px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
.profit-table th:first-child,
.profit-table td:first-child {
  text-align: left;
}
.profit-table thead th {
  background: #f6f8f6;
  color: var(--muted);
  font-size: 12px;
}
.profit-table .net-row {
  background: #fff3f3;
  font-weight: 750;
}
.profit-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 450;
}
.profit-help {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
}
.freight-config {
  margin-top: 18px;
}
.freight-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 12px;
}
.freight-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 950px;
  font-size: 12px;
}
.freight-table th,
.freight-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
.freight-table th:first-child,
.freight-table td:first-child {
  text-align: left;
}
.freight-table thead th {
  position: sticky;
  top: 0;
  background: #f6f8f6;
  color: var(--muted);
}
.freight-table input {
  width: 82px;
  border: 1px solid #d8e1dc;
  border-radius: 6px;
  padding: 7px 6px;
  text-align: right;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.freight-table .weight-input {
  width: 72px;
}
.freight-table .remove-row {
  border: 0;
  background: none;
  color: var(--red);
  cursor: pointer;
  font-size: 16px;
}
.freight-config h3 {
  font-size: 14px;
  margin: 18px 0 4px;
}
.freight-config p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.freight-low .freight-table {
  min-width: 220px;
  width: auto;
}
.admin-open {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--green);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.topbar-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
dialog {
  width: min(960px, calc(100% - 24px));
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 22px 80px #22242635;
  color: var(--ink);
}
dialog::backdrop {
  background: #22242677;
}
.admin-head {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}
.admin-head h2 {
  margin: 0;
  font-size: 18px;
}
.admin-body {
  padding: 20px 22px;
}
.admin-body p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.admin-json {
  width: 100%;
  height: 55vh;
  resize: vertical;
  border: 1px solid #d8e1dc;
  border-radius: 10px;
  padding: 13px;
  font:
    12px/1.5 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  color: var(--ink);
  background: #fafcfb;
}
.admin-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding-top: 12px;
}
.admin-error {
  color: var(--red) !important;
  min-height: 18px;
}
.button-primary {
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  padding: 10px 15px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.button-secondary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 13px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
@media (max-width: 850px) {
  .shell {
    padding: 24px 18px 40px;
  }
}
@media (max-width: 580px) {
  .expense-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }
  .expense-item > .expense-name-control {
    grid-column: 1 / -1;
  }
  .expense-item > div:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  .expense-item > .expense-credit-options {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .expense-item > div:last-child {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
  .additional-tax-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .additional-tax-row > .input-wrap {
    grid-column: 1;
  }
  .additional-tax-row > .tax-remove {
    grid-column: 2;
    grid-row: 1;
  }
  .shell {
    padding: 19px 13px 30px;
  }
  .topbar {
    margin-bottom: 28px;
  }
  .status {
    font-size: 0;
  }
  .status .dot {
    width: 9px;
    height: 9px;
  }
  .card {
    padding: 18px 15px;
  }
  .section-head {
    margin-bottom: 16px;
  }
  .expense-row {
    grid-template-columns: minmax(130px, 1fr) minmax(130px, 0.9fr);
    gap: 10px;
  }
  .ratio {
    grid-column: 2;
    text-align: left;
    margin-top: -7px;
  }
  .expense-row .input-wrap {
    grid-column: 2;
    grid-row: 1;
  }
  .expense-row > div:first-child {
    grid-row: 1 / span 2;
  }
  .rate-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .rate-grid input {
    padding: 7px 4px;
  }
  .pill {
    display: none;
  }
  .product-grid,
  .profit-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .product-grid .input-wrap input {
    font-size: 14px;
    padding: 10px 7px;
  }
  .prefix {
    padding: 9px 7px;
    font-size: 11px;
  }
  .tab-button {
    padding: 10px 9px;
    font-size: 12px;
  }
}
.freight-error {
  margin: 10px 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}
.freight-error:empty {
  display: none;
}
.ad-in-profit {
  margin-top: 18px;
}
.sync-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.sync-status {
  font-size: 12px;
  color: var(--muted);
  max-width: 340px;
}
.sync-status[data-state="ok"] {
  color: #1d7a46;
}
.sync-status[data-state="warn"] {
  color: #8a5a00;
}
.sync-status[data-state="error"] {
  color: var(--red);
  font-weight: 600;
}
.sync-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--lime);
  border-radius: 12px;
  background: var(--green2);
}
.sync-choice[hidden] {
  display: none;
}
.sync-choice p {
  margin: 0;
  font-weight: 600;
}
.sync-choice-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.flex-bonus {
  max-width: 260px;
  margin-bottom: 14px;
}
.is-flex .not-flex,
.flex-only {
  display: none;
}
.is-flex .flex-only {
  display: block;
}
/* Valores do detalhamento: negativo em vermelho, positivo em azul */
.compare td .val-neg,
.profit-table td .val-neg {
  color: var(--negative);
}
.compare td .val-pos,
.profit-table td .val-pos {
  color: var(--positive);
}
/* Margem por canal */
.margin-group {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}
.margin-group-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}
.margin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 640px) {
  .margin-grid {
    grid-template-columns: 1fr;
  }
}
/* Alíquota configurada ao lado do nome da linha */
.rate-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: 1px;
  text-transform: none;
  letter-spacing: 0;
}
/* Servidor: status de gravação, sair e login */
.admin-open[hidden] {
  display: none;
}
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(23, 43, 39, 0.45);
}
.login-overlay[hidden] {
  display: none;
}
.login-card {
  width: min(360px, 100%);
  display: grid;
  gap: 10px;
  padding: 28px 24px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.login-card h1 {
  margin: 0 0 6px;
  font-size: 20px;
}
.login-logo {
  height: 40px;
  width: auto;
  justify-self: start;
}
#loginFields {
  display: grid;
  gap: 6px;
}
#loginFields[hidden] {
  display: none;
}
#loginFields label {
  font-size: 13px;
  font-weight: 700;
}
#loginFields input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.login-error {
  min-height: 1em;
  margin: 0;
  color: var(--negative);
  font-size: 13px;
  font-weight: 600;
}
.login-submit {
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.login-submit:disabled {
  opacity: 0.6;
}
/* Envios Flex: valor da logística e bônus lado a lado */
.flex-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 720px;
  margin-bottom: 14px;
}
@media (max-width: 640px) {
  .flex-settings {
    grid-template-columns: 1fr;
  }
}
/* Envios Flex: frete grátis abaixo de R$ 79 */
.flex-free {
  margin: 4px 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
}
.flex-free .flex-settings {
  margin-bottom: 6px;
}
.flex-free-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}
.checkhelp.flex-only {
  display: none;
}
.is-flex .checkhelp.flex-only {
  display: block;
}
.is-flex .checkhelp.not-flex {
  display: none;
}
/* Envios Flex: tarifa fixa */
.flex-fee {
  margin-top: 18px;
}
.flex-fee h3 {
  margin: 0 0 4px;
  font-size: 15px;
}
.flex-fee .freight-table-wrap {
  max-width: 720px;
  margin-top: 10px;
}
.flex-fee .freight-table {
  min-width: 0;
}
