:root {
  --green-950: #4b2417;
  --green-900: #b94f35;
  --green-700: #c9633f;
  --green-100: #fff0d7;
  --earth: #a9462f;
  --cream: #fff0cf;
  --paper: #fffaf1;
  --ink: #3b291f;
  --muted: #77675c;
  --line: #e5d4bf;
  --danger: #a33e38;
  --warning: #a96525;
  --blue: #3d6f82;
  --shadow: 0 12px 35px rgba(91, 45, 25, .1);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: #f7f1e7; color: var(--ink); font-family: var(--sans); line-height: 1.45; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #d29a50; outline-offset: 3px; }

.login-screen { min-height: 100dvh; display: grid; background: var(--paper); }
.login-card { width: min(440px, calc(100% - 36px)); align-self: center; justify-self: center; padding: 45px 0; }
.admin-brand { display: inline-grid; gap: 7px; color: var(--green-950); text-decoration: none; }
.admin-brand img { width: 175px; height: auto; display: block; background: #e89a34; clip-path: ellipse(47% 100% at 50% 50%); filter: drop-shadow(0 4px 7px rgba(81,39,21,.14)); }
.admin-brand > span { color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.login-card .admin-brand { margin-bottom: 65px; }
.eyebrow { margin: 0 0 8px; color: var(--earth); font-size: .68rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.login-card h1, .view-heading h1 { margin: 0; color: var(--green-950); font: 500 clamp(2.2rem, 9vw, 3.6rem)/1.05 var(--serif); letter-spacing: -.035em; }
.login-card > p:not(.eyebrow) { max-width: 390px; margin: 16px 0 30px; color: var(--muted); }
.login-card form { display: grid; gap: 16px; }
.login-card label, .product-form-panel label { display: grid; gap: 7px; color: #4f5952; font-size: .75rem; font-weight: 750; }
.login-card input, .product-form-panel input, .product-form-panel textarea, .table-search, select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; background: white; color: var(--ink); outline: 0; font-weight: 450; }
input:focus, textarea:focus, select:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(57,112,77,.1); }
.primary-button, .secondary-button { min-height: 44px; border: 1px solid transparent; border-radius: 9px; padding: 10px 17px; font-weight: 750; cursor: pointer; transition: transform .18s, background .18s; }
.primary-button { background: linear-gradient(135deg, #c95738, #ad422d); color: white; box-shadow: 0 7px 16px rgba(135,57,35,.18); }
.primary-button:hover { background: var(--green-950); transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .6; }
.secondary-button { border-color: var(--line); background: white; color: var(--green-900); }
.compact { min-height: 40px; padding: 8px 14px; }
.form-message { min-height: 22px; color: var(--danger); font-size: .72rem; font-weight: 750; }
.form-message.success { color: var(--green-700); }
.action-feedback { display: none; min-height: 0; margin: 0; border: 1px solid #e2b8b3; border-radius: 9px; padding: 11px 13px; background: #fff1ef; color: #8b2f2b; font-size: .78rem; line-height: 1.45; }
.action-feedback:not(:empty) { display: block; }
.action-feedback.success { border-color: #9bc9a8; background: #edf8f0; color: #25613a; }
.back-link { display: inline-block; margin-top: 38px; color: var(--muted); font-size: .74rem; text-underline-offset: 4px; }
.login-art { display: none; }

.admin-app { min-height: 100dvh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 260px; display: flex; flex-direction: column; padding: 28px 18px; background: linear-gradient(180deg, #4b2417, #70341f); color: white; transform: translateX(-100%); transition: transform .25s; }
.sidebar.open { transform: translateX(0); box-shadow: 20px 0 50px rgba(12,27,17,.25); }
.admin-brand-light { margin: 0 10px 45px; color: white; }
.admin-brand-light img { width: 190px; filter: drop-shadow(0 5px 10px rgba(0,0,0,.22)); }
.admin-brand-light > span { color: #efd7bf; }
.sidebar nav { display: grid; gap: 8px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 9px; padding: 12px 13px; background: transparent; color: #bdcbbf; text-align: left; font-size: .8rem; font-weight: 700; cursor: pointer; }
.nav-item span { width: 20px; color: #efad65; text-align: center; font-size: 1rem; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.09); color: white; }
.nav-item.active span { color: #ffd18c; }
.sidebar-footer { display: grid; gap: 8px; margin-top: auto; padding: 18px 11px 0; border-top: 1px solid rgba(255,255,255,.11); }
.sidebar-footer a, .sidebar-footer button { border: 0; padding: 5px 0; background: transparent; color: #ead4c1; font-size: .72rem; text-align: left; cursor: pointer; }

.dashboard-shell { min-width: 0; }
.topbar { height: 72px; display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(10px); }
.menu-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.topbar > div { display: grid; margin-right: auto; line-height: 1.15; }
.topbar small { color: var(--muted); font-size: .63rem; }
.topbar strong { font-size: .83rem; }
.admin-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--green-100); color: var(--green-900); font-size: .69rem; font-weight: 800; }
.content-area { width: min(1500px, 100%); padding: 26px 16px 50px; }
.license-banner { display: grid; gap: 3px; margin-bottom: 18px; border: 1px solid #dfcfad; border-radius: 11px; padding: 13px 16px; background: #fff8e8; color: #765320; font-size: .72rem; }
.license-banner.allowed { border-color: #bfd7c5; background: #edf7ef; color: #2f6844; }
.license-banner.blocked { border-color: #e2beba; background: #fff0ee; color: #963b36; }
.license-banner strong { font-size: .78rem; }
.view-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.view-heading h1 { font-size: clamp(2.1rem, 7vw, 3rem); }
.view-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.metric-grid { display: grid; grid-template-columns: 1fr; gap: 13px; }
.metric-card { min-width: 0; display: flex; align-items: center; gap: 13px; padding: 19px; border: 1px solid #e4e5df; border-radius: 13px; background: white; box-shadow: var(--shadow); }
.metric-icon { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; font-weight: 850; }
.metric-icon.green { background: #ffe9c8; color: var(--green-700); }
.metric-icon.brown { background: #f9dfce; color: var(--earth); }
.metric-icon.orange { background: #faeadb; color: var(--warning); }
.metric-icon.blue { background: #e2edf0; color: var(--blue); }
.metric-card div { min-width: 0; display: grid; }
.metric-card small { color: var(--muted); font-size: .65rem; white-space: nowrap; }
.metric-card strong { overflow: hidden; color: var(--green-950); font: 700 1.4rem var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.metric-card p { margin: 2px 0 0; color: #919891; font-size: .6rem; }
.dashboard-grid { display: grid; gap: 16px; margin-top: 16px; }
.panel { overflow: hidden; border: 1px solid #e2e3dd; border-radius: 13px; background: white; box-shadow: var(--shadow); }
.panel-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 20px; border-bottom: 1px solid #e7e8e3; }
.panel-heading h2 { margin: 0; color: var(--green-950); font: 700 1.08rem var(--serif); }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: .65rem; }
.chart-wrap { height: 280px; padding: 20px; }
#sales-chart { width: 100%; height: 100%; }
.next-steps ol { margin: 0; padding: 9px 20px 20px; list-style: none; }
.next-steps li { display: flex; gap: 12px; padding: 15px 0; border-bottom: 1px solid #ecece8; }
.next-steps li:last-child { border: 0; }
.next-steps li > span { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--cream); color: var(--earth); font: 700 .75rem var(--serif); }
.next-steps strong { font-size: .78rem; }
.next-steps p { margin: 3px 0 0; color: var(--muted); font-size: .66rem; }

.split-layout { display: grid; gap: 16px; }
.product-form-panel form { display: grid; gap: 15px; padding: 20px; }
.product-form-panel textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.variant-admin-fields { display: grid; gap: 10px; margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 13px; background: #f8f8f5; }
.variant-admin-fields legend { padding: 0 5px; color: var(--green-950); font: 700 .86rem var(--serif); }
.variant-admin-row { display: grid; grid-template-columns: 48px 1fr 1fr; align-items: end; gap: 8px; }
.variant-admin-row > strong { align-self: center; color: var(--earth); font-size: .7rem; }
.package-admin-fields { background: #fff8e8; }
.package-dimensions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.upload-field input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.upload-field em { min-height: 70px; display: grid; place-items: center; border: 1px dashed #aeb9b0; border-radius: 10px; background: #f8f8f5; color: var(--green-700); font-style: normal; cursor: pointer; }
.upload-field em:hover { background: var(--green-100); }
.form-actions { display: flex; align-items: center; gap: 14px; }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: .73rem; text-decoration: underline; cursor: pointer; }
.table-search { max-width: 210px; min-height: 37px; padding: 8px 11px; font-size: .7rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 16px; background: #f8f8f5; color: var(--muted); font-size: .62rem; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 16px; border-top: 1px solid #ecece8; font-size: .72rem; vertical-align: middle; }
.order-date { display: block; color: var(--muted); }
.product-cell { min-width: 190px; display: flex; align-items: center; gap: 10px; }
.product-cell img, .table-thumb { width: 43px; height: 43px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--green-100); color: var(--green-900); object-fit: cover; font: 700 .85rem var(--serif); }
.product-cell div { display: grid; }
.product-cell strong { color: var(--green-950); font-size: .73rem; }
.product-cell small { max-width: 175px; overflow: hidden; color: var(--muted); font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.product-cell .variant-summary { max-width: 260px; margin-top: 2px; color: var(--earth); }
.product-cell .package-summary { max-width: 260px; margin-top: 2px; color: var(--blue); }
.category-pill { display: inline-flex; max-width: 145px; overflow: hidden; border-radius: 999px; padding: 5px 8px; background: #fff0d7; color: #9c422d; font-size: .6rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.category-pill.empty { background: #ece9e3; color: var(--muted); }
.category-cell { min-width: 180px; display: grid; }
.category-cell strong { color: var(--green-950); font-size: .75rem; }
.category-cell small { max-width: 260px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .62rem; text-overflow: ellipsis; white-space: nowrap; }
.product-form-panel label > small { color: var(--muted); font-size: .62rem; font-weight: 500; }
.stock-pill, .status-pill { display: inline-flex; border-radius: 999px; padding: 4px 7px; font-size: .6rem; font-weight: 800; white-space: nowrap; }
.stock-pill.ok, .status-pill.paid, .status-pill.issued, .status-pill.delivered { background: #e3f1e7; color: #2f6844; }
.stock-pill.low, .status-pill.pending { background: #faecda; color: #965c22; }
.stock-pill.empty, .status-pill.failed, .status-pill.cancelled { background: #f7e2e0; color: #963b36; }
.status-pill.received, .status-pill.sent { background: #e5edf1; color: #3d6b80; }
.status-pill.neutral { background: #ecece8; color: #666d67; }
.row-actions { display: flex; gap: 5px; }
.row-button { border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: white; color: var(--green-700); font-size: .62rem; font-weight: 750; cursor: pointer; white-space: nowrap; }
.row-button:hover { background: var(--green-100); }
.row-button.danger { color: var(--danger); }
.row-button.fiscal { border-color: var(--green-700); background: var(--green-700); color: white; }
.row-button:disabled { opacity: .55; cursor: not-allowed; }
.empty-table { padding: 40px; color: var(--muted); text-align: center; }
.fiscal-notice { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 15px 18px; border: 1px solid #dfcfad; border-radius: 12px; background: #fff8e8; }
.fiscal-notice > span { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: #f0dfbd; color: #765320; font: 700 .72rem var(--serif); }
.fiscal-notice strong { font-size: .78rem; }
.fiscal-notice p { margin: 3px 0 0; color: #806e50; font-size: .65rem; }
.sales-table { min-width: 1380px; }
.shipping-table { min-width: 900px; }
.shipping-rule-fields { display: grid; gap: 11px; }
.shipping-notice > span { background: #e2edf0; color: var(--blue); }
.melhor-envio-status-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 18px 20px; }
.melhor-envio-status-card > div { display: flex; align-items: center; gap: 13px; }
.melhor-envio-status-card h2 { margin: 0; color: var(--green-950); font: 700 1rem var(--serif); }
.melhor-envio-status-card p { margin: 4px 0 0; color: var(--muted); font-size: .68rem; }
.inline-select { width: auto; min-width: 105px; padding: 6px 7px; font-size: .62rem; }
.tracking-code { display: block; max-width: 150px; overflow-wrap: anywhere; color: var(--ink); font-weight: 750; }
.tracking-link { display: inline-block; margin-top: 4px; color: var(--green-900); font-size: .65rem; font-weight: 750; text-underline-offset: 3px; }
.tracking-editor { width: 180px; display: grid; gap: 5px; }
.tracking-editor input { width: 100%; min-height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 7px; background: white; color: var(--ink); font-size: .65rem; }

.shipping-document-cell { min-width: 170px; display: grid; gap: 5px; }
.shipping-document-cell small { color: var(--muted); font-size: .61rem; }
.invoice-key { max-width: 180px; overflow: hidden; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .59rem; text-overflow: ellipsis; white-space: nowrap; }
.fiscal-dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; border: 0; border-radius: 16px; padding: 0; background: var(--paper); color: var(--ink); box-shadow: 0 24px 80px rgba(48, 25, 14, .35); }
.import-dialog { width: min(780px, calc(100% - 24px)); }
.fiscal-dialog::backdrop { background: rgba(38, 27, 20, .62); backdrop-filter: blur(3px); }
.fiscal-dialog form { display: grid; gap: 16px; padding: 22px; }
.fiscal-dialog label { display: grid; gap: 7px; color: #4f5952; font-size: .75rem; font-weight: 750; }
.fiscal-dialog input[type="text"], .fiscal-dialog input[name="nfe_chave"] { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; background: white; color: var(--ink); font: 600 .78rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.dialog-heading h2 { margin: 0; color: var(--green-950); font: 700 1.45rem var(--serif); }
.dialog-close { width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); font-size: 1.4rem; cursor: pointer; }
.dialog-order { margin: -7px 0 0; color: var(--muted); font-size: .7rem; }
.fiscal-guidance { border: 1px solid #dfcfad; border-radius: 10px; padding: 12px 14px; background: #fff8e8; color: #765320; font-size: .68rem; }
.template-download { display: inline-block; margin-left: 4px; color: var(--earth); font-weight: 800; text-underline-offset: 3px; }
.fiscal-current { min-height: 24px; border-radius: 9px; padding: 10px 12px; background: #f2f1ed; color: var(--muted); font-size: .67rem; }
.dispatch-quotes { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: white; min-width: 0; }
.dispatch-quotes[hidden] { display: none; }
.dispatch-quotes p { margin: 0; font-size: .75rem; }
.dispatch-quotes select { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; }
.dispatch-quotes output { font-size: .75rem; font-weight: 700; overflow-wrap: anywhere; }
.remove-xml-option { grid-template-columns: auto 1fr !important; align-items: center; justify-content: start; }
.remove-xml-option input { width: auto; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.import-report { border: 1px solid var(--line); border-radius: 11px; padding: 14px; background: white; }
.import-report[hidden] { display: none; }
.import-report > strong { display: block; color: var(--green-950); font-size: .76rem; line-height: 1.5; }
.import-report-columns { display: grid; gap: 14px; margin-top: 12px; }
.import-report h3 { margin: 0 0 6px; color: var(--earth); font: 700 .88rem var(--serif); }
.import-report ul { max-height: 185px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.import-report li { border-left: 3px solid var(--danger); padding: 5px 8px; color: #7f332e; font-size: .66rem; line-height: 1.45; }
.import-report li + li { margin-top: 4px; }
.import-report-columns > div:last-child li { border-left-color: var(--warning); color: #765320; }
.import-report .import-report-empty { border-left-color: #5b8b66; color: #356040; }

.settings-store-link { display: inline-grid; place-items: center; text-decoration: none; }
.store-settings-layout { display: grid; gap: 16px; }
.settings-card { position: static; }
.settings-fields { display: grid; gap: 15px; padding: 20px; }
.settings-logo-row { display: grid; gap: 14px; }
.settings-logo-row > img { width: 100%; height: 150px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff8e8; object-fit: contain; }
.settings-logo-row > div { display: grid; gap: 10px; min-width: 0; }
.settings-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; }
.settings-check input { width: auto !important; accent-color: var(--green-900); }
.settings-submit-bar { position: sticky; z-index: 5; bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; border: 1px solid #d9c7aa; border-radius: 13px; padding: 15px 18px; background: rgba(255,248,232,.96); box-shadow: 0 10px 30px rgba(74,35,20,.13); backdrop-filter: blur(8px); }
.settings-submit-bar > div { display: grid; margin-right: auto; }
.settings-submit-bar strong { color: var(--green-950); font-size: .78rem; }
.settings-submit-bar span { color: var(--muted); font-size: .64rem; }
.settings-submit-bar output { flex-basis: 100%; }
.settings-history-panel { margin-top: 16px; }

.toast-region { position: fixed; z-index: 100; right: 16px; bottom: 16px; display: grid; gap: 8px; }
.toast { max-width: 340px; padding: 12px 15px; border-radius: 9px; background: var(--green-950); color: white; box-shadow: 0 10px 30px rgba(74,35,20,.25); font-size: .72rem; animation: toast-in .2s ease; }
.toast.error { background: #8e3731; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (min-width: 620px) {
  .content-area { padding: 34px 28px 60px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-logo-row { grid-template-columns: minmax(180px, .65fr) minmax(220px, 1fr); align-items: center; }
  .import-report-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .package-dimensions { grid-template-columns: 1fr; }
  .melhor-envio-status-card { align-items: flex-start; flex-direction: column; }
}

@media (min-width: 980px) {
  .login-screen { grid-template-columns: 1fr 1fr; }
  .login-art { position: relative; overflow: hidden; display: grid; place-items: center; padding: 50px; background: linear-gradient(145deg, #e89a34, #d9663c 65%, #943c29); color: white; isolation: isolate; }
  .login-art::before, .login-art::after { content: ''; position: absolute; z-index: -1; width: 430px; height: 430px; border: 1px solid rgba(255,255,255,.13); border-radius: 48% 52% 58% 42%; }
  .login-art::after { width: 320px; height: 320px; transform: rotate(30deg); }
  .art-mark { width: min(420px, 80%); display: grid; place-items: center; border-radius: 35% 65% 52% 48%; background: rgba(255,244,216,.2); box-shadow: 0 25px 60px rgba(77,31,14,.22); transform: rotate(-3deg); }
  .art-mark img { width: 100%; height: auto; clip-path: ellipse(47% 100% at 50% 50%); filter: drop-shadow(0 18px 25px rgba(92,36,14,.2)); }
  .login-art blockquote { position: absolute; bottom: 55px; max-width: 430px; margin: 0; color: #cad5cc; font: italic 1.1rem/1.5 var(--serif); text-align: center; }
  .sidebar { transform: translateX(0); }
  .dashboard-shell { margin-left: 260px; }
  .menu-button { display: none; }
  .topbar { height: 80px; padding: 0 34px; }
  .content-area { padding: 38px 36px 70px; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); }
  .split-layout { grid-template-columns: minmax(280px, .65fr) minmax(560px, 1.35fr); align-items: start; }
  .product-form-panel { position: sticky; top: 20px; }
  .store-settings-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .store-settings-layout .settings-card { position: static; }
  .settings-submit-bar { grid-column: 1 / -1; }
}

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

.password-control { position: relative; display: block; width: 100%; }
.password-control input { padding-right: 78px; }
.password-toggle { position: absolute; top: 50%; right: 6px; min-height: 32px; transform: translateY(-50%); border: 0; border-radius: 7px; padding: 5px 9px; background: #f7e7d3; color: #a9462f; font-size: .68rem; font-weight: 800; cursor: pointer; }

.system-app { min-height: 100dvh; }
.system-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding: 18px clamp(16px, 4vw, 52px); background: white; }
.system-topbar .admin-brand img { width: 145px; }
.system-topbar-actions, .system-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.system-topbar-actions a { display: inline-grid; place-items: center; text-decoration: none; }
.system-content { width: min(1250px, calc(100% - 32px)); margin: 0 auto; padding: 38px 0 70px; }
.system-grid { display: grid; gap: 18px; }
.system-form { display: grid; gap: 14px; padding: 20px; }
.system-form label, .system-actions label { display: grid; gap: 7px; color: #4f5952; font-size: .75rem; font-weight: 750; }
.system-form input, .system-form textarea, .system-form select, .system-actions input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; background: white; color: var(--ink); }
.system-form textarea { resize: vertical; }
.system-section { margin-top: 18px; }
.system-actions { padding: 20px; }
.system-output { display: block; padding: 0 20px 16px; }
.integration-grid { display: grid; gap: 18px; padding: 18px; background: #fbf8f2; }
.integration-form { align-content: start; border: 1px solid var(--line); border-radius: 12px; background: white; }
.integration-form-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.integration-form-heading h3 { margin: 0; color: var(--green-950); font: 700 1.15rem var(--serif); }
.integration-form-heading p { margin: 3px 0 0; color: var(--muted); font-size: .66rem; }
.integration-form label > small { color: var(--muted); font-size: .62rem; font-weight: 500; }
.callback-list { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: #f6f2ea; }
.callback-list small { display: grid; gap: 3px; color: var(--muted); font-size: .65rem; }
.callback-list code { overflow-wrap: anywhere; color: var(--green-950); font-size: .7rem; }
.integration-guidance { margin: 0; padding: 10px 12px; border-left: 4px solid var(--warning); border-radius: 7px; background: #fff6df; color: #69491c; font-size: .7rem; }
.integration-guidance.is-danger { border-left-color: var(--danger); background: #fff0ed; color: var(--danger); font-weight: 700; }
.checkbox-grid { display: grid; gap: 8px; }
.checkbox-field { display: flex !important; align-items: center; gap: 8px !important; min-height: 36px; }
.checkbox-field input { width: auto !important; margin: 0; accent-color: var(--green-900); }
.danger-option { color: var(--danger) !important; font-size: .68rem !important; }
.integration-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.integration-actions .text-button { margin-left: auto; }
.gateway-grid { display: grid; gap: 18px; }
.gateway-card { padding: 22px; }
.gateway-heading, .gateway-heading > div, .gateway-actions, .gateway-save-bar { display: flex; align-items: center; gap: 12px; }
.gateway-heading { justify-content: space-between; margin-bottom: 16px; }
.gateway-heading h2, .gateway-heading p { margin: 0; }
.gateway-heading p { color: var(--muted); font-size: .75rem; }
.gateway-logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: white; font-weight: 900; }
.gateway-logo.mp { background: #168cdb; }
.gateway-logo.ip { background: #171717; font-size: 1.45rem; }
.gateway-logo.me { background: #5d25c9; }
.gateway-card form { display: grid; gap: 13px; }
.gateway-card label { display: grid; gap: 6px; font-weight: 700; }
.gateway-card label small { color: var(--muted); font-weight: 500; }
.gateway-actions { flex-wrap: wrap; margin-top: 16px; }
.gateway-choice { display: flex !important; grid-auto-flow: column; align-items: center; gap: 7px !important; margin-left: auto; }
.gateway-message { display: block; margin-top: 14px; }
.gateway-save-bar { justify-content: space-between; position: sticky; bottom: 12px; margin-top: 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 8px 25px rgba(70,40,20,.12); }
.sender-fields { display: grid; gap: 12px; margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 15px; background: #fffaf3; }
.sender-fields legend { padding: 0 6px; color: var(--green-950); font: 700 .85rem var(--serif); }
.melhor-envio-oauth-card { margin-bottom: 18px; }
.melhor-envio-config-form { display: grid; gap: 16px; }
.melhor-envio-config-form label { display: grid; gap: 6px; font-weight: 700; }
.melhor-envio-config-form label small { color: var(--muted); font-weight: 500; }
.integration-summary-grid { display: grid; gap: 10px; margin-top: 12px; }
.integration-summary-grid > div { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf7; }
.integration-summary-grid small { color: var(--muted); }
.integration-summary-grid strong { overflow-wrap: anywhere; color: var(--green-950); font-size: .72rem; }
.three-columns { grid-template-columns: 1fr !important; }
.merchant-management-grid { display: grid; gap: 18px; padding: 18px; background: #fbf8f2; }
.merchant-user-form { align-content: start; border: 1px solid var(--line); border-radius: 12px; background: white; }
.merchant-users-table-wrap { align-self: start; border: 1px solid var(--line); border-radius: 12px; background: white; }
.merchant-users-table-wrap table { min-width: 650px; }

@media (min-width: 900px) {
  .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .gateway-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .integration-form-wide { grid-column: 1 / -1; }
  .checkbox-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .integration-summary-grid { grid-template-columns: minmax(140px, .35fr) minmax(0, 1.65fr); }
  .merchant-management-grid { grid-template-columns: minmax(330px, .8fr) minmax(560px, 1.2fr); align-items: start; }
}
