:root {
  --ink: #182033;
  --muted: #697386;
  --line: #e7e9ef;
  --surface: #ffffff;
  --canvas: #f5f6f8;
  --sidebar: #151b2b;
  --purple: #6d5ce7;
  --purple-dark: #5646c8;
  --purple-soft: #efedff;
  --green: #138a5b;
  --green-soft: #e9f8f1;
  --amber: #c47616;
  --amber-soft: #fff3df;
  --red: #ca3f4d;
  --red-soft: #fff0f1;
  --shadow: 0 12px 36px rgba(26, 32, 51, .07);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 22px; color: #d8dcec; background: linear-gradient(180deg, #171e30 0%, #101522 100%); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 30px; color: white; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: white; background: linear-gradient(145deg, #7b69ef, #5746ce); box-shadow: 0 8px 22px rgba(99, 81, 224, .35); }
.brand-mark svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font-size: 18px; letter-spacing: -.4px; }
.brand small { margin-top: 4px; color: #8f98b2; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; }
.nav { display: grid; gap: 6px; }
.nav-item { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 9px; padding: 11px 12px; color: #9ea6bd; border: 0; border-radius: 9px; background: transparent; text-align: left; transition: .2s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.055); }
.nav-item.active { color: white; background: rgba(116, 98, 234, .2); }
.nav-icon { font-size: 17px; text-align: center; }
.nav-count { min-width: 23px; padding: 2px 7px; border-radius: 99px; color: #c9c3ff; background: rgba(118, 99, 235, .22); font-size: 11px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.08); }
.mini-status { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; color: #aeb5c8; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #d69a4b; box-shadow: 0 0 0 4px rgba(214,154,75,.1); }
.status-dot.ok { background: #3cc58b; box-shadow: 0 0 0 4px rgba(60,197,139,.1); }
.sidebar .text-button { padding: 0; color: #777f98; font-size: 11px; }

.main { min-width: 0; padding: 0 42px 52px; }
.topbar { height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow, .section-label { margin: 0 0 5px; color: #8c93a3; font-size: 10px; font-weight: 750; letter-spacing: 1.35px; }
.topbar h1 { margin: 0; font-size: 27px; letter-spacing: -.8px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.environment-pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; color: #737b8c; background: white; font-size: 10px; letter-spacing: .6px; }
.environment-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; color: #697386; background: white; font-size: 19px; }
.icon-button:hover { color: var(--purple); border-color: #cec8f6; }
.mobile-logout { display: none; }
.primary-button, .secondary-button, .danger-button, .light-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border-radius: 8px; font-size: 13px; font-weight: 650; transition: .18s ease; }
.primary-button { color: white; border: 1px solid var(--purple); background: var(--purple); box-shadow: 0 5px 13px rgba(109, 92, 231, .18); }
.primary-button:hover { border-color: var(--purple-dark); background: var(--purple-dark); transform: translateY(-1px); }
.secondary-button { color: #586174; border: 1px solid var(--line); background: white; }
.secondary-button:hover { color: var(--purple); border-color: #cfcaf4; }
.danger-button { color: var(--red); border: 1px solid #f0cbd0; background: white; }
.danger-button:hover { border-color: #e7aab2; background: var(--red-soft); }
.secondary-button.compact { min-height: 34px; padding: 0 11px; font-size: 12px; }
.light-button { margin-top: 20px; color: var(--purple); border: 0; background: white; }
.light-button:hover { transform: translateX(2px); }
.text-button { padding: 4px; border: 0; color: var(--purple); background: none; font-size: 12px; font-weight: 650; }
.full { width: 100%; }

.view { display: none; animation: appear .22s ease; }
.view.active { display: block; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hero-card { min-height: 238px; display: grid; grid-template-columns: minmax(320px, .9fr) minmax(450px, 1.1fr); align-items: center; gap: 40px; padding: 38px 42px; overflow: hidden; border-radius: 16px; color: white; background: radial-gradient(circle at 78% 15%, rgba(141,125,241,.45), transparent 28%), linear-gradient(120deg, #292052, #5746c9 72%, #6f5fe4); box-shadow: 0 16px 42px rgba(59, 46, 135, .18); }
.hero-kicker { color: #c5bcff; font-size: 10px; font-weight: 750; letter-spacing: 1.4px; text-transform: uppercase; }
.hero-card h2 { max-width: 480px; margin: 9px 0 10px; font-size: clamp(27px, 3vw, 38px); line-height: 1.1; letter-spacing: -1.2px; }
.hero-card p { max-width: 520px; margin: 0; color: #d9d5f4; font-size: 14px; line-height: 1.6; }
.flow-visual { display: grid; grid-template-columns: 112px 1fr 112px 1fr 112px; align-items: center; }
.flow-node { min-height: 116px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; background: rgba(255,255,255,.1); backdrop-filter: blur(8px); }
.flow-node > span { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 9px; color: #4335a6; background: white; font-size: 17px; font-weight: 800; }
.flow-node b { font-size: 13px; }
.flow-node small { margin-top: 3px; color: #cfc9ee; font-size: 10px; }
.engine-node { background: rgba(255,255,255,.17); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.flow-line { position: relative; display: flex; justify-content: center; }
.flow-line i { width: 100%; height: 1px; background: rgba(255,255,255,.35); }
.flow-line i::after { content: ""; position: absolute; right: -1px; top: -3px; border-left: 5px solid rgba(255,255,255,.55); border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
.flow-line span { position: absolute; top: -20px; color: #bbb4df; font-size: 8px; letter-spacing: .6px; text-transform: uppercase; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0; }
.stat-card { display: flex; align-items: center; gap: 15px; min-height: 104px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 5px 18px rgba(24,32,51,.025); }
.stat-icon { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; font-size: 18px; }
.stat-icon.purple { color: var(--purple); background: var(--purple-soft); }
.stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.amber { color: var(--amber); background: var(--amber-soft); }
.stat-card > div:last-child { display: grid; }
.stat-card span { color: var(--muted); font-size: 11px; }
.stat-card strong { margin: 3px 0 1px; font-size: 23px; letter-spacing: -.6px; }
.stat-card small { color: #9aa1af; font-size: 10px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 6px 24px rgba(24,32,51,.035); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 17px; border-bottom: 1px solid #eff0f4; }
.panel-heading h3 { margin: 0; font-size: 15px; letter-spacing: -.2px; }
.priority-list { min-height: 190px; padding: 6px 24px 14px; }
.priority-item { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid #f0f1f4; }
.priority-item:last-child { border-bottom: 0; }
.priority-rank { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--purple); background: var(--purple-soft); font-size: 11px; font-weight: 750; }
.priority-item b { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.priority-item small { color: #9299a8; font-size: 10px; }
.method-chip { padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 750; }
.method-chip.PAC { color: #3d63a9; background: #edf3ff; }
.method-chip.SEDEX { color: #bf6730; background: #fff0e7; }
.readiness-panel .score { padding: 5px 9px; border-radius: 7px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 750; }
.check-list { padding: 9px 24px 16px; }
.check-row { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 11px 0; }
.check-row i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 10px; font-style: normal; font-weight: 800; }
.check-row.pending i { color: var(--amber); background: var(--amber-soft); }
.check-row b { display: block; font-size: 11px; }
.check-row small { color: #969dac; font-size: 9px; }

.section-intro { min-height: 58px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.filter-row { display: flex; gap: 9px; }
.search-box { width: 290px; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.search-box span { color: #979ead; font-size: 18px; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
select, input { border: 1px solid #dfe2e9; border-radius: 7px; color: var(--ink); background: white; outline: 0; }
select:focus, input:focus { border-color: #a79bed; box-shadow: 0 0 0 3px rgba(109,92,231,.1); }
.filter-row select { height: 38px; padding: 0 30px 0 11px; color: #657084; font-size: 11px; }
.table-panel { overflow: hidden; }
.table-header { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); }
.table-header > span { color: var(--muted); font-size: 11px; font-weight: 650; }
.rules-table-wrap { overflow-x: auto; }
.rules-table { width: 100%; border-collapse: collapse; }
.rules-table th { padding: 12px 16px; color: #9299a7; background: #fafbfc; font-size: 9px; font-weight: 750; letter-spacing: .7px; text-align: left; text-transform: uppercase; }
.rules-table td { padding: 16px; border-top: 1px solid #eff0f3; vertical-align: middle; font-size: 11px; }
.rules-table tbody tr { transition: .15s ease; }
.rules-table tbody tr:hover { background: #fcfcfe; }
.rule-name { max-width: 260px; }
.rule-name b { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.rule-name small { color: #9aa1ae; }
.condition-summary { max-width: 350px; color: #657084; line-height: 1.5; }
.condition-summary code { padding: 2px 5px; border-radius: 4px; color: #5647bc; background: #f2f0ff; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.priority-badge { display: inline-grid; place-items: center; min-width: 32px; height: 25px; padding: 0 7px; border-radius: 6px; color: #687084; background: #f1f2f5; font-weight: 750; }
.toggle { position: relative; width: 34px; height: 19px; display: inline-block; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 20px; background: #ccd1dc; transition: .2s; }
.toggle span::after { content: ""; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(15px); }
.row-actions { display: flex; gap: 4px; }
.row-button { min-width: 30px; height: 30px; padding: 0 8px; border: 0; border-radius: 7px; color: #858d9d; background: transparent; }
.row-button.edit-button { display: inline-flex; align-items: center; gap: 5px; color: var(--purple); background: var(--purple-soft); font-size: 10px; font-weight: 700; }
.row-button.edit-button > span:first-child { font-size: 12px; }
.row-button:hover { color: var(--purple); background: var(--purple-soft); }
.row-button.danger:hover { color: var(--red); background: var(--red-soft); }
.empty-state { display: none; padding: 65px 20px; text-align: center; }
.empty-state.show { display: block; }
.empty-state span { width: 44px; height: 44px; display: grid; place-items: center; margin: auto; border-radius: 12px; color: var(--purple); background: var(--purple-soft); }
.empty-state h3 { margin: 13px 0 5px; font-size: 14px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; }

.product-picker-host { min-width: 0; }
.product-picker { position: relative; min-width: 0; }
.product-picker-chips { min-height: 28px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.product-picker-empty-selection { color: #9aa1af; font-size: 9px; font-weight: 500; }
.product-chip { max-width: 100%; height: 29px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 5px 3px 3px; border: 1px solid #ddd9fa; border-radius: 7px; color: #51449f; background: #f4f2ff; font-size: 9px; font-weight: 650; }
.product-chip > span:nth-child(2) { max-width: 175px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-chip button { width: 19px; height: 19px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 5px; color: #8175bd; background: transparent; font-size: 14px; line-height: 1; }
.product-chip button:hover, .product-chip button:focus-visible { color: var(--red); background: white; }
.product-search-control { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #dfe2e9; border-radius: 7px; background: white; transition: .15s ease; }
.product-search-control:focus-within { border-color: #a79bed; box-shadow: 0 0 0 3px rgba(109,92,231,.1); }
.product-search-control > span { color: #969dab; font-size: 16px; }
.product-search-control .product-search-input { min-width: 0; height: 34px; flex: 1; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.product-picker-results { position: absolute; z-index: 12; top: calc(100% - 16px); left: 0; right: 0; max-height: 270px; overflow-y: auto; padding: 5px; border: 1px solid #dcdee6; border-radius: 9px; background: white; box-shadow: 0 15px 38px rgba(24,32,51,.16); }
.product-result { width: 100%; min-height: 55px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px; border: 0; border-radius: 7px; color: var(--ink); background: white; text-align: left; }
.product-result:hover, .product-result.active { background: #f6f4ff; }
.product-result.selected { background: #f7f8fa; }
.product-result:disabled { cursor: default; opacity: 1; }
.product-result-copy { min-width: 0; display: grid; gap: 3px; }
.product-result-copy b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.product-result-copy small { color: #9299a7; font-size: 8px; }
.product-result-action { color: var(--purple); font-size: 8px; font-weight: 750; }
.product-result.selected .product-result-action { color: var(--green); }
.product-picker-status { min-height: 12px; margin: 5px 1px 0; color: #949baa; font-size: 8px; font-weight: 500; line-height: 1.35; }
.product-search-message { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; color: #7d8595; font-size: 9px; text-align: center; }
.product-search-message.error { color: var(--red); background: var(--red-soft); border-radius: 6px; }
.product-search-message.loading i, .simulation-loading i { width: 15px; height: 15px; border: 2px solid #dedaf8; border-top-color: var(--purple); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.product-thumbnail, .product-chip-image, .simulation-product-image { position: relative; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; color: #6355bb; background: #ece9ff; font-weight: 800; }
.product-thumbnail { width: 40px; height: 40px; border-radius: 7px; font-size: 12px; }
.product-chip-image { width: 21px; height: 21px; border-radius: 5px; font-size: 8px; }
.simulation-product-image { width: 52px; height: 52px; border-radius: 9px; font-size: 15px; }
.product-thumbnail img, .product-chip-image img, .simulation-product-image img { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; background: white; }
.product-image-fallback { position: relative; z-index: 0; }

.simulation-badge { padding: 6px 10px; border-radius: 99px; color: var(--purple); background: var(--purple-soft); font-size: 9px; font-weight: 750; }
.simulation-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); align-items: start; gap: 18px; }
.simulation-form-panel, .simulation-results-panel { overflow: visible; }
.step-badge { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--purple); background: var(--purple-soft); font-size: 10px; font-weight: 800; }
.simulation-form { display: grid; gap: 19px; padding: 21px 23px 23px; }
.simulation-field { display: grid; gap: 6px; min-width: 0; color: #626b7c; font-size: 10px; font-weight: 700; }
.simulation-field > input { width: 100%; height: 40px; padding: 0 11px; font-size: 12px; }
.simulation-field > small { color: #959cab; font-size: 8px; font-weight: 500; }
.simulation-cart-items { display: grid; gap: 8px; }
.simulation-cart-empty { min-height: 72px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; border: 1px dashed #dfe2ea; border-radius: 9px; color: #8d94a3; background: #fafbfc; }
.simulation-cart-empty span { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; color: var(--purple); background: var(--purple-soft); }
.simulation-cart-empty p { max-width: 340px; margin: 0; font-size: 9px; line-height: 1.45; }
.simulation-cart-line { display: grid; grid-template-columns: 52px minmax(0, 1fr) 74px 26px; align-items: start; gap: 10px; padding: 10px; border: 1px solid #e7e9ef; border-radius: 10px; background: #fafbfc; }
.simulation-product-copy { min-width: 0; }
.simulation-product-copy > b { display: block; overflow: hidden; margin-bottom: 6px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.simulation-product-copy label, .quantity-field { display: grid; gap: 4px; color: #8a91a0; font-size: 8px; font-weight: 650; }
.simulation-product-copy select, .simulation-product-copy input { width: 100%; height: 31px; min-width: 0; padding: 0 25px 0 8px; font-size: 9px; }
.platform-id-field { margin-top: 7px; }
.add-variant-button { min-height: 26px; margin-top: 6px; padding: 0; border: 0; color: var(--purple); background: transparent; font-size: 8px; font-weight: 750; text-align: left; }
.add-variant-button:hover { color: var(--purple-dark); text-decoration: underline; }
.quantity-field input { width: 100%; height: 31px; min-width: 0; padding: 0 7px; font-size: 10px; }
.simulation-line-error { margin: 0; color: var(--red); font-size: 8px; }
.remove-cart-item { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; color: #9da3ae; background: transparent; font-size: 16px; }
.remove-cart-item:hover { color: var(--red); background: var(--red-soft); }
.simulation-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 17px; border-top: 1px solid var(--line); }
.simulation-submit-row > span { color: #8991a1; font-size: 9px; }
.simulation-submit-row button:disabled { cursor: not-allowed; opacity: .55; }
.simulation-results { min-height: 440px; padding: 20px 22px 22px; }
.simulation-placeholder, .simulation-loading, .simulation-error-state, .no-quotes { min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px 20px; text-align: center; }
.simulation-placeholder > span, .simulation-error-state > span, .no-quotes > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; color: var(--purple); background: var(--purple-soft); font-size: 18px; }
.simulation-placeholder h3, .simulation-loading h3, .simulation-error-state h3, .no-quotes h3 { margin: 13px 0 5px; font-size: 14px; }
.simulation-placeholder p, .simulation-loading p, .simulation-error-state p, .no-quotes p { max-width: 330px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.simulation-loading { min-height: 380px; }
.simulation-loading i { width: 28px; height: 28px; border-width: 3px; }
.simulation-error-state > span { color: var(--red); background: var(--red-soft); }
.quote-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quote-card { padding: 16px; border: 1px solid #e3e6ed; border-radius: 11px; background: #fafbfc; }
.quote-card.PAC { border-top: 3px solid #4e7ac2; }
.quote-card.SEDEX { border-top: 3px solid #e18a4d; }
.quote-service { display: flex; align-items: center; gap: 8px; }
.quote-service > span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; color: #4e6ba8; background: #edf3ff; font-size: 12px; }
.quote-service small { display: block; color: #9aa1ae; font-size: 7px; letter-spacing: .8px; }
.quote-service b { font-size: 10px; }
.quote-card > strong { display: block; margin: 14px 0 3px; font-size: 20px; letter-spacing: -.5px; }
.quote-card > p { margin: 0 0 12px; color: #757e8f; font-size: 9px; }
.allowed-badge { color: var(--green); font-size: 8px; font-weight: 750; }
.no-quotes { min-height: 190px; padding-block: 20px; }
.simulation-audit { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.audit-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.audit-heading h3 { margin: 2px 0 0; font-size: 13px; }
.audit-heading > span { min-width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: var(--purple); background: var(--purple-soft); font-size: 9px; font-weight: 750; }
.applied-rule-list { display: grid; gap: 6px; margin: 12px 0; padding: 0; list-style: none; }
.applied-rule-list li { display: flex; align-items: center; gap: 8px; padding: 9px; border-radius: 8px; color: #50596b; background: #f7f7fa; font-size: 9px; }
.applied-rule-list li span { color: var(--purple); }
.audit-empty { margin: 12px 0; color: #8d94a3; font-size: 9px; }
.audit-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 11px; }
.audit-metrics span { display: grid; gap: 2px; padding: 8px; border-radius: 7px; color: #8991a0; background: #fafbfc; font-size: 7px; text-align: center; }
.audit-metrics b { color: var(--ink); font-size: 12px; }
.removed-services { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 11px; color: #8b92a0; font-size: 8px; }
.simulation-warnings { margin-top: 12px; padding: 10px; border-radius: 8px; color: #7c6545; background: #fff8e9; font-size: 8px; }
.simulation-warnings > b { display: block; margin-bottom: 6px; }
.simulation-warnings p { display: flex; gap: 7px; margin: 4px 0; line-height: 1.4; }
.simulation-warnings p span { font-weight: 800; }

.integration-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.integration-card { min-height: 250px; display: grid; grid-template-columns: 62px 1fr; gap: 18px; padding: 26px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); }
.integration-logo { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; font-size: 22px; font-weight: 850; }
.yampi-logo { color: #6453d7; background: #eeeaff; }
.correios-logo { color: #2665a8; background: #e8f3ff; }
.integration-copy > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.integration-copy h3 { margin: 2px 0; font-size: 17px; }
.integration-copy p { min-height: 45px; margin: 13px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.connection-badge { padding: 4px 8px; border-radius: 99px; color: var(--amber); background: var(--amber-soft); font-size: 9px; font-weight: 750; }
.connection-badge.ok { color: var(--green); background: var(--green-soft); }
.vault-pill { padding: 6px 10px; border-radius: 99px; color: var(--amber); background: var(--amber-soft); font-size: 9px; font-weight: 750; }
.vault-pill.ok { color: var(--green); background: var(--green-soft); }
.integration-copy dl { margin: 0; border-top: 1px solid #edf0f4; }
.integration-copy dl div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid #edf0f4; }
.integration-copy dt { color: #9299a8; font-size: 10px; }
.integration-copy dd { margin: 0; color: #4e5769; font-size: 10px; font-weight: 650; }
.credentials-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.credentials-panel { overflow: hidden; }
.credentials-heading { min-height: 96px; display: flex; align-items: center; gap: 15px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.credentials-heading .integration-logo { flex: 0 0 46px; width: 46px; height: 46px; font-size: 18px; }
.credentials-heading h3 { margin: 2px 0 3px; font-size: 15px; }
.credentials-heading p { margin: 0; color: var(--muted); font-size: 9px; }
.credentials-form { padding: 21px 22px 22px; }
.credential-fields { display: grid; gap: 13px; }
.credential-fields.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.credential-fields .wide { grid-column: 1 / -1; }
.credential-fields label { display: grid; gap: 6px; min-width: 0; color: #626b7c; font-size: 9px; font-weight: 700; }
.credential-fields input, .credential-fields select { width: 100%; height: 38px; min-width: 0; padding: 0 10px; font-size: 10px; }
.credential-fields label > small { color: #959cab; font-size: 8px; font-weight: 500; line-height: 1.4; }
.service-code-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.advanced-fields { margin-top: 15px; padding: 12px 13px; border: 1px solid #e6e8ee; border-radius: 9px; background: #fafbfc; }
.advanced-fields summary { color: #677084; font-size: 9px; font-weight: 700; cursor: pointer; }
.advanced-fields[open] summary { margin-bottom: 12px; }
.contract-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 11px 12px; border-radius: 8px; color: #6e6549; background: #fff9e9; }
.contract-note span { flex: 0 0 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: var(--amber); background: white; font-size: 8px; font-weight: 800; }
.contract-note p { margin: 1px 0 0; font-size: 8px; line-height: 1.45; }
.credentials-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.credentials-actions button { min-height: 36px; padding-inline: 12px; font-size: 10px; }
.credentials-actions .danger-button { margin-right: auto; }
.security-note { display: flex; gap: 13px; margin-top: 18px; padding: 18px 20px; }
.security-note > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--purple); background: var(--purple-soft); font-size: 12px; font-weight: 800; }
.security-note h3 { margin: 1px 0 3px; font-size: 12px; }
.security-note p { margin: 0; color: var(--muted); font-size: 10px; }

.modal { width: min(94vw, 680px); max-height: 90vh; padding: 0; overflow-x: hidden; overflow-y: auto; border: 0; border-radius: 15px; color: var(--ink); background: white; box-shadow: 0 28px 90px rgba(17,24,39,.25); }
.modal::backdrop { background: rgba(17,24,39,.55); backdrop-filter: blur(3px); }
.auth-modal { width: min(92vw, 430px); text-align: center; }
.auth-modal form { padding: 38px; }
.modal-symbol { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 14px; color: white; background: linear-gradient(145deg,#7b69ef,#5543c7); font-size: 21px; }
.auth-modal h2 { margin: 8px 0; font-size: 22px; }
.auth-modal p { margin: 0 0 22px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.auth-modal code { color: var(--purple); }
.auth-modal label + label { margin-top: 12px; }
.modal label { display: grid; gap: 7px; color: #626b7c; font-size: 10px; font-weight: 650; text-align: left; }
.modal input, .modal select { width: 100%; height: 40px; padding: 0 11px; font-size: 12px; }
.form-error { min-height: 18px; margin: 8px 0 !important; color: var(--red) !important; }
.rule-modal form { padding: 0 28px 24px; }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 24px 0 18px; border-bottom: 1px solid var(--line); background: white; }
.modal-header h2 { margin: 3px 0 0; font-size: 20px; }
.close-button { width: 34px; height: 34px; border: 0; border-radius: 8px; color: #7a8292; background: #f3f4f7; font-size: 23px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 21px 0; }
.form-grid .wide { grid-column: 1 / -1; }
.form-section { padding: 19px 0; border-top: 1px solid var(--line); }
.form-section-head { display: flex; align-items: center; justify-content: space-between; }
.form-section h3 { margin: 2px 0; font-size: 14px; }
.condition-list { display: grid; gap: 8px; margin-top: 13px; }
.condition-row { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr 30px; gap: 7px; padding: 9px; border: 1px solid #e5e7ed; border-radius: 9px; background: #fafbfc; }
.condition-row select, .condition-row input { height: 34px; min-width: 0; font-size: 10px; }
.condition-value-slot { min-width: 0; }
.condition-value-slot > input { width: 100%; }
.condition-row.product-condition-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px; align-items: start; }
.condition-row.product-condition-row .condition-value-slot { grid-column: 1 / -1; }
.condition-row.product-condition-row .remove-condition { grid-column: 3; grid-row: 1; }
.condition-row.product-condition-row .product-picker-results { top: calc(100% - 16px); }
.condition-row .remove-condition { border: 0; border-radius: 6px; color: #a0a6b2; background: transparent; font-size: 17px; }
.condition-row .remove-condition:hover { color: var(--red); background: var(--red-soft); }
.action-row { display: flex; align-items: center; gap: 9px; margin-top: 11px; padding: 13px; border-radius: 9px; color: #5e6778; background: #f8f8fb; font-size: 11px; }
.action-row .action-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: var(--red); background: var(--red-soft); font-weight: 800; }
.action-row select { width: 100px; height: 32px; margin-left: auto; font-size: 10px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-footer > div { display: flex; gap: 8px; }
.switch-label { display: flex !important; grid: none !important; flex-direction: row; align-items: center; gap: 8px !important; cursor: pointer; }
.switch-label input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 34px; height: 19px; border-radius: 20px; background: #ccd1dc; }
.switch::after { content: ""; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch-label input:checked + .switch { background: var(--green); }
.switch-label input:checked + .switch::after { transform: translateX(15px); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 360px; padding: 12px 17px; border-radius: 9px; color: white; background: #202839; box-shadow: 0 12px 30px rgba(0,0,0,.18); font-size: 11px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #b73a48; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 78px 1fr; }
  .sidebar { padding-inline: 11px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > span:last-child, .nav-item > span:not(.nav-icon), .sidebar-foot { display: none; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; }
  .mobile-logout { display: grid; place-items: center; }
  .main { padding-inline: 25px; }
  .hero-card { grid-template-columns: 1fr; }
  .flow-visual { max-width: 620px; width: 100%; }
  .credentials-grid { grid-template-columns: 1fr; }
  .simulation-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; z-index: 10; width: 100%; height: 64px; flex-direction: row; padding: 8px 12px; }
  .brand, .sidebar-foot { display: none; }
  .nav { width: 100%; grid-template-columns: repeat(4,1fr); }
  .nav-item { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 4px; font-size: 9px; text-align: center; }
  .nav-item > span:not(.nav-count) { display: block; }
  .nav-count { display: none; }
  .main { padding: 0 14px 84px; }
  .topbar { height: 92px; }
  .topbar h1 { font-size: 22px; }
  .environment-pill, #newRuleTopButton { display: none; }
  .hero-card { padding: 28px 24px; }
  .flow-visual { grid-template-columns: 1fr 24px 1fr 24px 1fr; }
  .flow-node { min-height: 90px; }
  .flow-line span { display: none; }
  .stats-grid, .content-grid, .integration-grid { grid-template-columns: 1fr; }
  .credential-fields.two-columns { grid-template-columns: 1fr; }
  .credential-fields .wide { grid-column: auto; }
  .section-intro { display: block; }
  .filter-row { flex-direction: column; margin-top: 14px; }
  .search-box { width: 100%; }
  .filter-row select { width: 100%; }
  .rules-table th:nth-child(2), .rules-table td:nth-child(2), .rules-table th:nth-child(4), .rules-table td:nth-child(4) { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .condition-row { grid-template-columns: 1fr; }
  .condition-row.product-condition-row { grid-template-columns: 1fr; }
  .condition-row.product-condition-row .condition-value-slot, .condition-row.product-condition-row .remove-condition { grid-column: auto; grid-row: auto; }
  .condition-row .remove-condition { height: 28px; }
  .action-row { display: grid; grid-template-columns: 25px minmax(0, 1fr); align-items: center; }
  .action-row .action-icon { grid-row: 1 / span 2; }
  .action-row select { width: 100%; margin-left: 0; }
  .action-row > span:last-child { grid-column: 2; color: #8b92a0; font-size: 9px; }
  .credentials-actions .danger-button { flex-basis: 100%; margin-right: 0; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  .form-footer > div { width: 100%; }
  .form-footer button { flex: 1; }
  .simulation-cart-line { grid-template-columns: 45px minmax(0, 1fr) 26px; align-items: start; }
  .simulation-product-image { width: 45px; height: 45px; }
  .quantity-field { grid-column: 2; }
  .remove-cart-item { grid-column: 3; grid-row: 1; }
  .simulation-submit-row { align-items: stretch; flex-direction: column; }
  .simulation-submit-row button { width: 100%; }
  .quote-grid { grid-template-columns: 1fr; }
  .product-result-action { display: none; }
}

@media (max-width: 480px) {
  .rules-table { table-layout: fixed; }
  .rules-table th, .rules-table td { padding: 10px 8px; }
  .rules-table th:nth-child(3), .rules-table td:nth-child(3), .rules-table th:nth-child(5), .rules-table td:nth-child(5) { display: none; }
  .rules-table th:last-child, .rules-table td:last-child { width: 112px; }
  .rule-name { max-width: 100%; }
}
