:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --text: #17202a;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --primary: #1f6f5f;
  --primary-soft: #e8f3f0;
  --primary-hover: #185a4e;
  --blue: #175cd3;
  --blue-soft: #eff8ff;
  --red: #b42318;
  --red-soft: #fef3f2;
  --shadow: 0 12px 36px rgba(16, 24, 40, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

button, a, input, select, textarea { font: inherit; }

.topbar {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  color: #fff;
  background: #15231f;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .02em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #17352e;
  background: #c9ebdf;
  font-weight: 900;
}

.topbar-divider { width: 1px; height: 22px; background: rgba(255,255,255,.22); }
.topbar-section { color: #cbd5d1; }
.topbar-nav { flex: 1 1 auto; min-width: 0; align-self: stretch; display: flex; align-items: stretch; gap: 3px; }
body:not([data-role]) .topbar-nav { visibility: hidden; }
body:not([data-role]) [data-roles] { visibility: hidden; }

.dispatch-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 760px; }
.dispatch-table th, .dispatch-table td { padding: 8px 13px; border-bottom: 1px solid #cfd6d3; text-align: left; vertical-align: middle; font-size: 11px; line-height: 1.25; }
.dispatch-table th { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .035em; }
.dispatch-table th:first-child, .dispatch-table td:first-child { width: var(--dispatch-product-width, 40%); }
.dispatch-table th:nth-child(n+2), .dispatch-table td:nth-child(n+2) { width: var(--dispatch-count-width, 12%); text-align: center; }
.dispatch-group-row td { padding: 10px 13px; color: var(--text); background: #f8fafc; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-top: 1px solid #bcc7c3; }
.dispatch-product-name { font-weight: 700; }
.dispatch-count { font-size: 14px; font-weight: 850; }
.dispatch-count.work, .dispatch-count-heading.work { background: rgba(250, 204, 21, .18); color: #854d0e; }
.dispatch-count.ready, .dispatch-count-heading.ready { background: rgba(34, 197, 94, .16); color: #166534; }
.dispatch-count.daily, .dispatch-count-heading.daily { background: rgba(59, 130, 246, .12); color: #1d4ed8; }
.dispatch-count.pickup, .dispatch-count-heading.pickup { background: rgba(168, 85, 247, .12); color: #6b21a8; }
.dispatch-count.courier, .dispatch-count-heading.courier { background: rgba(249, 115, 22, .12); color: #9a3412; }
.dispatch-table tfoot th, .dispatch-table tfoot td { border-top: 2px solid #9aa8a2; border-bottom: 0; font-weight: 850; }
.dispatch-table tfoot th { color: var(--text); text-align: center; }
.dispatch-table tfoot .dispatch-total-label { text-align: center; }
.dispatch-weight-total { font-size: 13px !important; }
.dispatch-weight-total.work { background: rgba(250, 204, 21, .18); color: #854d0e; }
.dispatch-weight-total.ready { background: rgba(34, 197, 94, .16); color: #166534; }
.dispatch-weight-total.daily { background: rgba(59, 130, 246, .12); color: #1d4ed8; }
.dispatch-weight-total.pickup { background: rgba(168, 85, 247, .12); color: #6b21a8; }
.dispatch-weight-total.courier { background: rgba(249, 115, 22, .12); color: #9a3412; }
.dispatch-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dispatch-print { text-decoration: none; white-space: nowrap; }
.dispatch-column-picker { position: relative; }
.dispatch-column-picker > summary { list-style: none; cursor: pointer; user-select: none; }
.dispatch-column-picker > summary::-webkit-details-marker { display: none; }
.dispatch-column-menu { position: absolute; z-index: 30; top: calc(100% + 7px); right: 0; display: grid; min-width: 220px; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(16,24,40,.16); }
.dispatch-column-menu label { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 12px; white-space: nowrap; cursor: pointer; }
.dispatch-column-menu input { width: 17px; height: 17px; accent-color: var(--green); }
.dispatch-column-menu .table-action { margin-top: 3px; }
.neo-mobile-picker { position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0; max-height: min(52dvh, 420px); padding: 0 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -12px 34px rgba(16,24,40,.2); }
.neo-mobile-picker[hidden] { display: none; }
.neo-mobile-picker-head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 14px; }
.neo-mobile-picker-head button { width: 42px; height: 42px; border: 0; background: transparent; color: var(--muted); font-size: 28px; cursor: pointer; }
.neo-mobile-picker-list { max-height: calc(min(52dvh, 420px) - 62px); overflow: auto; overscroll-behavior: contain; }
.neo-mobile-picker-option { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 50px; padding: 11px 4px; border: 0; border-bottom: 1px solid #edf1ef; background: #fff; color: var(--text); font: inherit; font-size: 15px; line-height: 1.25; text-align: left; cursor: pointer; }
.neo-mobile-picker-option:active { background: #eef8f4; }
.neo-mobile-picker-option small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.neo-mobile-picker-empty { padding: 20px 4px; color: var(--muted); font-size: 13px; }
.dispatch-view-switch { display: inline-flex; gap: 4px; margin: -8px 0 12px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #eef3f1; }
.dispatch-view-button { min-height: 34px; padding: 7px 14px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.dispatch-view-button.active { background: #fff; color: var(--green-dark); box-shadow: 0 1px 4px rgba(20, 55, 49, .12); }
.dispatch-report-card { margin-top: 18px; padding: 18px; }
.dispatch-report-card h2 { margin: 0 0 5px; font-size: 18px; }
.dispatch-report-form { display: flex; align-items: end; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.dispatch-report-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.dispatch-report-form input { min-width: 165px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font: inherit; }

.analytics-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.analytics-menu { display: grid; gap: 6px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; position: sticky; top: 76px; }
.analytics-menu button { border: 0; background: transparent; padding: 12px; border-radius: 8px; text-align: left; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.analytics-menu button.active { background: #eaf6f2; color: var(--accent); }
.analytics-panel { display: none; }.analytics-panel.active { display: block; }
.analytics-panel.table-card { padding: 18px; }
.analytics-content { min-width: 0; }
.analytics-content h2,.profitability-day h3 { margin: 0; }
.analytics-toolbar { padding: 18px; display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 14px; }
.analytics-date-controls { display: flex; gap: 8px; flex-wrap: wrap; }.analytics-date-controls input { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; }
.profitability-days { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.analytics-page .analytics-toolbar { flex-direction: column; align-items: stretch; }
.analytics-page .analytics-date-controls { align-items: end; }
.analytics-page .analytics-date-controls label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.analytics-page .analytics-date-controls select { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font: inherit; background: white; }
.analytics-period-fields { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.analytics-page .analytics-date-controls [hidden] { display: none; }
.profitability-day { overflow: hidden; }.profitability-day.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.profitability-day-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; padding: 16px; }.profitability-day-heading small { color: var(--muted); }.profitability-day-heading > strong { color: var(--accent); white-space: nowrap; }
.profitability-table-wrap { width: 100%; overflow: visible; }
.profitability-table { width: 100%; min-width: 0; table-layout: fixed; }
.profitability-table th,.profitability-table td { padding: 9px 8px; font-size: 11px; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.profitability-table th:first-child,.profitability-table td:first-child { width: 32%; }
.profitability-table th:nth-child(2),.profitability-table td:nth-child(2) { width: 11%; }
.profitability-table th:nth-child(3),.profitability-table td:nth-child(3) { width: 18%; }
.profitability-table th:nth-child(4),.profitability-table td:nth-child(4) { width: 23%; }
.profitability-table th:nth-child(5),.profitability-table td:nth-child(5) { width: 16%; }
.profitability-table td:nth-child(n+2) { text-align: right; }
.profitability-table .secondary { display: block; margin-top: 3px; font-size: 10px; line-height: 1.25; }
.profitability-movement strong { color: var(--primary); }
.profitability-incomplete { background: #fff9e8; }
.profitability-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 12px; }.profitability-totals span { display: flex; justify-content: space-between; gap: 8px; }
.analytics-warning { margin: 0; padding: 10px 16px; background: #fff4d6; color: #795600; font-size: 12px; }
@media (max-width: 900px) { .profitability-days { grid-template-columns: 1fr; }.analytics-menu { position: static; } }
@media (max-width: 720px) { .analytics-layout { grid-template-columns: 1fr; }.analytics-menu { grid-template-columns: 1fr 1fr; }.analytics-toolbar { align-items: stretch; flex-direction: column; }.analytics-date-controls input { flex: 1; }.profitability-days { grid-template-columns: minmax(0,1fr); } }
.password-settings { max-width: 820px; }
.password-fields { max-width: 760px; }
.package-dimensions { display: block; margin-top: 4px; white-space: nowrap; }
.topbar-link { position: relative; display: flex; align-items: center; padding: 0 13px; color: #b9c6c2; text-decoration: none; font-size: 13px; font-weight: 650; }
.topbar-link:hover { color: #fff; background: rgba(255,255,255,.045); }
.topbar-link.active { color: #fff; font-weight: 750; }
.topbar-link.active::after { content: ""; position: absolute; right: 13px; bottom: 0; left: 13px; height: 3px; border-radius: 3px 3px 0 0; background: #7dc9b6; }
.topbar-nav-secondary-start { margin-left: auto; }
body[data-role="admin"] .topbar-nav .topbar-link,
body[data-role="manager"] .topbar-nav .topbar-link { font-size: 12px; }
body[data-role="admin"] .topbar-nav .topbar-link.active,
body[data-role="manager"] .topbar-nav .topbar-link.active { font-size: 14px; }
.topbar-guide-link { align-self: stretch; margin-left: auto; white-space: nowrap; }
.topbar-guide-link + .user-menu { margin-left: 0; }

/* Profitability tables deliberately override the wider catalog defaults below. */
.analytics-page .profitability-table { width: 100%; min-width: 0; table-layout: fixed; }
.analytics-page .profitability-table th,.analytics-page .profitability-table td { width: auto; }
.analytics-page .profitability-table th:first-child,.analytics-page .profitability-table td:first-child { width: 32%; }
.analytics-page .profitability-table th:nth-child(2),.analytics-page .profitability-table td:nth-child(2) { width: 11%; }
.analytics-page .profitability-table th:nth-child(3),.analytics-page .profitability-table td:nth-child(3) { width: 18%; }
.analytics-page .profitability-table th:nth-child(4),.analytics-page .profitability-table td:nth-child(4) { width: 23%; }
.analytics-page .profitability-table th:nth-child(5),.analytics-page .profitability-table td:nth-child(5) { width: 16%; }

.balance-page { display: grid; gap: 18px; }
.balance-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.balance-negative, .amount-negative { color: #a52a2a !important; }
.amount-positive { color: #126c55; font-weight: 700; }
.balance-subform { margin-top: 22px; padding-top: 22px; border-top: 1px solid #dce4e1; }
.balance-table { min-width: 900px; }
.balance-table td { vertical-align: top; }
.inline-export { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-export input[type="date"] { width: auto; min-width: 145px; }
.topbar-context { margin-left: auto; font-size: 12px; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-identity { display: grid; gap: 1px; text-align: right; line-height: 1.2; }
.user-identity strong { color: #fff; font-size: 12px; }
.user-identity small { color: #9fb1ab; font-size: 10px; }
.logout-button { min-height: 32px; padding: 0 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; color: #e4ece9; background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.logout-button:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.06); }
.logout-button:disabled { opacity: .55; }

.page-shell { max-width: 1760px; margin: 0 auto; padding: 30px 32px 48px; }

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -.025em; }
.subtitle { margin: 7px 0 0; color: var(--muted); font-size: 14px; }

.heading-actions { display: flex; align-items: center; gap: 9px; }

.refresh-button,
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: #344054;
  background: var(--surface);
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
}

.refresh-button:hover { border-color: #98a2b3; background: #fcfcfd; }
.refresh-button:disabled { opacity: .55; cursor: wait; }

.order-number-stack { display: inline-flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 2px; }
.partner-order-number { font-size: 10px; white-space: nowrap; }
.catalog-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700; letter-spacing: .04em; }
.primary-button { border-color: var(--primary); color: #fff; background: var(--primary); }
.primary-button:hover { border-color: var(--primary-hover); background: var(--primary-hover); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { color: #344054; background: #fff; }
.secondary-button:hover { border-color: #98a2b3; background: #fcfcfd; }
.danger-button { border-color: #fda29b; color: var(--red); background: #fff; }
.danger-button:hover { border-color: var(--red); background: var(--red-soft); }
.danger-button:disabled { opacity: .55; cursor: wait; }

.filters-card,
.table-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
}

.filters-card { padding: 14px 18px; margin-bottom: 16px; }

.order-search-row { padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid #f0f1f3; }
.order-search-control {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(680px, 100%);
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  background: #fff;
}
.order-search-control:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.order-search-control input { flex: 1; min-width: 0; border: 0; outline: 0; color: #344054; background: transparent; }

.filter-row { display: flex; align-items: center; gap: 18px; min-height: 42px; }
.filter-row + .filter-row { border-top: 1px solid #f0f1f3; padding-top: 8px; margin-top: 8px; }
.filter-label { flex: 0 0 118px; color: #475467; font-size: 12px; font-weight: 750; }
.segmented { display: flex; flex-wrap: wrap; gap: 5px; }

.filter-button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: #475467;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}

.filter-button:hover { background: #f2f4f7; }
.filter-button.active { color: var(--primary); background: var(--primary-soft); }

.table-card { overflow: hidden; }
.table-toolbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 18px; border-bottom: 1px solid var(--line); }
.table-toolbar strong { font-size: 14px; }
.table-toolbar span { margin-left: 8px; color: var(--muted); font-size: 12px; }
.table-summary { display: flex; align-items: center; gap: 20px; }
.page-size-control { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.page-size-control select { min-height: 32px; padding: 4px 26px 4px 9px; border: 1px solid var(--line-strong); border-radius: 7px; color: #344054; background: #fff; font: inherit; cursor: pointer; }
.mobile-select-all { display: none; align-items: center; gap: 7px; color: #475467; font-size: 12px; font-weight: 700; white-space: nowrap; }
.mobile-select-all input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.bulk-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.bulk-toolbar[hidden] { display: none; }
.bulk-toolbar strong { color: var(--primary); white-space: nowrap; }
.bulk-toolbar select { min-height: 36px; padding: 6px 30px 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: #344054; background: #fff; }
.compact-button { min-height: 36px; padding: 0 12px; }
.table-scroll { overflow-x: auto; }

table { width: 100%; min-width: 1620px; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 13px 12px; border-bottom: 1px solid #edf0f2; text-align: left; vertical-align: top; }
th { color: #667085; background: var(--surface-subtle); font-size: 11px; font-weight: 750; letter-spacing: .025em; text-transform: uppercase; }
td { color: #344054; line-height: 1.35; }
tbody tr { cursor: default; transition: background .12s ease; }
tbody tr:hover { background: #f8fbfa; }
tbody tr:last-child td { border-bottom: 0; }

.order-row.row-status-new td { background: rgba(102, 112, 133, .065); }
.order-row.row-status-clarifying td { background: rgba(105, 65, 198, .065); }
.order-row.row-status-accepted td { background: transparent; }
.order-row.row-status-awaiting_payment td { background: rgba(250, 204, 21, .08); }
.order-row.row-status-waiting_payment td { background: rgba(247, 144, 9, .085); }
.order-row.row-status-ready_to_ship td { background: rgba(18, 183, 106, .075); }
.order-row.row-status-shipped td { background: rgba(23, 92, 211, .07); }
.order-row.row-status-received td { background: rgba(8, 127, 91, .08); }
.order-row.row-status-cancelled td { background: rgba(217, 45, 32, .07); }
.order-row:hover td { box-shadow: inset 0 0 0 999px rgba(255,255,255,.18); }
.order-row.selected td { box-shadow: inset 0 1px 0 rgba(31,111,95,.25), inset 0 -1px 0 rgba(31,111,95,.25); }
.order-row.selected td:first-child { box-shadow: inset 4px 0 0 var(--primary), inset 0 1px 0 rgba(31,111,95,.25), inset 0 -1px 0 rgba(31,111,95,.25); }

th:nth-child(1) { width: 42px; }
th:nth-child(2) { width: 145px; }
th:nth-child(3) { width: 124px; }
th:nth-child(4) { width: 110px; }
th:nth-child(5) { width: 120px; }
th:nth-child(6) { width: 205px; }
th:nth-child(7) { width: 145px; }
th:nth-child(8) { width: 125px; }
th:nth-child(9) { width: 175px; }
th:nth-child(10) { width: 98px; }
th:nth-child(11) { width: 110px; }
th:nth-child(12) { width: 220px; }
.select-column { padding-left: 15px; padding-right: 7px; text-align: center; }
.select-column input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.order-row-actions { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; }

.order-number-button,
.ttn-copy,
.sort-button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
}
.order-number-button { max-width: 100%; color: var(--primary); cursor: pointer; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; text-decoration: underline; text-decoration-color: rgba(31,111,95,.35); text-underline-offset: 3px; }
.order-number-with-source { display: inline-flex; width: 100%; min-width: 0; align-items: center; gap: 7px; white-space: nowrap; }
tbody td:nth-child(2) { overflow: hidden; }
.source-indicator { display: inline-block; width: 11px; height: 11px; flex: 0 0 11px; border: 2px solid #23846f; border-radius: 50%; box-sizing: border-box; }
.source-indicator.crm { background: #23846f; }
.source-indicator.dropshipper-crm { border-color: #2563eb; background: #2563eb; }
.source-indicator.email { background: #fff; }
.source-indicator.other { border-color: #94a3b8; background: #fff; }
.source-indicator.manual-processing { border-color: #dc2626; background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.counterparty-source { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.counterparty-source > img, .counterparty-source > .source-logo { order: 2; }
.orders-page th:nth-child(2) { width: 126px; }
.orders-page th:nth-child(4) { width: 88px; }
.orders-page td { overflow-wrap: anywhere; }
.orders-page .order-number-button { font-size: 12px; }
.neo-mobile-picker { box-sizing: border-box; min-width: 0; overflow: hidden; }
.neo-mobile-picker-option { box-sizing: border-box; min-width: 0; white-space: normal; overflow-wrap: anywhere; flex-shrink: 0; }
.neo-mobile-picker-head { gap: 10px; }
.neo-mobile-picker-head button { flex: 0 0 42px; }
@media (pointer: coarse) { input, select, textarea { font-size: 16px; } }
.counterparty-source > img, .source-logo { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 5px; object-fit: cover; }
.source-logo { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 900; line-height: 1; }
.source-logo-site { background: #64748b; font-size: 13px; }
.payment-paid { color: #16754a; }
.payment-waiting, .payment-partial, .payment-review { color: #9a6200; }
.payment-failed, .payment-refunded, .payment-partially_refunded { color: #b42318; }
.order-number-button:hover { color: var(--primary-hover); text-decoration-color: currentColor; }
.order-number-button:focus-visible, .ttn-copy:focus-visible, .sort-button:focus-visible { outline: 2px solid #67aa9b; outline-offset: 3px; border-radius: 3px; }
.sort-button { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; text-align: left; text-transform: uppercase; }
.sort-button span { min-width: 9px; color: var(--primary); font-size: 13px; }
.sort-button.active { color: #344054; }
.ttn-copy { display: grid; min-width: 145px; gap: 3px; cursor: copy; text-align: left; }
.ttn-copy strong { display: block; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 3px; }
.ttn-copy strong .registry-lock { display: inline; margin-right: 3px; font-size: 10px; text-decoration: none; }
.inline-settings-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.inline-settings-form .form-field { min-width: min(360px, 100%); flex: 1 1 280px; }
.ttn-copy span { font-size: 11px; font-weight: 650; line-height: 1.25; }
.ttn-copy .delivery-cost { color: #344054; font-weight: 750; }
.ttn-copy .prom-declaration-status { font-size: 10px; font-weight: 750; }
.ttn-copy .prom-declaration-synced { color: #08735f; }
.ttn-copy .prom-declaration-pending { color: #8a5b00; }
.ttn-copy .prom-declaration-error { color: #b42318; }
.manual-fulfillment-marker { display: inline-block; max-width: 130px; color: #344054; font-size: 11px; line-height: 1.25; }
.email-templates { display: grid; gap: 18px; margin-top: 24px; }
.email-template-card { border-top: 1px solid var(--line); padding-top: 20px; }
.email-template-card h3 { margin: 0; }
.template-preview { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.template-preview-subject { margin-top: 8px; font-weight: 800; }
.template-preview-body { margin: 10px 0 0; white-space: pre-wrap; font: inherit; color: #344054; }
.tracking-draft { color: #667085; }
.tracking-created { color: #175cd3; }
.tracking-in_transit { color: #b54708; }
.tracking-awaiting_pickup { color: #c05d00; }
.tracking-delivered { color: #067647; }
.tracking-returning, .tracking-returned, .tracking-problem { color: #b42318; }
.secondary { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.products-list { display: grid; gap: 5px; }
.product-line { color: #1d2939; font-weight: 600; }
.product-meta { color: var(--muted); font-size: 11px; font-weight: 500; }
.money { white-space: nowrap; color: #1d2939; font-weight: 750; font-variant-numeric: tabular-nums; }
.phone { color: #344054; text-decoration: none; white-space: nowrap; }
.phone:hover { color: var(--primary); text-decoration: underline; }
body.orders-page[data-role="dropshipper"] .orders-dropshipper-column { display: none; }
.dropshipper-order-list .orders-dropshipper-column { display: none; }
.filter-selects-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.compact-filter { min-width: 190px; margin: 0; }
.compact-filter select { min-height: 42px; }
.order-ledger-link { color: var(--primary); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.finance-dropshipper .partner-column { display: none; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.sent { color: var(--blue); background: var(--blue-soft); }
.status-badge.cancelled { color: var(--red); background: var(--red-soft); }
.status-badge.awaiting { color: #854d0e; background: #fffbea; }
.status-badge.waiting { color: #b54708; background: #fffaeb; }
.status-badge.ready { color: #175cd3; background: #eff8ff; }
.status-badge.clarifying { color: #6941c6; background: #f4f3ff; }
.status-badge.unknown { color: #475467; background: #f2f4f7; }
.table-status-select { width: 100%; min-height: 34px; padding: 5px 23px 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; color: #344054; background: #fff; cursor: pointer; font-size: 11.5px; font-weight: 650; }
.table-status-select:focus { border-color: #67aa9b; outline: 0; box-shadow: 0 0 0 3px rgba(31, 111, 95, .1); }
.table-status-select.status-cancelled { color: var(--red); background: var(--red-soft); }
.table-status-select.status-shipped { color: var(--blue); background: var(--blue-soft); }
.table-status-select.status-received { color: #087f5b; background: #ecfdf3; }
.table-status-select.status-awaiting_payment { color: #854d0e; background: #fffbea; }
.table-status-select.status-waiting_payment { color: #b54708; background: #fffaeb; }
.table-status-select.status-clarifying { color: #6941c6; background: #f4f3ff; }

.state-message { padding: 70px 24px; color: var(--muted); text-align: center; }
.state-message.error { color: var(--red); }
.loading-row td { height: 56px; color: var(--muted); text-align: center; }
.pagination { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pagination[hidden] { display: none; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }
.page-number-links { display: flex; align-items: center; gap: 5px; }
.page-number { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; font-weight: 700; }
.page-number.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-ellipsis { padding: 0 3px; }
.page-jump { display: flex; align-items: center; gap: 6px; }
.page-jump input { width: 70px; min-height: 34px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; }
.prom-mapping-list { display: grid; gap: 8px; }
.prom-mapping-head { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(170px, .8fr) minmax(150px, .7fr); gap: 10px; padding-bottom: 7px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.prom-mapping-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(170px, .8fr) minmax(150px, .7fr); gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.prom-mapping-row select { min-height: 38px; }
.table-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.manual-processing-control { margin-top: 10px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(16, 24, 40, .28); }
.drawer {
  position: fixed;
  z-index: 21;
  top: 0;
  right: 0;
  width: min(560px, 92vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: -16px 0 48px rgba(16, 24, 40, .16);
  transform: translateX(105%);
  transition: transform .22s ease;
}

.drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 25px 26px 20px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 0; font-size: 23px; letter-spacing: -.02em; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; color: #475467; background: #fff; cursor: pointer; font-size: 25px; line-height: 1; }
.icon-button:hover { background: #f9fafb; }
.action-icon { display: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
body.edit-mode .edit-icon-action { width: 42px; min-width: 42px; min-height: 42px; justify-content: center; padding: 0; }
body.edit-mode .edit-icon-action .action-icon { display: block; }
body.edit-mode .edit-icon-action .action-label { display: none; }
body.edit-mode .edit-icon-action:disabled { opacity: .55; }
.drawer-content { overflow-y: auto; padding: 22px 26px 34px; }
.detail-section + .detail-section { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 13px; color: #344054; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 24px; }
.detail-field.full { grid-column: 1 / -1; }
.detail-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.detail-value { color: #1d2939; overflow-wrap: anywhere; }
.item-card { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-subtle); }
.item-card + .item-card { margin-top: 9px; }
.item-name { font-weight: 750; }
.item-details { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 7px; color: var(--muted); font-size: 12px; }
.raw-fields { display: grid; gap: 8px; }
.raw-field { display: grid; grid-template-columns: 165px 1fr; gap: 12px; font-size: 12px; }
.raw-field dt { color: var(--muted); }
.raw-field dd { margin: 0; color: #344054; overflow-wrap: anywhere; }

.toast {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  max-width: 420px;
  padding: 13px 16px;
  border: 1px solid #a6d8ca;
  border-radius: 10px;
  color: #135c4e;
  background: #eefaf6;
  box-shadow: var(--shadow);
  font-weight: 650;
}

.form-page { max-width: 1120px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; color: var(--muted); text-decoration: none; font-weight: 650; }
.back-link:hover { color: var(--primary); }
.order-form { display: grid; gap: 16px; }
.order-form[aria-busy="true"] { opacity: .62; pointer-events: none; }
.edit-status-card { border-color: #b9d8d0; background: linear-gradient(180deg, #fbfefd 0%, #fff 100%); }
.form-card { padding: 22px 24px 24px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.form-card-header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.form-card h2 { margin: 0; font-size: 17px; }
.form-card-description { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.credit-status-card { border-color: #b9d8d0; background: linear-gradient(180deg, #fbfefd 0%, #fff 100%); }
.credit-status-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.credit-status-value { margin: 7px 0 0; font-size: 14px; font-weight: 750; }
.credit-status-value.success { color: #087f5b; }
.credit-status-value.attention { color: #b54708; }
.credit-status-value.waiting { color: #175cd3; }
.credit-status-value.danger { color: #b42318; }

@media (max-width: 760px) {
  .credit-status-header { align-items: stretch; flex-direction: column; }
  .credit-status-header .primary-button { width: 100%; }
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-field { display: grid; align-content: start; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label, .field-label { color: #344054; font-size: 12px; font-weight: 750; }
.required::after { content: " *"; color: var(--red); }
.form-field input, .form-field select, .form-field textarea, .search-row input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #1d2939;
  background: #fff;
  outline: 0;
}
.form-field textarea { min-height: 92px; resize: vertical; }
#prepaymentSection > label { display: flex; align-items: center; gap: 8px; }
#includePrepayment { width: 17px; min-height: 17px; height: 17px; margin: 0; flex: 0 0 17px; }
#prepaymentFields { min-width: 0; margin: 8px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.order-finance-cost-form > label { display: grid; gap: 6px; min-width: 0; }
.order-finance-cost-form input, .order-finance-cost-form select { width: 100%; min-width: 0; min-height: 42px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 8px; }
.form-field textarea.manager-comment-textarea { min-height: 138px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .search-row input:focus { border-color: #67aa9b; box-shadow: 0 0 0 3px rgba(31, 111, 95, .1); }
.field-help { color: var(--muted); font-size: 11px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 9px; }
.choice-card { position: relative; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 8px; color: #475467; cursor: pointer; font-weight: 650; }
.choice-card input:checked + span { border-color: #67aa9b; color: var(--primary); background: var(--primary-soft); }
.notice { margin-top: 11px; padding: 10px 12px; border: 1px solid #fedf89; border-radius: 8px; color: #7a2e0e; background: #fffaeb; font-size: 12px; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.items-empty { padding: 22px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); text-align: center; }
.form-items { display: grid; gap: 9px; margin-top: 13px; }
.form-item { display: grid; grid-template-columns: minmax(250px, 1fr) 105px 145px 38px; align-items: end; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-subtle); }
.form-item-name { align-self: center; min-width: 0; }
.form-item-name strong { display: block; color: #1d2939; }
.form-item-name span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.form-item .form-field input { min-height: 38px; }
.remove-item { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; color: var(--red); background: #fff; cursor: pointer; font-size: 19px; }
.remove-item:hover { border-color: #fda29b; background: var(--red-soft); }
.items-summary { display: flex; justify-content: flex-end; margin-top: 13px; color: #344054; }
.items-summary strong { margin-left: 7px; }
.conditional-fields[hidden] { display: none; }
.form-error { padding: 12px 14px; border: 1px solid #fecdca; border-radius: 9px; color: var(--red); background: var(--red-soft); }
.submit-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: 0 -8px 24px rgba(16,24,40,.06); backdrop-filter: blur(8px); }
.submit-note { color: var(--muted); font-size: 12px; }
.submit-actions { display: flex; gap: 9px; }
.paste-card { border-color: #b9d8d0; background: linear-gradient(180deg, #fbfefd 0%, #fff 100%); }
.paste-textarea { min-height: 190px !important; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.5; }
.paste-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 13px; }
.parse-result { margin-top: 14px; padding: 13px 14px; border: 1px solid #a6d8ca; border-radius: 9px; color: #135c4e; background: #eefaf6; }
.parse-result.warning { border-color: #fedf89; color: #7a2e0e; background: #fffaeb; }
.parse-result strong { display: block; margin-bottom: 4px; }
.parse-result ul { margin: 7px 0 0; padding-left: 18px; }
.import-heading { align-items: center; }
.safety-banner { display: grid; gap: 4px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid #b9d8d0; border-radius: 12px; color: #135c4e; background: #eefaf6; }
.safety-banner span { color: #397166; font-size: 12px; line-height: 1.5; }
.import-summary-card { padding-top: 16px; padding-bottom: 16px; margin-bottom: 16px; }
.import-summary { display: grid; gap: 4px; }
.import-summary span { color: var(--muted); font-size: 12px; }
.selection-counter { align-self: start; padding: 6px 10px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 750; white-space: nowrap; }
.candidate-list { display: grid; gap: 10px; }
.candidate-card { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-subtle); cursor: pointer; }
.candidate-card:hover { border-color: #98bdb4; background: #fbfefd; }
.candidate-card > input { position: absolute; opacity: 0; pointer-events: none; }
.candidate-card > input:disabled ~ * { opacity: .55; }
.candidate-check { width: 20px; height: 20px; margin-top: 1px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.candidate-card > input:checked + .candidate-check { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 4px #fff; }
.candidate-content { display: grid; gap: 7px; min-width: 0; }
.candidate-topline { display: flex; justify-content: space-between; gap: 16px; }
.candidate-topline > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.candidate-subject { color: var(--muted); font-size: 12px; }
.candidate-grid { display: grid; grid-template-columns: 1fr 1.4fr 1.2fr 1.3fr; gap: 12px; color: #344054; line-height: 1.4; }
.candidate-grid > span { min-width: 0; overflow-wrap: anywhere; }
.candidate-grid small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.parse-result a { color: inherit; font-weight: 750; }

.catalog-page { max-width: 1540px; }
.catalog-toolbar { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.catalog-toolbar input[type="search"], .catalog-toolbar select { min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: #1d2939; background: #fff; outline: 0; }
.catalog-toolbar input[type="search"]:focus, .catalog-toolbar select:focus { border-color: #67aa9b; box-shadow: 0 0 0 3px rgba(31,111,95,.1); }
.search-control { flex: 1 1 380px; }
.search-control input { width: 100%; }
.switch-control { display: inline-flex; align-items: center; gap: 8px; color: #475467; font-size: 12px; font-weight: 650; white-space: nowrap; }
.switch-control input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.catalog-count { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.catalog-table-card { min-height: 220px; }
.catalog-table { min-width: 1100px; table-layout: auto; }
.catalog-table th, .catalog-table td { width: auto; }
.catalog-table th:first-child { width: 110px; }
.catalog-table th:last-child { width: 112px; }
.catalog-table tbody tr { cursor: pointer; }
.catalog-table tbody tr:hover { background: #f8fbfa; }
.catalog-row-inactive { opacity: .58; }
.catalog-name { min-width: 180px; color: #1d2939; font-weight: 700; }
.catalog-sku { color: #344054; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; font-weight: 700; }
.catalog-status { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.catalog-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.catalog-status.active { color: #067647; background: #ecfdf3; }
.catalog-status.inactive { color: #667085; background: #f2f4f7; }
.availability-pill { display: inline-flex; min-height: 24px; align-items: center; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.availability-pill.available { color: #067647; background: #ecfdf3; }
.availability-pill.limited { color: #b54708; background: #fffaeb; }
.availability-pill.unavailable { color: #b42318; background: #fef3f2; }
.table-action { padding: 5px 7px; border: 0; border-radius: 6px; color: var(--primary); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.table-action:hover { background: var(--primary-soft); }
.table-action:disabled { opacity: .5; cursor: wait; }
.clamp-line { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 14px; background: transparent; box-shadow: var(--shadow); }
.catalog-dialog::backdrop { background: rgba(16,24,40,.38); backdrop-filter: blur(2px); }
.dialog-card { max-height: calc(100vh - 32px); display: flex; flex-direction: column; border-radius: 14px; background: #fff; overflow: hidden; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 22px; }
.dialog-body { overflow-y: auto; padding: 22px 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-subtle); }
.check-stack { gap: 11px; padding-top: 5px; }
.toast.error { border-color: #fda29b; color: var(--red); background: var(--red-soft); }
.settings-page { max-width: 1440px; }
.settings-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: start; gap: 20px; }
.settings-sidebar { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; padding: 16px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .025); }
.settings-sidebar-title { margin: 0 8px 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.settings-section-nav { display: grid; gap: 3px; }
.settings-section-nav button { width: 100%; min-height: 40px; padding: 9px 11px; border: 0; border-radius: 8px; color: #475467; background: transparent; cursor: pointer; font-size: 12px; font-weight: 680; text-align: left; }
.settings-section-nav button:hover { color: var(--primary); background: #f4f8f7; }
.settings-section-nav button.active { color: #145d50; background: var(--primary-soft); font-weight: 800; }
.settings-section-nav button.active::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 9px 2px 0; border-radius: 50%; background: currentColor; }
.settings-content { min-width: 0; }
.settings-content > .settings-section { display: none; margin: 0; }
.settings-content > .settings-section.active { display: block; }
.settings-content > .settings-grid.settings-section.active { display: grid; }
.settings-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-height: 130px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric-card strong { font-size: 25px; letter-spacing: -.025em; }
.metric-good { color: #067647; }
.metric-bad { color: var(--red); }
.settings-note p { max-width: 740px; margin: 9px 0 0; color: var(--muted); line-height: 1.6; }
.nova-post-settings { margin-bottom: 18px; }
.settings-card-heading { align-items: center; }
.settings-card-heading .eyebrow { margin-bottom: 3px; }
.contract-settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.contract-settings-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.contract-settings-actions .primary-button { min-height: 42px; }
.contract-meta { margin-top: 14px; padding: 11px 13px; border-radius: 8px; color: #135c4e; background: #eefaf6; font-size: 12px; }
.contract-meta.warning { color: #7a2e0e; background: #fffaeb; }
.nova-post-settings .form-error { margin-top: 14px; }
.users-section, .audit-section { margin-top: 18px; padding: 0; overflow: hidden; }
.users-section .form-card-header, .audit-section .form-card-header { align-items: center; margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.users-table, .audit-table { min-width: 980px; table-layout: auto; }
.users-table th, .users-table td, .audit-table th, .audit-table td { width: auto; }
.users-table th:first-child { width: 230px; }
.users-table tbody tr, .audit-table tbody tr { cursor: default; }
.role-badge { display: inline-flex; min-height: 25px; align-items: center; padding: 0 9px; border-radius: 999px; color: #344054; background: #f2f4f7; font-size: 11px; font-weight: 750; }
.role-badge.role-admin { color: #6941c6; background: #f4f3ff; }
.role-badge.role-manager { color: var(--primary); background: var(--primary-soft); }
.role-badge.role-warehouse { color: var(--blue); background: var(--blue-soft); }
.role-badge.role-dropshipper { color: #b54708; background: #fffaeb; }

.login-page { min-height: 100vh; background: radial-gradient(circle at 50% 0%, #ecf7f3 0, var(--bg) 44%); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.login-brand { display: inline-flex; align-items: center; gap: 10px; color: #17352e; text-decoration: none; font-weight: 800; }
.login-heading { margin: 32px 0 24px; }
.login-heading h1 { font-size: 28px; }
.login-form { display: grid; gap: 16px; }
.login-button { width: 100%; margin-top: 4px; }
.login-help { margin: 20px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }
.invite-heading { margin: 0 0 8px; }
.setup-link-card { width: min(680px, calc(100vw - 32px)); }
.setup-link-value { min-height: 108px; resize: vertical; overflow-wrap: anywhere; }
.user-actions { display: flex; gap: 6px; justify-content: flex-end; }
.package-editor { padding-top: 4px; }
.package-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.package-editor-heading > div { display: grid; gap: 4px; }
.compact-button { min-height: 34px; padding: 0 11px; }
.package-rows { display: grid; gap: 8px; }
.package-row { display: grid; grid-template-columns: 72px repeat(4, minmax(100px, 1fr)) 38px; align-items: end; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-subtle); }
.package-row > strong { align-self: center; color: #344054; font-size: 12px; }
.package-row label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.package-row input { min-height: 36px; padding: 7px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }
.component-editor { padding-top: 4px; }
.component-rows { display: grid; gap: 8px; }
.component-row { display: grid; grid-template-columns: 48px minmax(260px, 1fr) 140px 38px; align-items: end; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #f7faf9; }
.component-row > strong { align-self: center; color: #344054; font-size: 12px; }
.component-row label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.component-row input, .component-row select { min-height: 36px; padding: 7px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }
.product-recipe-summary { display: block; margin-top: 5px; color: #176b5c; }
.manual-shipping { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.manual-shipping-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.manual-shipping-heading > div { display: grid; gap: 4px; }
.manual-shipping-heading strong { color: #344054; font-size: 13px; }
.manual-shipping-heading > div > span { color: var(--muted); font-size: 11px; }
.manual-shipping-editor { margin-top: 13px; }
.manual-shipping-notice { margin: 0 0 10px; }
.manual-shipping-rows { display: grid; gap: 8px; }
.manual-shipping-row { display: grid; grid-template-columns: 78px repeat(4, minmax(105px, 1fr)) 38px; align-items: end; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-subtle); }
.manual-shipping-row > strong { align-self: center; color: #344054; font-size: 12px; }
.manual-shipping-row label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.manual-shipping-row input { width: 100%; min-height: 36px; padding: 7px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; }
.manual-shipping-row input:focus { border-color: #67aa9b; box-shadow: 0 0 0 3px rgba(31, 111, 95, .1); outline: 0; }
.manual-shipping-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; }
.delivery-validation { margin-top: 14px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; color: #475467; background: var(--surface-subtle); font-size: 12px; line-height: 1.45; }
.delivery-validation.valid { border-color: #a6d8ca; color: #135c4e; background: #eefaf6; }
.delivery-validation.invalid { border-color: #fda29b; color: var(--red); background: var(--red-soft); }
.delivery-validation.checking { border-color: #b2ccff; color: #175cd3; background: #eff8ff; }

@media (max-width: 900px) {
  .page-shell { padding: 24px 16px 36px; }
  .topbar { padding: 0 16px; }
  .brand > span:last-child, .topbar-context { display: none; }
  .user-identity { display: none; }
  .user-menu { gap: 5px; }
  .topbar-nav { gap: 0; overflow-x: auto; }
  .topbar-nav-secondary-start { margin-left: 0; }
  .topbar-link { padding: 0 9px; font-size: 12px; white-space: nowrap; }
  .topbar-link.active::after { right: 9px; left: 9px; }
  .filter-row { align-items: flex-start; flex-direction: column; gap: 7px; padding: 6px 0; }
  .filter-label { flex-basis: auto; }
  .page-heading { align-items: flex-start; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .form-item { grid-template-columns: 1fr 90px 125px 38px; }
  .candidate-grid { grid-template-columns: 1fr 1fr; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .bulk-toolbar { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .search-control { flex-basis: auto; }
  .catalog-toolbar select { width: 100%; }
  .catalog-count { margin-left: 0; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .settings-layout { grid-template-columns: 1fr; gap: 12px; }
  .settings-sidebar { position: static; max-height: none; overflow: hidden; padding: 8px; }
  .settings-sidebar-title { display: none; }
  .settings-section-nav { display: flex; gap: 5px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .settings-section-nav button { flex: 0 0 auto; width: auto; min-height: 38px; padding: 8px 12px; white-space: nowrap; }
  .contract-settings-fields { grid-template-columns: 1fr; }
  .package-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .package-row > strong { grid-column: 1 / -1; }
  .component-row { grid-template-columns: 1fr 110px 38px; }
  .component-row > strong { grid-column: 1 / -1; }
  .manual-shipping-heading { align-items: flex-start; flex-direction: column; }
  .manual-shipping-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .manual-shipping-row > strong { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .balance-metrics { grid-template-columns: 1fr 1fr; }
  .inline-export { width: 100%; }
  .orders-page .topbar {
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
    gap: 0 8px;
    padding: 8px 10px 0;
  }
  .orders-page .brand { flex: 0 0 auto; }
  .orders-page .topbar-nav {
    order: 3;
    width: calc(100% + 20px);
    height: 43px;
    margin: 8px -10px 0;
    padding: 0 4px;
    border-top: 1px solid rgba(255,255,255,.1);
    scrollbar-width: none;
  }
  .orders-page .topbar-nav::-webkit-scrollbar { display: none; }
  .orders-page .topbar-link { min-height: 42px; padding: 0 10px; }
  .orders-page .page-shell { padding: 16px 10px 32px; }
  .orders-page .page-heading { gap: 14px; margin-bottom: 14px; }
  .orders-page .page-heading h1 { font-size: 24px; }
  .orders-page .page-heading .eyebrow,
  .orders-page .page-heading .subtitle { display: none !important; }
  .orders-page .heading-actions { width: 100%; }
  .orders-page .heading-actions > * { flex: 1 1 0; min-height: 43px; padding: 0 10px; }
  .orders-page .filters-card { padding: 11px; margin-bottom: 12px; border-radius: 10px; }
  .orders-page .order-search-row { padding-bottom: 10px; margin-bottom: 4px; }
  .orders-page .order-search-control { min-height: 44px; }
  .orders-page .order-search-control input { font-size: 16px; }
  .orders-page .filter-row { gap: 5px; padding: 6px 0; }
  .orders-page .filter-label { font-size: 11px; }
  .orders-page .segmented {
    width: 100%;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
  }
  .orders-page .segmented::-webkit-scrollbar { display: none; }
  .orders-page .filter-button { flex: 0 0 auto; min-height: 36px; padding: 0 11px; background: #f7f8f9; }
  .orders-page .table-card { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .orders-page .table-toolbar {
    min-height: 0;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }
  .orders-page .table-summary { width: 100%; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
  .orders-page .table-summary > div { display: grid; gap: 2px; }
  .orders-page .table-toolbar span { margin-left: 0; }
  .orders-page .mobile-select-all { display: inline-flex; }
  .orders-page .bulk-toolbar { padding-top: 9px; border-top: 1px solid var(--line); }
  .orders-page .bulk-toolbar select { flex: 1 1 145px; min-height: 42px; }
  .orders-page .bulk-toolbar button { min-height: 42px; }
  .orders-page .table-scroll { overflow: visible; }
  .orders-page .table-card table { display: block; width: 100%; min-width: 0; }
  .orders-page .table-card thead { display: none; }
  .orders-page #ordersBody { display: grid; gap: 10px; padding: 10px 0 0; }
  .orders-page #ordersBody .order-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(122px, 142px);
    grid-template-areas:
      "number status"
      "received received"
      "dropshipper dropshipper"
      "products products"
      "recipient phone"
      "delivery delivery"
      "amount payment"
      "tracking tracking";
    gap: 11px 13px;
    padding: 14px;
    border: 1px solid var(--line);
    border-left: 4px solid #a8b0ba;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16,24,40,.035);
  }
  .orders-page #ordersBody .order-row.row-status-clarifying { border-left-color: #7f56d9; background: #faf9ff; }
  .orders-page #ordersBody .order-row.row-status-accepted { border-left-color: #98a2b3; }
  .orders-page #ordersBody .order-row.row-status-awaiting_payment { border-left-color: #eaaa08; background: #fffdf2; }
  .orders-page #ordersBody .order-row.row-status-waiting_payment { border-left-color: #f79009; background: #fffbf5; }
  .orders-page #ordersBody .order-row.row-status-ready_to_ship { border-left-color: #12b76a; background: #f6fef9; }
  .orders-page #ordersBody .order-row.row-status-shipped { border-left-color: #2e70d1; background: #f5f8ff; }
  .orders-page #ordersBody .order-row.row-status-received { border-left-color: #087f5b; background: #f0fdf7; }
  .orders-page #ordersBody .order-row.row-status-cancelled { border-left-color: #d92d20; background: #fff8f7; }
  .orders-page #ordersBody .order-row.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(31,111,95,.13); }
  .orders-page #ordersBody .order-row > td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible;
  }
  .orders-page #ordersBody .order-row > td::before {
    display: block;
    margin-bottom: 3px;
    color: #7a8493;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
  }
  .orders-page #ordersBody .order-row > td:nth-child(1) { position: absolute; top: 17px; left: 12px; z-index: 1; }
  .orders-page #ordersBody .order-row > td:nth-child(2) { grid-area: number; padding-left: 26px; overflow: hidden; align-self: center; }
  .orders-page #ordersBody .order-row > .select-column:empty + td { padding-left: 0; }
  .orders-page #ordersBody .order-row > td:nth-child(3) { grid-area: status; align-self: start; }
  .orders-page #ordersBody .order-row > td:nth-child(4) { grid-area: received; }
  .orders-page #ordersBody .order-row > td:nth-child(4)::before { content: "Отримано"; }
  .orders-page #ordersBody .order-row > td:nth-child(5) { grid-area: dropshipper; }
  .orders-page #ordersBody .order-row > td:nth-child(5)::before { content: "Дропшипер"; }
  .orders-page #ordersBody .order-row > td:nth-child(6) { grid-area: products; padding: 10px 0; border-top: 1px solid rgba(208,213,221,.7); border-bottom: 1px solid rgba(208,213,221,.7); }
  .orders-page #ordersBody .order-row > td:nth-child(6)::before { content: "Товари"; }
  .orders-page #ordersBody .order-row > td:nth-child(7) { grid-area: recipient; }
  .orders-page #ordersBody .order-row > td:nth-child(7)::before { content: "Отримувач"; }
  .orders-page #ordersBody .order-row > td:nth-child(8) { grid-area: phone; }
  .orders-page #ordersBody .order-row > td:nth-child(8)::before { content: "Телефон"; }
  .orders-page #ordersBody .order-row > td:nth-child(9) { grid-area: delivery; }
  .orders-page #ordersBody .order-row > td:nth-child(9)::before { content: "Доставка"; }
  .orders-page #ordersBody .order-row > td:nth-child(10) { grid-area: amount; }
  .orders-page #ordersBody .order-row > td:nth-child(10)::before { content: "Сума"; }
  .orders-page #ordersBody .order-row > td:nth-child(11) { grid-area: payment; }
  .orders-page #ordersBody .order-row > td:nth-child(11)::before { content: "Оплата"; }
  .orders-page #ordersBody .order-row > td:nth-child(12) { grid-area: tracking; padding-top: 10px; border-top: 1px solid rgba(208,213,221,.7); }
  .orders-page #ordersBody .order-row > td:nth-child(12)::before { content: "ТТН"; }
  .orders-page #ordersBody .order-number-with-source { width: auto; max-width: 100%; }
  .orders-page #ordersBody .order-number-button { font-size: 14px; }
  .orders-page #ordersBody .table-status-select { min-height: 40px; }
  .orders-page #ordersBody .secondary { margin-top: 2px; }
  .orders-page #ordersBody .phone { display: inline-block; padding: 4px 0; }
  .orders-page #ordersBody .ttn-copy { width: 100%; }
  body.orders-page[data-role="dropshipper"] #ordersBody .order-row {
    grid-template-areas:
      "number status"
      "received received"
      "products products"
      "recipient phone"
      "delivery delivery"
      "amount payment"
      "tracking tracking";
  }
  .orders-page #ordersBody .loading-row { display: block; padding: 28px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .orders-page #ordersBody .loading-row td { display: block; height: auto; padding: 0; border: 0; }
  .orders-page .pagination { padding: 12px 0 0; border-top: 0; }
  .orders-page .pagination button { min-height: 42px; }
  .orders-page .pagination { flex-wrap: wrap; }
  .page-jump { width: 100%; justify-content: center; }
  .prom-mapping-head { display: none; }
  .prom-mapping-row { grid-template-columns: 1fr; }
  .orders-page .drawer { width: 100vw; }
  .orders-page .drawer-header { padding: 18px 16px 14px; }
  .orders-page .drawer-content { padding: 16px 14px 28px; }
  .orders-page .detail-grid { grid-template-columns: 1fr; gap: 13px; }
  .orders-page .raw-field { grid-template-columns: 1fr; gap: 3px; }
  .orders-page .toast { right: 10px; bottom: 10px; left: 10px; max-width: none; }
}
.ai-review-field {
  outline: 2px solid rgba(217, 158, 0, 0.48) !important;
  outline-offset: 2px;
  border-radius: 8px;
  background-color: rgba(255, 214, 92, 0.09) !important;
}

.ai-missing {
  margin-top: 8px;
  color: #765400;
}

.guide-page { scroll-behavior: smooth; }
.guide-shell { max-width: 1460px; padding-bottom: 80px; }
.guide-hero { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 24px; padding: 32px 38px; border: 1px solid #cfe0da; border-radius: 22px; background: linear-gradient(135deg, #f8fcfa 0%, #eaf6f1 100%); box-shadow: 0 14px 36px rgba(20, 53, 44, .08); }
.guide-hero h1 { margin: 4px 0 10px; font-size: clamp(28px, 4vw, 46px); line-height: 1.05; letter-spacing: -.035em; }
.guide-hero p:last-child { max-width: 800px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.guide-hero-badge { flex: 0 0 122px; width: 122px; height: 122px; display: grid; place-content: center; text-align: center; border-radius: 50%; color: #fff; background: #19745f; box-shadow: 0 14px 28px rgba(25, 116, 95, .2); }
.guide-hero-badge strong { font-size: 38px; line-height: 1; }
.guide-hero-badge span { margin-top: 5px; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.guide-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 24px; align-items: start; }
.guide-toc { position: sticky; top: 18px; display: grid; gap: 3px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.guide-toc strong { margin-bottom: 7px; color: #17352e; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.guide-toc a { padding: 7px 9px; border-radius: 8px; color: #51645e; text-decoration: none; font-size: 12px; font-weight: 650; line-height: 1.2; }
.guide-toc a:hover { color: #0e6652; background: #eef8f4; }
.guide-article { display: grid; gap: 20px; min-width: 0; }
.guide-section { min-width: 0; max-width: 100%; scroll-margin-top: 18px; padding: 30px 34px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(24, 49, 42, .055); overflow-wrap: anywhere; }
.guide-section > header { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid #e1e9e6; }
.guide-section > header > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: #19745f; font-size: 13px; font-weight: 850; letter-spacing: .05em; }
.guide-section h2 { margin: 0 0 4px; color: #142b25; font-size: 25px; line-height: 1.15; }
.guide-section h3 { margin: 24px 0 10px; color: #17352e; font-size: 16px; }
.guide-section header p, .guide-section > p { margin: 0; color: var(--muted); line-height: 1.6; }
.guide-section ul { margin: 12px 0 0; padding-left: 22px; }
.guide-section li { margin: 8px 0; color: #30433d; line-height: 1.55; }
.guide-section a { color: #0e745d; font-weight: 700; }
.guide-steps { list-style: none; counter-reset: guide-step; margin: 0 !important; padding: 0 !important; }
.guide-steps li { counter-increment: guide-step; position: relative; min-height: 34px; margin: 0 0 12px; padding: 7px 0 7px 48px; }
.guide-steps li::before { content: counter(guide-step); position: absolute; top: 2px; left: 0; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #135c4b; background: #dff2eb; font-weight: 850; }
.guide-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; margin-top: 12px; border: 1px solid #d9e3df; border-radius: 12px; }
.guide-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.guide-table th, .guide-table td { padding: 12px 14px; border-bottom: 1px solid #e1e8e5; text-align: left; vertical-align: top; line-height: 1.45; }
.guide-table th { color: #244239; background: #edf5f2; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.guide-table td:first-child { width: 30%; color: #17352e; font-weight: 750; }
.guide-table tr:last-child td { border-bottom: 0; }
.guide-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.guide-cards > div { padding: 18px; border: 1px solid #dce7e3; border-radius: 13px; background: #f7faf9; }
.guide-cards > div.success { border-color: #b9dfd3; background: #ebf8f3; }
.guide-cards > div.warning { border-color: #ead89a; background: #fff9e7; }
.guide-cards h3 { margin: 0 0 6px; font-size: 15px; }
.guide-cards p { margin: 0; color: #4f625b; line-height: 1.5; }
.guide-callout { margin-top: 18px; padding: 16px 18px; border: 1px solid #bfded4; border-left-width: 4px; border-radius: 11px; background: #eef8f4; }
.guide-callout strong { color: #165b4b; }
.guide-callout p { margin: 5px 0 0; color: #3c514a; line-height: 1.5; }
.guide-callout.warning { border-color: #e3c75e; background: #fff8dd; }
.guide-callout.warning strong { color: #7a5a00; }
.guide-callout.danger { border-color: #e8b5ae; background: #fff1ef; }
.guide-callout.danger strong { color: #9f3023; }
.guide-callout.info { border-color: #b9d6e5; background: #eff8fc; }
.guide-callout.info strong { color: #245d79; }
.guide-shot { margin: 24px 0 0; overflow: hidden; border: 1px solid #d6e1dd; border-radius: 14px; background: #f7faf9; }
.guide-shot img { display: block; width: 100%; height: auto; }
.guide-shot figcaption { padding: 10px 14px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.guide-checklist { counter-reset: checklist; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 !important; padding: 0 !important; list-style: none; }
.guide-checklist li { counter-increment: checklist; position: relative; margin: 0; padding: 14px 14px 14px 46px; border: 1px solid #dce6e2; border-radius: 11px; background: #f8fbfa; }
.guide-checklist li::before { content: "✓"; position: absolute; top: 14px; left: 16px; color: #148066; font-weight: 900; }

@media (max-width: 1050px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-toc { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 12px; }
  .guide-toc strong { display: none; }
  .guide-toc a { flex: 0 0 auto; white-space: nowrap; background: #f4f8f6; }
}

@media (max-width: 760px) {
  .topbar-guide-link { margin-left: 0; padding: 0 8px; }
  .guide-shell { padding: 18px 12px 50px; }
  .guide-hero { align-items: flex-start; padding: 24px 20px; border-radius: 16px; }
  .guide-hero-badge { display: none; }
  .guide-hero h1 { font-size: 30px; }
  .guide-hero p:last-child { font-size: 14px; }
  .guide-section { padding: 22px 17px; border-radius: 14px; }
  .guide-section > header { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
  .guide-section > header > span { width: 40px; height: 40px; border-radius: 11px; }
  .guide-section h2 { font-size: 21px; }
  .guide-cards, .guide-checklist { grid-template-columns: 1fr; }
  .guide-table { min-width: 500px; }
}
.chat-nav-link, .topup-nav-link { position: relative; }
.chat-nav-badge, .topup-nav-badge { min-width: 18px; height: 18px; padding: 0 5px; margin-left: 5px; border-radius: 999px; background: #d92d20; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.order-chat-link { position: relative; display: inline-flex; width: 20px; height: 18px; flex: 0 0 auto; align-items: center; justify-content: center; color: #667085; text-decoration: none; line-height: 1; }
.order-chat-icon { display: block; width: 20px; height: 16px; background: currentColor; -webkit-mask: url('/crm/assets/chat-envelope.png') center / contain no-repeat; mask: url('/crm/assets/chat-envelope.png') center / contain no-repeat; }
.order-chat-link:hover { color: #087768; }
.order-chat-link.has-unread { color: #d92d20; }
.order-chat-link .order-chat-unread { position: absolute; top: -8px; right: -9px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px; background: #d92d20; color: #fff; font-size: 9px; line-height: 15px; text-align: center; }
.row-status-returning td { background: rgba(251, 146, 60, .10); }
.row-status-returned td { background: rgba(148, 163, 184, .10); }
.table-status-select.status-returning { color: #9a3412; background: #fff7ed; }
.table-status-select.status-returned { color: #475467; background: #f2f4f7; }
.return-tracking { display: grid; gap: 2px; margin-top: 5px; padding-top: 5px; border-top: 1px solid currentColor; color: #b42318; text-align: left; }
.return-tracking small { font-size: 11px; }

.chat-layout { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); min-height: 620px; border: 1px solid #d0d5dd; border-radius: 16px; overflow: hidden; background: #fff; }
.chat-sidebar { border-right: 1px solid #e4e7ec; background: #fcfcfd; }
.chat-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px; border-bottom: 1px solid #e4e7ec; }
.chat-thread-list { overflow-y: auto; max-height: 680px; }
.chat-thread-item { width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid #eaecf0; background: transparent; text-align: left; cursor: pointer; }
.chat-thread-item:hover, .chat-thread-item.active { background: #ecfdf8; }
.chat-thread-title, .chat-thread-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-thread-title { color: #101828; font-weight: 700; }
.chat-thread-meta, .chat-thread-preview { margin-top: 5px; color: #667085; font-size: 12px; }
.chat-thread-preview { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-unread-count { min-width: 20px; padding: 2px 6px; border-radius: 999px; background: #d92d20; color: #fff; font-size: 11px; text-align: center; }
.chat-conversation { min-width: 0; background: #fff; }
.chat-empty { display: grid; min-height: 620px; place-items: center; padding: 30px; color: #667085; text-align: center; }
.chat-active { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 680px; }
.chat-conversation-header { display: flex; gap: 10px; align-items: center; padding: 15px 18px; border-bottom: 1px solid #e4e7ec; }
.chat-conversation-header h2 { margin: 0; font-size: 18px; }
.chat-back-button { display: none; border: 0; background: transparent; font-size: 22px; }
.chat-messages { overflow-y: auto; padding: 20px; background: #f8fafb; }
.chat-message { width: fit-content; max-width: min(76%, 720px); margin: 0 0 12px; padding: 10px 13px; border-radius: 13px 13px 13px 3px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.chat-message.own { margin-left: auto; border-radius: 13px 13px 3px 13px; background: #dff7ef; }
.chat-message-author { display: flex; gap: 12px; justify-content: space-between; margin-bottom: 5px; color: #475467; font-size: 11px; font-weight: 700; }
.chat-message-author time { font-weight: 400; }
.chat-message-body { color: #101828; line-height: 1.45; }
.chat-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px; border-top: 1px solid #e4e7ec; }
.chat-composer textarea { min-height: 48px; resize: vertical; }
.chat-list-empty { padding: 24px; color: #667085; text-align: center; }
@media (max-width: 760px) {
  .chat-layout { display: block; min-height: 70vh; }
  .chat-sidebar { border-right: 0; }
  .chat-conversation { display: none; }
  .chat-layout.conversation-open .chat-sidebar { display: none; }
  .chat-layout.conversation-open .chat-conversation { display: block; }
  .chat-back-button { display: inline-block; }
  .chat-active { height: 72vh; }
  .chat-message { max-width: 90%; }
}
