:root {
  --ink: #17211c;
  --ink-2: #29352f;
  --muted: #68736d;
  --muted-2: #8a948f;
  --canvas: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --line: #dfe5e1;
  --line-strong: #cbd4cf;
  --forest: #167253;
  --forest-dark: #105c43;
  --forest-soft: #e6f4ed;
  --blue: #315f9f;
  --blue-soft: #eaf0f8;
  --amber: #9a6414;
  --amber-soft: #fff4dc;
  --coral: #bd5540;
  --coral-soft: #faeae6;
  --nav: #18251f;
  --nav-muted: #a9b6af;
  --shadow-sm: 0 1px 2px rgba(17, 33, 25, .06);
  --shadow-md: 0 16px 44px rgba(17, 33, 25, .12);
  --radius: 8px;
}

* { box-sizing: border-box; letter-spacing: 0; }
html { color: var(--ink); background: var(--canvas); font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
body { margin: 0; min-width: 320px; font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .46; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: 0 0 auto; }
h1, h2, h3, p { margin-top: 0; }

:focus-visible { outline: 3px solid rgba(22, 114, 83, .22); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px 16px; background: var(--nav); color: #fff; z-index: 30; }
.brand { height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 8px; font-size: 17px; font-weight: 750; }
.brand-symbol { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; color: #fff; background: var(--forest); font-size: 15px; font-weight: 800; }
.market-label { margin: 24px 8px 12px; color: var(--nav-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.flag-dot { width: 7px; height: 7px; border-radius: 50%; background: #f0c04e; box-shadow: 0 0 0 3px rgba(240, 192, 78, .12); }
.side-nav { display: grid; gap: 4px; }
.side-nav-item { min-height: 42px; width: 100%; border: 0; border-radius: 7px; display: flex; align-items: center; gap: 11px; padding: 0 11px; color: var(--nav-muted); background: transparent; text-align: left; font-weight: 600; }
.side-nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.side-nav-item.active { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 3px 0 0 #48b78d; }
.sidebar-foot { margin-top: auto; display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: center; gap: 9px; padding: 14px 6px 2px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-foot .user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #f0c04e; color: #4d3b0a; font-weight: 800; }
.sidebar-foot strong, .sidebar-foot span { display: block; }
.sidebar-foot strong { font-size: 13px; }
.sidebar-foot span { color: var(--nav-muted); font-size: 11px; }
.sidebar-foot .icon-btn { color: var(--nav-muted); border-color: transparent; background: transparent; }

.main-shell { min-width: 0; }
.app-topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(12px); }
.app-topbar h1 { margin: 2px 0 0; font-size: 19px; line-height: 1.2; font-weight: 750; }
.breadcrumb { margin: 0; color: var(--muted-2); font-size: 11px; font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.rate-chip { min-width: 116px; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.rate-chip span { color: var(--muted); font-size: 10px; font-weight: 700; }
.rate-chip strong { font-size: 14px; }
.rate-chip.dual-rate { min-width: 158px; display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; }
.rate-chip.dual-rate strong { font-size: 12px; text-align: right; }
.mobile-settings { display: none !important; }
.main-content { padding: 22px 24px 48px; }
.mobile-nav { display: none; }

.tool-surface, .data-surface, .analytics-panel, .settings-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.customer-strip { min-height: 74px; display: flex; align-items: flex-end; gap: 14px; padding: 13px 15px; margin-bottom: 14px; }
.field { display: grid; gap: 7px; }
.field > span, .field label, .field-label, .field.compact > label { color: var(--muted); font-size: 11px; font-weight: 700; }
.field.grow { flex: 1 1 190px; }
.field.compact { gap: 5px; }
.field input, .field select, .field textarea, .search-box, .inline-money { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.field input, .field select { height: 38px; padding: 0 10px; }
.field textarea { min-height: 92px; resize: vertical; padding: 10px 11px; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus, .search-box:focus-within, .inline-money:focus-within { outline: 3px solid rgba(22, 114, 83, .12); border-color: var(--forest); }
.stage-field { width: 128px; }
.segmented { min-height: 38px; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.segmented button { min-width: 62px; border: 0; border-radius: 5px; padding: 5px 10px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 700; white-space: nowrap; }
.segmented button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(17,33,25,.12); }

.workbench-grid { display: grid; grid-template-columns: minmax(350px, 420px) minmax(570px, 1fr); align-items: start; gap: 14px; }
.script-pane, .quote-pane { min-width: 0; overflow: visible; }
.script-pane { position: sticky; top: 90px; max-height: calc(100vh - 112px); display: flex; flex-direction: column; }
.pane-head { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pane-head h2 { margin: 1px 0 0; font-size: 16px; font-weight: 750; }
.eyebrow { margin: 0; color: var(--muted-2); font-size: 10px; line-height: 1.2; text-transform: uppercase; font-weight: 800; }
.count-badge { min-width: 28px; height: 24px; display: grid; place-items: center; padding: 0 7px; border-radius: 12px; color: var(--forest); background: var(--forest-soft); font-size: 11px; font-weight: 800; }
.search-box { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.search-box svg { color: var(--muted-2); }
.search-box input { min-width: 0; width: 100%; height: 36px; padding: 0; border: 0; outline: 0; background: transparent; }
.script-pane > .search-box { width: auto; margin: 12px 12px 8px; }
.script-language-bar { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px 8px; }
.script-language-bar > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.script-tools-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; padding: 0 12px 11px; border-bottom: 1px solid var(--line); }
.script-stage-select, .script-copy-language { min-width: 0; display: grid; gap: 5px; }
.script-stage-select > span, .script-copy-language > span { color: var(--muted); font-size: 10px; font-weight: 750; }
.script-stage-select select { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; outline: 0; background: #fff; font-size: 11px; font-weight: 700; }
.script-stage-select select:focus { outline: 3px solid rgba(22,114,83,.12); border-color: var(--forest); }
.compact-segmented { min-height: 32px; }
.compact-segmented button { min-width: 54px; padding: 3px 8px; }
.stage-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 10px; scrollbar-width: none; }
.stage-tabs::-webkit-scrollbar { display: none; }
.stage-tabs button, .filter-tabs button { border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; color: var(--muted); background: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.stage-tabs button.active, .filter-tabs button.active { border-color: var(--forest); color: var(--forest-dark); background: var(--forest-soft); }
.script-feed { min-height: 280px; overflow-y: auto; padding: 3px 12px 12px; }
.script-item { position: relative; padding: 13px 42px 13px 13px; border-top: 1px solid var(--line); }
.script-feed .script-item:first-child { border-top: 0; }
.script-item h3 { margin: 7px 0 5px; font-size: 13px; font-weight: 750; }
.script-meta { display: flex; align-items: center; gap: 6px; }
.stage-badge, .review-badge, .status-pill, .category-label { display: inline-flex; align-items: center; min-height: 22px; border-radius: 5px; padding: 2px 7px; font-size: 10px; font-weight: 750; }
.stage-badge { color: var(--blue); background: var(--blue-soft); }
.review-badge { color: var(--amber); background: var(--amber-soft); }
.script-item .trigger { margin: 0 0 6px; color: var(--amber); font-size: 11px; }
.script-item .chinese-script { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink-2); font-size: 12px; line-height: 1.62; -webkit-line-clamp: 5; -webkit-box-orient: vertical; white-space: pre-line; }
.script-item .chinese-script.full { -webkit-line-clamp: 8; }
.script-actions { position: absolute; top: 12px; right: 8px; display: flex; gap: 3px; }
.script-actions .text-btn { display: none; }
.script-library .script-actions { position: static; justify-content: flex-end; margin-top: 10px; }
.script-library .script-actions .text-btn { display: inline-flex; }
.script-item.needs-review { background: #fffcf6; }

.quote-head { min-height: 72px; }
.profit-indicator { min-width: 170px; display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: baseline; padding: 8px 11px; border-radius: 6px; }
.profit-indicator span { grid-column: 1; color: inherit; font-size: 10px; font-weight: 750; }
.profit-indicator strong { grid-column: 1; font-size: 19px; line-height: 1.15; }
.profit-indicator i { grid-column: 2; grid-row: 1 / 3; align-self: center; font-style: normal; font-size: 12px; font-weight: 800; }
.success { color: var(--forest-dark); }
.profit-indicator.success, .profit-total.success { color: var(--forest-dark); background: var(--forest-soft); }
.profit-indicator.warning, .profit-total.warning { color: var(--amber); background: var(--amber-soft); }
.profit-indicator.danger, .profit-total.danger { color: var(--coral); background: var(--coral-soft); }
.product-picker { position: relative; padding: 13px 15px 5px; z-index: 5; }
.search-box.prominent { height: 42px; }
.product-results { position: absolute; top: 60px; left: 15px; right: 15px; max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow-md); }
.product-results:empty { display: none; }
.product-result { width: 100%; min-height: 53px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 11px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; }
.product-result:last-child { border-bottom: 0; }
.product-result:hover { background: var(--surface-2); }
.product-result strong, .product-result small { display: block; }
.product-result strong { font-size: 12px; }
.product-result small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.result-price { display: flex; align-items: center; gap: 8px; font-weight: 750; white-space: nowrap; }
.result-price i { color: var(--amber); font-size: 10px; font-style: normal; }
.picker-empty { padding: 18px; color: var(--muted); text-align: center; }
.quote-items { margin-top: 6px; padding: 0 15px; }
.quote-row { min-height: 62px; display: grid; grid-template-columns: minmax(180px, 1fr) 104px 116px 88px 34px; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.quote-row.quote-header { min-height: 34px; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 750; }
.quote-row.quote-header span:first-child { padding-left: 8px; }
.quote-product { min-width: 0; padding-left: 8px; }
.quote-product strong, .quote-product span, .quote-product em { display: block; }
.quote-product strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.quote-product span { color: var(--muted); font-size: 10px; }
.quote-product em { width: max-content; margin-top: 2px; color: var(--amber); font-size: 9px; font-style: normal; font-weight: 700; }
.stepper { height: 32px; display: grid; grid-template-columns: 28px 42px 28px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stepper button, .stepper input { min-width: 0; border: 0; background: #fff; text-align: center; }
.stepper button { color: var(--muted); font-size: 16px; }
.stepper button:hover { color: var(--forest); background: var(--forest-soft); }
.stepper input { width: 42px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.inline-money { height: 34px; display: flex; align-items: center; overflow: hidden; }
.inline-money span { padding-left: 8px; color: var(--muted); font-size: 11px; }
.inline-money input { min-width: 0; width: 100%; height: 32px; border: 0; padding: 0 7px 0 3px; outline: 0; background: transparent; font-size: 12px; font-weight: 700; }
.line-total { text-align: right; font-size: 12px; }
.quote-empty { min-height: 184px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted-2); }
.quote-empty strong { margin-top: 8px; color: var(--ink-2); font-size: 13px; }
.quote-empty span { margin-top: 2px; font-size: 11px; }
.quote-controls { min-height: 66px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 11px 15px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.shipping-control { min-width: 260px; display: flex; align-items: flex-end; flex: 1 1 260px; gap: 8px; }
.shipping-control > .field-label { align-self: center; }
.shipping-control .inline-money { width: 86px; height: 38px; }
.quote-controls > .field { width: 112px; }
.quote-controls > .compact-discount { width: 232px; flex: 0 0 232px; }
.fixed-fee { min-width: 108px; min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 0 10px; border: 1px solid #e6cfa2; border-radius: 6px; color: var(--amber); background: var(--amber-soft); }
.fixed-fee span { font-size: 10px; font-weight: 700; }
.fixed-fee strong { font-size: 13px; }
.fixed-fee.large { min-height: 46px; }
.profit-breakdown { display: grid; grid-template-columns: repeat(5, minmax(84px, 1fr)) minmax(150px, 1.35fr); gap: 1px; background: var(--line); }
.profit-breakdown > div { min-height: 70px; display: flex; flex-direction: column; justify-content: center; padding: 10px 11px; background: #fff; }
.profit-breakdown span { color: var(--muted); font-size: 10px; }
.profit-breakdown strong { margin-top: 3px; font-size: 13px; }
.profit-breakdown .profit-total { position: relative; }
.profit-breakdown .profit-total span { color: inherit; }
.profit-breakdown .profit-total strong { font-size: 18px; }
.profit-breakdown .profit-total small { font-size: 10px; font-weight: 700; }
.quote-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 15px; }
.quote-language-switch { display: flex; align-items: center; gap: 9px; margin-right: auto; }
.quote-language-switch > span { color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }

.btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 6px; padding: 7px 13px; font-weight: 700; white-space: nowrap; }
.btn.primary { color: #fff; background: var(--forest); }
.btn.primary:hover { background: var(--forest-dark); }
.btn.secondary { color: var(--ink-2); border-color: var(--line-strong); background: #fff; }
.btn.secondary:hover { background: var(--surface-2); }
.btn.wide { width: 100%; min-height: 43px; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #fff; }
.icon-btn:hover { color: var(--forest); border-color: #a9c8bb; background: var(--forest-soft); }
.text-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; padding: 5px 0; color: var(--forest); background: transparent; font-size: 11px; font-weight: 750; }

.page-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.product-view-bar { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 12px; }
.product-view-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 112px; }
.page-search { width: min(360px, 100%); flex: 0 1 360px; }
.filter-tabs { display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.toolbar-actions { margin-left: auto; display: flex; gap: 8px; }
.data-surface { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 840px; }
.products-table { min-width: 1160px; }
.data-table th { height: 40px; padding: 0 13px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--surface-2); font-size: 10px; font-weight: 750; text-align: left; white-space: nowrap; }
.data-table td { height: 55px; padding: 8px 13px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcfb; }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.date-cell { color: var(--muted); font-size: 10px; white-space: nowrap; }
.positive { color: var(--forest-dark); font-weight: 750; }
.negative { color: var(--coral); font-weight: 750; }
.brl-price { color: var(--forest-dark); font-weight: 750; white-space: nowrap; }
.status-select { min-height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; background: #fff; font-size: 11px; font-weight: 700; }
.status-select.status-paid, .status-select.status-shipped, .status-select.status-completed { color: var(--forest-dark); background: var(--forest-soft); }
.status-select.status-lost { color: var(--coral); background: var(--coral-soft); }
.sku-code { padding: 3px 6px; border-radius: 4px; color: var(--blue); background: var(--blue-soft); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; font-weight: 750; }
.category-label { color: var(--muted); background: #eef1ef; }
.status-pill.success { color: var(--forest-dark); background: var(--forest-soft); }
.status-pill.warning { color: var(--amber); background: var(--amber-soft); }
.status-pill.danger { color: var(--coral); background: var(--coral-soft); }
.status-pill.neutral { color: var(--muted); background: #eef1ef; }
.inactive-row { opacity: .58; }

.quote-sheet-toolbar { align-items: center; }
.quote-category-tabs { flex: 1 1 auto; }
.customer-price-sheet { max-width: 1080px; margin: 0 auto; overflow: hidden; border: 1px solid #cfd8d3; border-radius: 6px; background: #fff; box-shadow: var(--shadow-sm); }
.price-sheet-head { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; color: #fff; background: #18372b; }
.price-sheet-head p { margin: 0 0 3px; color: #a8cabc; font-size: 10px; font-weight: 800; }
.price-sheet-head h2 { margin: 0; font-size: 21px; line-height: 1.25; font-weight: 750; }
.price-sheet-head > span { min-width: max-content; padding: 5px 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; color: #d9e8e2; font-size: 10px; font-weight: 750; }
.customer-price-table { width: 100%; min-width: 0; border-collapse: collapse; table-layout: fixed; }
.customer-price-table .product-col { width: 34%; }
.customer-price-table .spec-col { width: 28%; }
.customer-price-table .usd-col { width: 16%; }
.customer-price-table .brl-col { width: 22%; }
.customer-price-table th { height: 38px; padding: 0 16px; border-bottom: 1px solid #dce4df; color: #68736d; background: #f4f7f5; font-size: 10px; font-weight: 800; text-align: left; }
.customer-price-table th:nth-child(3), .customer-price-table th:nth-child(4) { text-align: right; }
.price-column-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.customer-price-table th:nth-child(3) .price-column-head, .customer-price-table th:nth-child(4) .price-column-head { justify-content: flex-end; }
.price-filter-button { width: 24px; height: 24px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid transparent; border-radius: 4px; color: #7a8580; background: transparent; }
.price-filter-button:hover { color: var(--forest); border-color: #b9cec5; background: #fff; }
.price-filter-button.active { color: #fff; background: var(--forest); }
.customer-price-table td { min-height: 40px; padding: 9px 16px; border-bottom: 1px solid #e6ebe8; color: #26342e; font-size: 12px; vertical-align: middle; overflow-wrap: anywhere; }
.customer-price-table tr:last-child td { border-bottom: 0; }
.customer-price-table .product-group-start td { border-top: 1px solid #cfd8d3; }
.customer-price-table tbody .product-group-start:first-child td { border-top: 0; }
.quote-product-name { color: #152b23 !important; background: #fbfcfb; font-weight: 750; vertical-align: top !important; }
.quote-usd, .quote-brl { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 750; }
.quote-usd { color: #243a31 !important; }
.quote-brl { color: var(--forest-dark) !important; }
.price-sheet-exit { display: none; }
.price-filter-menu { position: fixed; z-index: 80; max-height: calc(100vh - 110px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; box-shadow: 0 18px 48px rgba(17,33,25,.2); }
.price-filter-menu-head { height: 46px; display: flex; flex: 0 0 46px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px 0 13px; border-bottom: 1px solid var(--line); cursor: grab; touch-action: none; user-select: none; }
.price-filter-menu-head.dragging { cursor: grabbing; }
.price-filter-title { min-width: 0; display: flex; align-items: center; gap: 7px; }
.price-filter-title svg { color: var(--muted-2); }
.price-filter-menu-head strong { font-size: 13px; }
.price-filter-menu-head .icon-btn { width: 28px; height: 28px; cursor: pointer; touch-action: auto; }
.price-sort-actions { display: grid; grid-template-columns: 1fr 1fr; flex: 0 0 auto; gap: 7px; padding: 10px; border-bottom: 1px solid var(--line); }
.price-sort-actions button { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-2); background: var(--surface-2); font-size: 11px; font-weight: 700; }
.price-sort-actions button:hover { color: var(--forest-dark); border-color: #aac6ba; background: var(--forest-soft); }
.price-filter-menu > form { min-height: 0; display: flex; flex: 1 1 auto; flex-direction: column; overflow: hidden; }
.price-option-tools { display: grid; flex: 0 0 auto; gap: 7px; padding: 10px 10px 8px; }
.price-option-tools .search-box { min-height: 34px; }
.price-option-tools .search-box input { height: 32px; font-size: 11px; }
.price-option-tools > small { color: var(--muted); font-size: 9px; }
.price-option-tools > div:last-child { display: flex; gap: 12px; }
.price-option-tools > div:last-child button { border: 0; padding: 0; color: var(--forest); background: transparent; font-size: 10px; font-weight: 750; }
.price-filter-options { min-height: 86px; max-height: 310px; flex: 1 1 auto; overflow-y: auto; margin: 0 10px; border: 1px solid var(--line); border-radius: 5px; }
.price-filter-options label { min-height: 34px; display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: center; gap: 7px; padding: 6px 9px; border-bottom: 1px solid #edf0ee; font-size: 11px; }
.price-filter-options label[hidden] { display: none; }
.price-filter-options label:last-child { border-bottom: 0; }
.price-filter-options label:hover { background: var(--surface-2); }
.price-filter-options input { width: 15px; height: 15px; margin: 0; accent-color: var(--forest); }
.price-filter-options span { min-width: 0; overflow-wrap: anywhere; }
.price-range-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 10px 5px; }
.price-filter-rate { margin: 0; padding: 4px 10px 8px; color: var(--muted); font-size: 10px; }
.price-filter-actions { display: grid; grid-template-columns: 1fr 1fr; flex: 0 0 auto; gap: 8px; padding: 10px; background: #fff; }
.price-filter-actions .btn { min-width: 0; padding-inline: 8px; font-size: 11px; }

body.price-sheet-mode { background: #fff; }
body.price-sheet-mode .app-shell { display: block; padding: 0; }
body.price-sheet-mode .sidebar,
body.price-sheet-mode .app-topbar,
body.price-sheet-mode .mobile-nav,
body.price-sheet-mode .product-view-bar,
body.price-sheet-mode .quote-sheet-toolbar { display: none !important; }
body.price-sheet-mode .price-filter-button,
body.price-sheet-mode .price-filter-menu { display: none !important; }
body.price-sheet-mode .main-content { padding: 16px; }
body.price-sheet-mode .customer-price-sheet { max-width: 1080px; border: 0; box-shadow: none; }
body.price-sheet-mode .price-sheet-exit { position: fixed; top: 10px; right: 10px; z-index: 100; display: inline-grid; color: #fff; border-color: rgba(255,255,255,.28); background: rgba(12,31,24,.72); }

.metric-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric { min-height: 92px; display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; }
.metric-icon.success { color: var(--forest); background: var(--forest-soft); }
.metric-icon.warning { color: var(--amber); background: var(--amber-soft); }
.metric-icon.danger { color: var(--coral); background: var(--coral-soft); }
.metric-icon.neutral { color: var(--blue); background: var(--blue-soft); }
.metric span, .metric strong { display: block; }
.metric > div > span { color: var(--muted); font-size: 11px; }
.metric strong { margin-top: 3px; font-size: 20px; }
.compact-metrics .metric { min-height: 76px; }
.compact-metrics .metric strong { font-size: 18px; }

.dashboard-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; margin-bottom: 14px; }
.analytics-panel { min-width: 0; overflow: hidden; }
.bar-list { min-height: 278px; display: flex; flex-direction: column; justify-content: center; gap: 15px; padding: 18px; }
.bar-row { display: grid; grid-template-columns: minmax(100px, 150px) 1fr 28px; align-items: center; gap: 11px; font-size: 11px; }
.bar-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row > div, .thin-bar { height: 7px; overflow: hidden; border-radius: 4px; background: #edf1ef; }
.bar-row > div i { height: 100%; display: block; border-radius: 4px; background: var(--forest); }
.bar-row strong { text-align: right; }
.status-breakdown { min-height: 278px; display: grid; align-content: center; gap: 13px; padding: 18px; }
.status-breakdown > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px; }
.status-breakdown span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.status-breakdown .thin-bar { grid-column: 1 / 3; height: 5px; }
.thin-bar i { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--blue); }
.status-dot.paid, .status-dot.shipped, .status-dot.completed { background: var(--forest); }
.status-dot.lost { background: var(--coral); }
.recent-orders { margin-bottom: 18px; }

.script-library { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.script-library .script-item { min-height: 214px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.script-library .script-item.needs-review { background: #fffcf6; }
.script-library .script-item .chinese-script { font-size: 12px; }
.script-filter-tabs { flex: 1; }
.copy-language-control { min-height: 38px; }
.copy-language-control button { min-width: 78px; }

.library-count { color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.coa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.coa-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.coa-preview { width: 100%; height: 310px; display: grid; place-items: center; overflow: hidden; border: 0; border-bottom: 1px solid var(--line); padding: 12px; background: #eef2f0; }
.coa-preview img { width: 100%; height: 100%; object-fit: contain; transition: transform .18s ease; }
.coa-preview:hover img { transform: scale(1.015); }
.coa-card-body { padding: 13px; }
.coa-title-row { min-height: 48px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.coa-title-row h3 { margin: 0; font-size: 14px; }
.coa-title-row small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.coa-title-row > div { min-width: 0; }
.coa-actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 7px; margin-top: 12px; }
.coa-full-preview { display: grid; place-items: start center; max-height: calc(100vh - 170px); overflow: auto; padding: 14px; background: #edf1ef; }
.coa-full-preview img { width: min(820px, 100%); height: auto; display: block; }

.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.case-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.case-cover { width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; border: 0; border-bottom: 1px solid var(--line); color: var(--muted-2); background: #edf1ef; }
.case-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .18s ease; }
.case-cover:hover img { transform: scale(1.02); }
.case-card-body { display: grid; gap: 11px; padding: 14px; }
.case-card h3 { margin: 0; font-size: 15px; }
.case-card p { min-height: 34px; margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.case-meta { display: flex; gap: 7px; }
.case-meta span { padding: 3px 7px; border-radius: 5px; color: var(--muted); background: var(--surface-2); font-size: 10px; font-weight: 700; }
.case-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.case-description { margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.case-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding: 16px 18px; }
.case-image-tile { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; padding: 0; background: #fff; text-align: left; }
.case-image-tile img { width: 100%; aspect-ratio: 8 / 5; display: block; object-fit: cover; object-position: top; }
.case-image-tile span { display: block; padding: 8px 10px; font-size: 11px; font-weight: 750; }
.case-full-preview { max-height: calc(100vh - 78px); overflow: auto; padding: 12px; background: #e9eeeb; text-align: center; }
.case-full-preview img { width: min(900px, 100%); height: auto; display: inline-block; }

.knowledge-toolbar .page-search { min-width: min(420px, 100%); }
.knowledge-section-tabs { flex: 0 0 auto; }
.knowledge-control-band { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 0; }
.knowledge-category-tabs { min-width: 0; flex: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.knowledge-category-tabs button { flex: 0 0 auto; }
.knowledge-language-control { flex: 0 0 auto; }
.knowledge-notice { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; border-left: 3px solid var(--amber); padding: 9px 12px; color: var(--muted); background: #fffdf5; font-size: 10.5px; }
.knowledge-notice svg { flex: 0 0 auto; color: #9c7116; }
.knowledge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.knowledge-card { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.knowledge-card-head { min-height: 92px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 15px 11px; }
.knowledge-card-head > div { min-width: 0; }
.knowledge-card-head h3 { margin: 7px 0 0; overflow-wrap: anywhere; font-size: 16px; line-height: 1.25; }
.knowledge-card-head p { margin: 4px 0 0; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.knowledge-category { display: inline-flex; align-items: center; min-height: 22px; border-radius: 4px; padding: 3px 7px; color: var(--forest); background: var(--forest-soft); font-size: 9px; font-weight: 800; }
.knowledge-tags { min-height: 35px; display: flex; align-items: flex-start; gap: 5px; overflow: hidden; padding: 0 15px 10px; }
.knowledge-tags span { flex: 0 0 auto; max-width: 120px; overflow: hidden; border-radius: 4px; padding: 3px 6px; color: var(--muted); background: var(--surface-2); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-tags .sku-tag { color: var(--ink); background: #edf4f1; font-weight: 800; }
.knowledge-language-label { display: flex; align-items: center; gap: 8px; padding: 0 15px; color: var(--muted-2); font-size: 9px; font-weight: 750; }
.knowledge-language-label i { height: 1px; flex: 1; background: var(--line); }
.knowledge-preview { min-height: 126px; display: -webkit-box; overflow: hidden; margin: 10px 15px 14px; color: var(--ink-2); font-size: 11.5px; line-height: 1.68; white-space: pre-line; -webkit-box-orient: vertical; -webkit-line-clamp: 6; }
.knowledge-actions { display: grid; grid-template-columns: .85fr 1.15fr; gap: 7px; margin-top: auto; border-top: 1px solid var(--line); padding: 11px 15px 14px; }
.knowledge-detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 11px 18px; }
.knowledge-detail-toolbar > span { color: var(--muted); font-size: 10px; font-weight: 750; }
.knowledge-variant-list { display: flex; flex-wrap: wrap; gap: 7px; border-bottom: 1px solid var(--line); padding: 12px 18px; background: var(--surface-2); }
.knowledge-variant-list span { min-width: 90px; display: grid; gap: 2px; border-left: 2px solid var(--forest); padding: 3px 9px; background: #fff; }
.knowledge-variant-list strong { font-size: 10px; }
.knowledge-variant-list small { color: var(--muted); font-size: 9px; }
.knowledge-full-text { max-height: 48vh; overflow: auto; padding: 20px 22px; color: var(--ink-2); font-size: 13px; line-height: 1.78; white-space: pre-wrap; }
.knowledge-reference-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); background: #f8faf9; }
.knowledge-reference-grid section { min-width: 0; padding: 16px 20px; }
.knowledge-reference-grid section + section { border-left: 1px solid var(--line); }
.knowledge-reference-grid h3 { margin: 0 0 8px; font-size: 12px; }
.knowledge-reference-grid p { max-height: 190px; overflow: auto; margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.65; white-space: pre-wrap; }
.modal.knowledge-modal { width: min(960px, 100%); }
.knowledge-form textarea { resize: vertical; }
.upload-order-list { display: grid; gap: 7px; }
.upload-order-row { min-height: 48px; display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 12px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.upload-order-row > span { overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.upload-order-row label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.upload-order-row input { width: 64px; height: 32px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 8px; background: #fff; }

.calculator-layout { display: grid; grid-template-columns: minmax(580px, 1.45fr) minmax(310px, .55fr); align-items: start; gap: 14px; }
.calculator-builder, .calculator-summary { min-width: 0; overflow: visible; }
.calculator-picker { padding-bottom: 13px; }
.calculator-items { padding-bottom: 10px; }
.calculator-summary { position: sticky; top: 90px; overflow: hidden; border-color: #cbd8d1; box-shadow: 0 8px 28px rgba(17, 33, 25, .08); }
.calculator-summary > .pane-head { background: #fbfcfb; }
.calculator-profit { min-height: 132px; display: flex; flex-direction: column; justify-content: center; margin: 14px 15px 0; padding: 17px 18px; border: 1px solid currentColor; border-left-width: 5px; border-radius: 7px; }
.calculator-profit.success { color: var(--forest-dark); border-color: #94c5b2; background: var(--forest-soft); }
.calculator-profit.warning { color: var(--amber); border-color: #dfbf80; background: var(--amber-soft); }
.calculator-profit.danger { color: var(--coral); border-color: #dfa094; background: var(--coral-soft); }
.profit-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.calculator-profit span { font-size: 11px; font-weight: 800; }
.profit-result-head b { padding: 4px 7px; border: 1px solid currentColor; border-radius: 5px; background: rgba(255,255,255,.56); font-size: 10px; white-space: nowrap; }
.calculator-profit > strong { margin-top: 5px; font-size: 31px; line-height: 1.1; }
.calculator-profit small { margin-top: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.quote-total-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 15px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); gap: 1px; }
.quote-total-strip > div { min-width: 0; padding: 10px 9px; background: #fff; }
.quote-total-strip span, .quote-total-strip strong { display: block; }
.quote-total-strip span { color: var(--muted); font-size: 9px; font-weight: 700; }
.quote-total-strip strong { margin-top: 3px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
.quote-total-strip .discount-value strong { color: var(--coral); }
.quote-total-strip .customer-total { background: var(--forest-soft); }
.quote-total-strip .customer-total strong { color: var(--forest-dark); }
.quote-total-strip .customer-total small { display: block; margin-top: 2px; color: var(--forest-dark); font-size: 9px; font-weight: 750; }
.calculator-controls { display: grid; gap: 12px; padding: 15px; border-bottom: 1px solid var(--line); }
.calculator-controls .segmented { width: 100%; }
.discount-control { display: grid; gap: 7px; }
.discount-mode-row { display: grid; grid-template-columns: auto minmax(142px, 1fr); align-items: center; gap: 9px; }
.discount-mode-row > span, .discount-value-field > span { color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.discount-mode-row .segmented { min-height: 34px; }
.discount-mode-row .segmented button { min-width: 68px; padding: 3px 8px; }
.discount-value-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; }
.discount-input { height: 42px; display: flex; align-items: center; overflow: hidden; border: 1px solid #dfbf80; border-radius: 6px; background: #fffdf8; }
.discount-input > b { padding-left: 10px; color: var(--amber); font-size: 13px; font-weight: 800; white-space: nowrap; }
.discount-input input { min-width: 0; width: 100%; height: 40px; border: 0; padding: 0 7px 0 4px; outline: 0; background: transparent; font-size: 15px; font-weight: 800; }
.discount-input.rate-input input { padding-left: 10px; text-align: right; }
.discount-input.rate-input > b { padding: 0 10px 0 3px; }
.discount-input:focus-within { outline: 3px solid rgba(154,100,20,.13); border-color: var(--amber); }
.discount-control > small { margin-top: -2px; color: var(--amber); font-size: 10px; font-weight: 750; text-align: right; }
.discount-payable { margin-top: -5px; color: var(--forest-dark); font-size: 10px; font-weight: 700; text-align: right; }
.discount-payable strong { font-size: 11px; }
.compact-discount .discount-input { height: 34px; }
.compact-discount .discount-input input { height: 32px; font-size: 13px; }
.compact-discount .discount-value-field { grid-template-columns: 58px minmax(0, 1fr); }
.number-clean { appearance: textfield; -moz-appearance: textfield; }
.number-clean::-webkit-inner-spin-button, .number-clean::-webkit-outer-spin-button { margin: 0; appearance: none; -webkit-appearance: none; }
.calculator-breakdown { padding: 6px 15px; background: var(--surface-2); }
.calculator-breakdown > div { min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.calculator-breakdown > div:last-child { border-bottom: 0; }
.calculator-breakdown span { color: var(--muted); font-size: 11px; }
.calculator-breakdown strong { font-size: 12px; }
.calculator-breakdown .before-discount-profit { margin: 0 -15px; padding: 0 15px; border-top: 1px solid #dfbf80; border-bottom-color: #dfbf80; background: var(--amber-soft); }
.calculator-breakdown .before-discount-profit span, .calculator-breakdown .before-discount-profit strong { color: var(--amber); font-weight: 800; }
.calculator-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 15px; border-top: 1px solid var(--line); }
.calculator-actions .quote-language-switch { grid-column: 1 / 3; width: 100%; min-height: 42px; justify-content: space-between; padding: 4px 4px 4px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.calculator-actions > .btn { grid-column: 1 / 3; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 14px; margin-bottom: 14px; }
.settings-panel { overflow: hidden; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.panel-actions { display: flex; justify-content: flex-end; padding: 13px 18px; border-top: 1px solid var(--line); }
.system-list { margin: 0; padding: 5px 18px 15px; }
.system-list > div { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.system-list > div:last-child { border-bottom: 0; }
.system-list dt { color: var(--muted); }
.system-list dd { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: 700; }
.audit-panel { margin-bottom: 18px; }

.empty-state { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted-2); text-align: center; }
.empty-state p { margin: 8px 0 0; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(16, 26, 21, .48); backdrop-filter: blur(3px); }
.modal { width: min(620px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; border-radius: var(--radius); background: #fff; box-shadow: 0 24px 80px rgba(7,18,12,.3); }
.modal.wide-modal { width: min(980px, 100%); }
.modal.media-modal { width: min(920px, 100%); }
.modal.image-modal { width: min(980px, 100%); overflow: hidden; }
.modal-head { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 2px 0 0; font-size: 18px; }
.modal-form { display: grid; gap: 13px; padding: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
.toggle-row { min-height: 38px; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.toggle-row input { width: 16px; height: 16px; accent-color: var(--forest); }
.upload-zone { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px dashed #9eb7aa; border-radius: 7px; color: var(--forest); background: var(--forest-soft); cursor: pointer; }
.upload-zone span { color: var(--muted); font-size: 11px; }
.upload-zone input { max-width: 240px; margin-top: 8px; font-size: 11px; }
.order-detail-meta { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.order-detail-meta span { padding: 3px 7px; border-radius: 5px; color: var(--muted); background: #eef1ef; font-size: 10px; font-weight: 700; }
.order-lines { padding: 5px 18px; }
.order-lines > div { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.order-lines span strong, .order-lines span small { display: block; }
.order-lines span small { color: var(--muted); font-size: 10px; }
.modal-profit { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--line); gap: 1px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.modal-profit > div { min-height: 70px; display: flex; flex-direction: column; justify-content: center; padding: 10px; background: #fff; }
.modal-profit span { color: var(--muted); font-size: 10px; }
.modal-profit strong { margin-top: 3px; font-size: 13px; }
.modal-profit .highlight { color: var(--forest-dark); background: var(--forest-soft); }
.modal-profit .highlight span { color: inherit; }
.quote-preview { padding: 14px 18px 0; }
.quote-preview pre { max-height: 190px; overflow: auto; margin: 0; padding: 12px; border-radius: 6px; color: var(--ink-2); background: var(--surface-2); font: 11px/1.55 "Segoe UI", sans-serif; white-space: pre-wrap; }
.modal > .modal-actions { padding: 14px 18px 18px; }

.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { min-width: 240px; max-width: 360px; display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid #b9dacb; border-radius: 7px; color: var(--forest-dark); background: #f4fbf8; box-shadow: var(--shadow-md); font-weight: 650; }
.toast.error { border-color: #e7bfb6; color: var(--coral); background: #fff8f6; }

.login-page { min-height: 100vh; background: #edf1ef; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(520px, 1.25fr) minmax(390px, .75fr); }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 34px 44px 44px; color: #fff; background: var(--nav); }
.brand-lockup, .mobile-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 750; }
.login-brand .brand-symbol { background: #3aa77e; }
.login-brand-copy { position: relative; z-index: 2; }
.login-brand-copy p { margin-bottom: 9px; color: #86c8ad; font-size: 12px; font-weight: 750; }
.login-brand-copy h1 { margin: 0; font-size: 38px; line-height: 1.18; font-weight: 720; }
.login-visual { position: absolute; width: min(700px, 78%); height: 430px; top: 18%; right: -12%; overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; background: #f5f7f5; box-shadow: 0 36px 90px rgba(0,0,0,.34); transform: rotate(-3deg); }
.visual-toolbar { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-bottom: 1px solid #dbe2de; background: #fff; }
.visual-toolbar span { width: 7px; height: 7px; border-radius: 50%; background: #d5ded9; }
.visual-content { height: calc(100% - 34px); display: grid; grid-template-columns: 106px 1fr; }
.visual-nav { background: #223129; }
.visual-main { padding: 34px; }
.visual-lines b, .visual-lines i { display: block; border-radius: 3px; background: #d8e0dc; }
.visual-lines b { width: 150px; height: 15px; }
.visual-lines i { width: 220px; height: 8px; margin-top: 10px; }
.visual-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; }
.visual-grid span { height: 74px; border: 1px solid #dae2de; border-radius: 6px; background: #fff; }
.visual-grid span:nth-child(2) { border-top: 4px solid #3aa77e; }
.visual-grid span:nth-child(3) { border-top: 4px solid #e3b349; }
.visual-table { margin-top: 16px; overflow: hidden; border: 1px solid #d9e1dd; border-radius: 6px; background: #fff; }
.visual-table i { display: block; height: 42px; border-bottom: 1px solid #e7ece9; }
.visual-table i:last-child { border-bottom: 0; }
.login-form-wrap { display: grid; place-items: center; padding: 36px; background: #fff; }
.login-form { width: min(360px, 100%); display: grid; gap: 18px; }
.login-form h2 { margin: 3px 0 0; font-size: 25px; }
.login-form label { display: grid; gap: 6px; }
.login-form label span { color: var(--muted); font-size: 11px; font-weight: 700; }
.login-form input { height: 42px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 11px; background: #fff; }
.login-form input:focus { outline: 3px solid rgba(22,114,83,.12); border-color: var(--forest); }
.login-foot { margin: 0; color: var(--muted-2); font-size: 10px; text-align: center; }
.mobile-brand { display: none; }
.notice { padding: 10px 12px; border-radius: 6px; font-size: 12px; font-weight: 650; }
.notice.danger { color: var(--coral); background: var(--coral-soft); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 196px minmax(0, 1fr); }
  .workbench-grid { grid-template-columns: minmax(300px, .75fr) minmax(500px, 1.25fr); }
  .profit-breakdown { grid-template-columns: repeat(3, 1fr); }
  .profit-breakdown .profit-total { grid-column: span 1; }
  .script-library { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .calculator-layout { grid-template-columns: minmax(520px, 1.2fr) minmax(290px, .8fr); }
}

@media (max-width: 940px) {
  .app-shell { display: block; padding-bottom: 66px; }
  .sidebar { display: none; }
  .app-topbar { height: 68px; padding: 0 18px; }
  .mobile-settings { display: inline-grid !important; }
  .main-content { padding: 16px 14px 34px; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: 64px; display: flex; align-items: stretch; overflow-x: auto; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
  .mobile-nav-item { min-width: 54px; flex: 1 0 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; color: var(--muted); background: transparent; font-size: 8.5px; font-weight: 700; }
  .mobile-nav-item.active { color: var(--forest); }
  .customer-strip { flex-wrap: wrap; align-items: flex-end; }
  .workbench-grid { grid-template-columns: 1fr; }
  .script-pane { position: static; max-height: 520px; }
  .metric-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid, .settings-layout { grid-template-columns: 1fr; }
  .calculator-layout { grid-template-columns: 1fr; }
  .calculator-summary { position: static; }
  .login-layout { grid-template-columns: minmax(0,1fr) 420px; }
  .login-brand { padding: 28px; }
  .login-brand-copy h1 { font-size: 30px; }
  .login-visual { right: -32%; }
}

@media (max-width: 680px) {
  .app-topbar h1 { font-size: 17px; }
  .breadcrumb { display: none; }
  .rate-chip { min-width: 106px; }
  .customer-strip { gap: 10px; }
  .customer-strip .field.grow { flex-basis: calc(50% - 5px); }
  .stage-field { width: calc(50% - 5px); }
  .quote-pane { overflow: hidden; }
  .quote-head { align-items: flex-start; }
  .profit-indicator { min-width: 142px; }
  .quote-items { padding: 0; }
  .quote-row.quote-header { display: none; }
  .quote-row { grid-template-columns: minmax(0,1fr) 94px 34px; gap: 8px; padding: 10px 12px; }
  .quote-product { grid-column: 1 / 3; padding-left: 0; }
  .quote-row .stepper { grid-column: 1; grid-row: 2; }
  .quote-row .inline-money { grid-column: 2; grid-row: 2; }
  .quote-row .line-total { grid-column: 1 / 3; grid-row: 3; text-align: left; }
  .quote-row .remove-item { grid-column: 3; grid-row: 1; }
  .quote-controls { flex-wrap: wrap; align-items: flex-end; }
  .shipping-control { width: 100%; flex-wrap: wrap; }
  .shipping-control > .field-label { width: 100%; }
  .shipping-control .segmented { flex: 1; }
  .quote-controls > .field { width: calc(50% - 6px); }
  .quote-controls > .compact-discount { width: 100%; flex: 1 1 100%; }
  .quote-controls > .fixed-fee { flex: 1; }
  .profit-breakdown { grid-template-columns: repeat(2, 1fr); }
  .profit-breakdown .profit-total { grid-column: 1 / 3; }
  .quote-actions { flex-wrap: wrap; }
  .quote-actions .quote-language-switch { width: 100%; }
  .quote-actions .btn { flex: 1; }
  .page-toolbar { align-items: stretch; flex-wrap: wrap; }
  .product-view-bar { justify-content: stretch; }
  .product-view-switch { width: 100%; }
  .product-view-switch button { min-width: 0; }
  .page-search { flex-basis: 100%; }
  .filter-tabs { width: 100%; }
  .toolbar-actions { width: 100%; margin-left: 0; }
  .toolbar-actions .btn { flex: 1; }
  .quote-sheet-toolbar .toolbar-actions { width: auto; flex: 0 0 auto; }
  .quote-sheet-toolbar .toolbar-actions .btn { width: 100%; }
  .price-sheet-head { min-height: 78px; padding: 14px 12px; }
  .price-sheet-head h2 { font-size: 17px; }
  .customer-price-table .product-col { width: 31%; }
  .customer-price-table .spec-col { width: 29%; }
  .customer-price-table .usd-col { width: 17%; }
  .customer-price-table .brl-col { width: 23%; }
  .customer-price-table th { height: 34px; padding: 0 7px; font-size: 8px; }
  .price-column-head { gap: 2px; }
  .price-filter-button { width: 21px; height: 21px; }
  .customer-price-table td { padding: 7px; font-size: 10px; }
  .quote-usd, .quote-brl { font-size: 9px !important; }
  .metric-row { gap: 8px; }
  .metric { min-height: 82px; padding: 11px; }
  .metric-icon { width: 34px; height: 34px; }
  .metric strong { font-size: 16px; }
  .script-library { grid-template-columns: 1fr; }
  .copy-language-control { width: 100%; }
  .copy-language-control button { min-width: 0; }
  .coa-actions, .case-actions { grid-template-columns: 1fr; }
  .mobile-nav-item { min-width: 48px; flex-basis: 48px; }
  .knowledge-control-band { align-items: stretch; flex-direction: column; }
  .knowledge-category-tabs, .knowledge-language-control { width: 100%; }
  .knowledge-language-control button { min-width: 0; }
  .knowledge-grid { grid-template-columns: 1fr; }
  .knowledge-card-head { min-height: 0; }
  .knowledge-preview { min-height: 112px; }
  .knowledge-reference-grid { grid-template-columns: 1fr; }
  .knowledge-reference-grid section + section { border-top: 1px solid var(--line); border-left: 0; }
  .knowledge-detail-toolbar { align-items: stretch; flex-direction: column; }
  .knowledge-detail-toolbar .segmented { width: 100%; }
  .upload-order-row { grid-template-columns: minmax(0, 1fr) 128px; }
  .upload-order-row label { gap: 4px; }
  .calculator-builder .quote-items { padding: 0; }
  .calculator-actions { position: sticky; bottom: 64px; background: #fff; }
  .settings-grid, .form-grid { grid-template-columns: 1fr; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 8px 8px 0 0; }
  .modal-profit { grid-template-columns: repeat(2,1fr); }
  .toast-stack { top: 10px; left: 10px; right: 10px; }
  .toast { min-width: 0; max-width: none; }
  .login-layout { display: block; min-height: 100vh; background: #fff; }
  .login-brand { min-height: 230px; padding: 24px; }
  .login-visual { width: 78%; height: 200px; top: 22%; right: -18%; opacity: .48; }
  .visual-content { grid-template-columns: 52px 1fr; }
  .visual-main { padding: 18px; }
  .visual-grid span { height: 34px; }
  .visual-table i { height: 24px; }
  .login-brand-copy h1 { font-size: 25px; }
  .login-form-wrap { display: block; padding: 28px 22px; }
  .login-form { margin: auto; }
  .mobile-brand { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
