:root {
  color-scheme: light;
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --surface-muted: #f1f5f8;
  --line: #d8e0e8;
  --line-strong: #b9c5d1;
  --text: #15202b;
  --muted: #657386;
  --accent: #1167b1;
  --accent-strong: #0a4f8a;
  --accent-soft: #e8f2fb;
  --green: #198754;
  --green-soft: #e7f5ee;
  --amber: #b67800;
  --amber-soft: #fff5db;
  --red: #c73737;
  --red-soft: #fdeaea;
  --violet: #6f4eb3;
  --violet-soft: #f0ecfb;
  --shadow: 0 12px 32px rgba(21, 32, 43, 0.09);
  --radius: 8px;
  --sidebar-width: 252px;
}

/* MuCheng brand refresh */
.login-body {
  background:
    radial-gradient(circle at 15% 10%, rgba(17, 103, 177, 0.12), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(25, 135, 84, 0.11), transparent 28%),
    linear-gradient(135deg, #f4f8fb 0%, #edf4f0 100%);
}

.login-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(185, 197, 209, 0.72);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 70px rgba(21, 32, 43, 0.14);
  backdrop-filter: blur(14px);
}

.login-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #1167b1, #198754, #f0a431);
  content: "";
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.96)),
    #fbfcfe;
}

.brand {
  position: relative;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(17, 103, 177, 0.08), rgba(25, 135, 84, 0.06));
}

.brand-mark,
.project-choice-mark,
.avatar {
  background: linear-gradient(135deg, #1167b1, #198754);
  box-shadow: 0 8px 18px rgba(17, 103, 177, 0.22);
}

.brand-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.version-badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border: 1px solid rgba(17, 103, 177, 0.18);
  border-radius: 999px;
  background: #eef7f1;
  color: #198754;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.topbar {
  background: rgba(247, 250, 252, 0.86);
  box-shadow: 0 8px 28px rgba(21, 32, 43, 0.05);
}

.project-switch,
.global-search,
.icon-button {
  box-shadow: 0 1px 0 rgba(21, 32, 43, 0.04);
}

.project-switch {
  border-color: rgba(17, 103, 177, 0.22);
  background: #ffffff;
}

.project-switch:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #1167b1, #198754);
}

.global-search:focus-within {
  border-color: rgba(17, 103, 177, 0.52);
  box-shadow: 0 0 0 3px rgba(17, 103, 177, 0.12);
}

.project-choice {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.98)),
    var(--surface-soft);
}

.project-choice:hover {
  border-color: rgba(25, 135, 84, 0.55);
  box-shadow: 0 16px 32px rgba(17, 103, 177, 0.14);
}

.project-choice.wb .project-choice-mark {
  background: linear-gradient(135deg, #6f4eb3, #1167b1);
}

.nav-primary:hover,
.nav-primary.is-open,
.nav-secondary button:hover {
  background: #edf6f2;
}

.nav-secondary button.is-active {
  background: #e8f2fb;
  box-shadow: inset 3px 0 0 #198754;
}

/* MuCheng ERP 2026 EOF override */
:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-muted: #eef4f2;
  --line: #dce4e8;
  --line-strong: #b8c6cf;
  --text: #14212b;
  --muted: #647384;
  --accent: #0f6f9f;
  --accent-strong: #0a567e;
  --accent-soft: #e8f4f8;
  --green: #21845f;
  --green-soft: #e8f5ef;
  --shadow: 0 16px 42px rgba(20, 33, 43, 0.08);
  --sidebar-width: 268px;
}

body {
  background: linear-gradient(180deg, #f7fafb 0, #f1f5f7 280px, #eef3f5 100%);
}

.login-body {
  background:
    linear-gradient(120deg, rgba(15, 111, 159, 0.12), rgba(33, 132, 95, 0.1)),
    linear-gradient(180deg, #f8fbfc, #eef5f3);
}

.login-panel,
.table-wrap,
.kpi-card,
.form-panel,
.auth-card,
.chart-panel,
.side-panel,
.plain-panel,
.sync-panel {
  border: 1px solid rgba(220, 228, 232, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 12px 30px rgba(20, 33, 43, 0.06);
}

.login-panel {
  width: min(820px, 100%);
  box-shadow: 0 28px 80px rgba(20, 33, 43, 0.16);
}

.sidebar {
  border-right: 1px solid rgba(184, 198, 207, 0.68);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 250, 0.96));
  box-shadow: 8px 0 24px rgba(20, 33, 43, 0.03);
}

.brand {
  min-height: 78px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(184, 198, 207, 0.7);
  background:
    linear-gradient(135deg, rgba(15, 111, 159, 0.11), rgba(33, 132, 95, 0.08)),
    #fff;
  padding: 20px 18px;
}

.brand-mark,
.project-choice-mark,
.avatar {
  background: linear-gradient(135deg, #0f6f9f, #21845f);
  box-shadow: 0 10px 22px rgba(15, 111, 159, 0.22);
}

.topbar {
  min-height: 72px;
  border-bottom: 1px solid rgba(184, 198, 207, 0.7);
  background: rgba(247, 250, 251, 0.88);
  box-shadow: 0 10px 28px rgba(20, 33, 43, 0.05);
}

.content {
  padding: 22px 24px 34px;
}

.toolbar,
.actionbar,
.report-controls {
  border: 1px solid rgba(220, 228, 232, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.compact-toolbar {
  gap: 8px;
  padding: 12px;
}

.compact-toolbar .button {
  min-height: 34px;
  padding: 8px 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(15, 111, 159, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(15, 111, 159, 0.08);
  color: #0f5f78;
  font-size: 12px;
  font-weight: 700;
}

.button.primary,
.project-switch:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #0f6f9f, #21845f);
  box-shadow: 0 10px 22px rgba(15, 111, 159, 0.2);
}

.global-search,
.project-switch,
.icon-button,
.button,
.field input,
.field select,
.mini-select {
  border-color: #d7e2e6;
  border-radius: 8px;
}

thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  border-bottom: 1px solid #d7e2e6;
  background: #f6faf9;
  color: #405261;
  font-size: 12px;
  font-weight: 850;
}

tbody tr:nth-child(even) {
  background: #fbfdfd;
}

tbody tr:hover {
  background: #f0f7f5;
}

.nav-primary:hover,
.nav-primary.is-open,
.nav-secondary button:hover {
  background: #edf6f4;
}

.nav-secondary button.is-active {
  background: #e7f3f7;
  color: #0a567e;
  box-shadow: inset 3px 0 0 #21845f;
}

.permission-panel {
  min-width: min(760px, 76vw);
  border: 1px solid #dce4e8;
  border-radius: 8px;
  background: #fbfdfd;
  padding: 12px;
}

.permission-choice:has(input:checked) {
  border-color: rgba(15, 111, 159, 0.34);
  background: #eaf5f7;
  color: #0a567e;
  font-weight: 800;
}

/* MuCheng ERP 2026 final override */
:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-muted: #eef4f2;
  --line: #dce4e8;
  --line-strong: #b8c6cf;
  --text: #14212b;
  --muted: #647384;
  --accent: #0f6f9f;
  --accent-strong: #0a567e;
  --accent-soft: #e8f4f8;
  --green: #21845f;
  --green-soft: #e8f5ef;
  --shadow: 0 16px 42px rgba(20, 33, 43, 0.08);
  --sidebar-width: 268px;
}

body {
  background: linear-gradient(180deg, #f7fafb 0, #f1f5f7 280px, #eef3f5 100%);
}

.login-body {
  background:
    linear-gradient(120deg, rgba(15, 111, 159, 0.12), rgba(33, 132, 95, 0.1)),
    linear-gradient(180deg, #f8fbfc, #eef5f3);
}

.login-panel,
.table-wrap,
.kpi-card,
.form-panel,
.auth-card,
.chart-panel,
.side-panel,
.plain-panel,
.sync-panel {
  border: 1px solid rgba(220, 228, 232, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 12px 30px rgba(20, 33, 43, 0.06);
}

.login-panel {
  width: min(820px, 100%);
  box-shadow: 0 28px 80px rgba(20, 33, 43, 0.16);
}

.sidebar {
  border-right: 1px solid rgba(184, 198, 207, 0.68);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 250, 0.96));
  box-shadow: 8px 0 24px rgba(20, 33, 43, 0.03);
}

.brand {
  min-height: 78px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(184, 198, 207, 0.7);
  background:
    linear-gradient(135deg, rgba(15, 111, 159, 0.11), rgba(33, 132, 95, 0.08)),
    #fff;
  padding: 20px 18px;
}

.brand-mark,
.project-choice-mark,
.avatar {
  background: linear-gradient(135deg, #0f6f9f, #21845f);
  box-shadow: 0 10px 22px rgba(15, 111, 159, 0.22);
}

.brand-mark {
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.brand-name {
  font-size: 17px;
}

.brand-subtitle {
  color: #6a7a88;
  font-weight: 650;
}

.topbar {
  min-height: 72px;
  border-bottom: 1px solid rgba(184, 198, 207, 0.7);
  background: rgba(247, 250, 251, 0.88);
  box-shadow: 0 10px 28px rgba(20, 33, 43, 0.05);
}

h1 {
  color: #14212b;
  font-size: 24px;
}

.content {
  padding: 22px 24px 34px;
}

.toolbar,
.actionbar,
.report-controls {
  border: 1px solid rgba(220, 228, 232, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.button.primary,
.project-switch:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #0f6f9f, #21845f);
  box-shadow: 0 10px 22px rgba(15, 111, 159, 0.2);
}

.global-search,
.project-switch,
.icon-button,
.button,
.field input,
.field select,
.mini-select {
  border-color: #d7e2e6;
  border-radius: 8px;
}

.global-search:focus-within,
.field input:focus,
.field select:focus,
.mini-select:focus {
  border-color: rgba(15, 111, 159, 0.56);
  box-shadow: 0 0 0 3px rgba(15, 111, 159, 0.12);
}

thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  border-bottom: 1px solid #d7e2e6;
  background: #f6faf9;
  color: #405261;
  font-size: 12px;
  font-weight: 850;
}

tbody tr:nth-child(even) {
  background: #fbfdfd;
}

tbody tr:hover {
  background: #f0f7f5;
}

.nav-primary:hover,
.nav-primary.is-open,
.nav-secondary button:hover {
  background: #edf6f4;
}

.nav-secondary button.is-active {
  background: #e7f3f7;
  color: #0a567e;
  box-shadow: inset 3px 0 0 #21845f;
}

.permission-panel {
  min-width: min(760px, 76vw);
  border: 1px solid #dce4e8;
  border-radius: 8px;
  background: #fbfdfd;
  padding: 12px;
}

.permission-choice:has(input:checked) {
  border-color: rgba(15, 111, 159, 0.34);
  background: #eaf5f7;
  color: #0a567e;
  font-weight: 800;
}

.table-input,
.table-textarea,
.delivery-month-note {
  width: 100%;
  border: 1px solid #d7e2e6;
  border-radius: 8px;
  background: #fff;
  color: #27343b;
  font: inherit;
}

.table-input {
  height: 38px;
  padding: 0 10px;
}

.table-textarea,
.delivery-month-note {
  min-height: 76px;
  padding: 10px;
  resize: vertical;
}

.table-input:focus,
.table-textarea:focus,
.delivery-month-note:focus {
  border-color: #21845f;
  box-shadow: 0 0 0 3px rgba(33, 132, 95, 0.12);
  outline: none;
}

.delivery-month-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.delivery-month-picker {
  width: 170px;
}

.delivery-month-board {
  overflow-x: auto;
  border: 1px solid #d7e2e6;
  border-radius: 8px;
  background: #fff;
}

.delivery-week-header,
.delivery-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(124px, 1fr));
  min-width: 900px;
}

.delivery-week-header {
  border-bottom: 1px solid #d7e2e6;
  background: #f6faf9;
  color: #405261;
  font-size: 13px;
  font-weight: 850;
}

.delivery-week-header span {
  padding: 12px;
  text-align: center;
}

.delivery-month-cell {
  min-height: 150px;
  border-right: 1px solid #e2ebee;
  border-bottom: 1px solid #e2ebee;
  padding: 10px;
  background: #fff;
}

.delivery-month-cell:nth-child(7n) {
  border-right: 0;
}

.delivery-month-cell.is-empty {
  background: #f8fbfb;
}

.delivery-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #5d6f7f;
}

.delivery-date-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.delivery-date-head strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #e7f3f7;
  color: #0a567e;
  font-size: 15px;
}

.delivery-date-head span {
  font-size: 12px;
  font-weight: 800;
}

.delivery-month-note {
  min-height: 94px;
  line-height: 1.45;
}

.delivery-file-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #d7e2e6;
  border-radius: 8px;
  background: #ffffff;
  color: #0a567e;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
}

.delivery-file-button:hover {
  border-color: #21845f;
  background: #eaf5f7;
}

.delivery-file-count {
  border-radius: 999px;
  background: #eef7f1;
  color: #21845f;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.delivery-save-status {
  border: 1px solid #d7e2e6;
  border-radius: 8px;
  background: #fbfdfd;
  color: #5d6f7f;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.delivery-file-modal {
  max-width: 720px;
}

.delivery-file-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.delivery-file-section-title {
  margin-top: 18px;
  color: #405261;
  font-size: 14px;
  font-weight: 850;
}

.delivery-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #d7e2e6;
  border-radius: 8px;
  background: #fbfdfd;
  padding: 12px;
}

.delivery-file-item.is-empty {
  background: #f8fbfb;
}

.delivery-file-item strong,
.delivery-file-item span {
  display: block;
}

.delivery-file-item span {
  margin-top: 4px;
  color: #637083;
  font-size: 12px;
}

@media (max-width: 760px) {
  .content {
    padding: 16px;
  }

  .permission-panel {
    min-width: 0;
    width: 100%;
  }

  .delivery-month-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .delivery-month-picker {
    width: 100%;
  }
}

.sku-cost-saved-record {
  display: grid;
  gap: 4px;
  margin: 12px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--green);
  border-radius: 12px;
  background: var(--green-soft);
}

.sku-cost-saved-record > span,
.sku-cost-saved-record > small,
.commerce-cost-effective small {
  color: var(--muted);
  font-size: 12px;
}

.sku-cost-saved-record > strong,
.commerce-cost-effective strong {
  color: var(--text);
}

.sku-cost-saved-record[data-cost-record-state="empty"] {
  border-color: var(--line);
  background: var(--surface-soft);
}

.commerce-cost-effective {
  display: grid;
  gap: 3px;
  min-width: 150px;
}

.store-assets-distribution {
  display: grid;
  gap: 14px;
}

.store-assets-distribution__row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(240px, 1.3fr) minmax(150px, auto);
  align-items: center;
  gap: 16px;
}

.store-assets-distribution__row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.store-assets-distribution__row strong {
  color: var(--text);
  font-size: 13px;
}

.store-assets-distribution__row small {
  color: var(--muted);
  font-size: 11px;
}

.store-assets-distribution__row > span {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.store-assets-distribution__row i {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
}

.store-assets-distribution__row.is-settled i {
  background: #2b8a68;
}

.store-assets-distribution__row.is-pending i {
  background: #c18b2c;
}

.store-assets-distribution__row.is-inventory i {
  background: #4169b2;
}

.store-assets-distribution__row b {
  color: var(--text);
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .store-assets-distribution__row {
    grid-template-columns: 1fr auto;
  }

  .store-assets-distribution__row > span {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.role-create-panel .form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.role-create-panel .field,
.role-create-panel .permission-panel {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.role-permissions-page,
.role-permissions-page .table-area,
.role-permissions-page .table-wrap {
  min-width: 0;
  max-width: 100%;
}

/* MuCheng ERP 2026 interface refresh */
:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-muted: #eef4f2;
  --line: #dce4e8;
  --line-strong: #b8c6cf;
  --text: #14212b;
  --muted: #647384;
  --accent: #0f6f9f;
  --accent-strong: #0a567e;
  --accent-soft: #e8f4f8;
  --green: #21845f;
  --green-soft: #e8f5ef;
  --amber: #b98116;
  --amber-soft: #fff6dd;
  --red: #c9483f;
  --red-soft: #fdeceb;
  --violet: #7357b8;
  --violet-soft: #f1edfb;
  --shadow: 0 16px 42px rgba(20, 33, 43, 0.08);
  --sidebar-width: 268px;
}

body {
  background:
    linear-gradient(180deg, #f7fafb 0, #f1f5f7 280px, #eef3f5 100%);
}

.login-body {
  background:
    linear-gradient(120deg, rgba(15, 111, 159, 0.12), rgba(33, 132, 95, 0.1)),
    linear-gradient(180deg, #f8fbfc, #eef5f3);
}

.login-panel {
  width: min(820px, 100%);
  border: 1px solid rgba(184, 198, 207, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(20, 33, 43, 0.16);
}

.login-brand {
  align-items: flex-start;
}

.login-heading h1 {
  font-size: 30px;
}

.app-shell {
  background: transparent;
}

.sidebar {
  border-right: 1px solid rgba(184, 198, 207, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 250, 0.96)),
    #fff;
  box-shadow: 8px 0 24px rgba(20, 33, 43, 0.03);
}

.brand {
  min-height: 78px;
  border-bottom: 1px solid rgba(184, 198, 207, 0.7);
  background:
    linear-gradient(135deg, rgba(15, 111, 159, 0.11), rgba(33, 132, 95, 0.08)),
    #fff;
  padding: 20px 18px;
}

.brand-mark,
.project-choice-mark,
.project-gate-mark,
.project-choice-icon,
.avatar {
  background: linear-gradient(135deg, #0f6f9f, #21845f);
  box-shadow: 0 10px 22px rgba(15, 111, 159, 0.22);
}

.brand-mark {
  width: 42px;
  height: 42px;
  font-size: 13px;
}

.brand-name {
  font-size: 17px;
}

.brand-subtitle {
  color: #6a7a88;
  font-weight: 650;
}

.version-badge {
  border-color: rgba(33, 132, 95, 0.2);
  background: #edf8f2;
  color: #21845f;
}

.primary-nav {
  padding: 14px 12px 18px;
}

.nav-group {
  margin-bottom: 8px;
}

.nav-primary {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #263642;
}

.nav-primary:hover,
.nav-primary.is-open {
  border-color: rgba(15, 111, 159, 0.08);
  background: #edf6f4;
}

.nav-icon {
  width: 10px;
  height: 10px;
  flex-basis: 10px;
  background: #c3d0d7;
}

.nav-primary.is-open .nav-icon {
  background: #21845f;
  box-shadow: 0 0 0 4px rgba(33, 132, 95, 0.12);
}

.nav-secondary {
  margin: 6px 0 10px 14px;
  padding-left: 14px;
  border-left-color: #d5e2e1;
}

.nav-secondary button {
  min-height: 34px;
  border-radius: 8px;
  font-size: 13px;
}

.nav-secondary button:hover {
  background: #f0f7f5;
}

.nav-secondary button.is-active {
  background: #e7f3f7;
  color: #0a567e;
  box-shadow: inset 3px 0 0 #21845f;
}

.topbar {
  min-height: 72px;
  border-bottom: 1px solid rgba(184, 198, 207, 0.7);
  background: rgba(247, 250, 251, 0.88);
  box-shadow: 0 10px 28px rgba(20, 33, 43, 0.05);
}

.breadcrumb {
  color: #778796;
  font-weight: 650;
}

h1 {
  color: #14212b;
  font-size: 24px;
}

.global-search,
.project-switch,
.icon-button,
.button,
.field input,
.field select,
.mini-select {
  border-color: #d7e2e6;
}

.global-search {
  height: 40px;
  background: rgba(255, 255, 255, 0.92);
}

.global-search:focus-within,
.field input:focus,
.field select:focus,
.mini-select:focus {
  border-color: rgba(15, 111, 159, 0.56);
  box-shadow: 0 0 0 3px rgba(15, 111, 159, 0.12);
}

.content {
  padding: 22px 24px 34px;
}

.page-stack {
  gap: 16px;
}

.toolbar,
.actionbar,
.report-controls {
  border: 1px solid rgba(220, 228, 232, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 0 rgba(20, 33, 43, 0.03);
}

.button,
.project-switch,
.tab-button,
.permission-action {
  min-height: 36px;
  border-radius: 8px;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.button:hover,
.project-switch:hover,
.tab-button:hover,
.permission-action:hover {
  transform: translateY(-1px);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #0f6f9f, #21845f);
  box-shadow: 0 10px 22px rgba(15, 111, 159, 0.2);
}

.button.primary:hover {
  background: linear-gradient(135deg, #0a567e, #1a704f);
}

.button.danger {
  background: #fff7f6;
}

.kpi-card,
.form-panel,
.auth-card,
.chart-panel,
.side-panel,
.plain-panel,
.sync-panel {
  border: 1px solid rgba(220, 228, 232, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 30px rgba(20, 33, 43, 0.06);
}

.kpi-card {
  min-height: 118px;
}

.kpi-label,
.panel-title,
.auth-name,
.modal-title {
  color: #172834;
}

.kpi-value {
  font-size: 27px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(220, 228, 232, 0.94);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(20, 33, 43, 0.06);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  border-bottom: 1px solid #d7e2e6;
  background: #f6faf9;
  color: #405261;
  font-size: 12px;
  font-weight: 850;
}

.table-sort-button {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: inherit;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 0;
  text-align: inherit;
  white-space: nowrap;
}

.sku-products-sticky-table .table-wrap table {
  min-width: 1320px;
}

.sku-products-sticky-table th:nth-child(-n + 2),
.sku-products-sticky-table td:nth-child(-n + 2) {
  position: sticky;
  background: #fff;
}

.sku-products-sticky-table th:nth-child(1),
.sku-products-sticky-table td:nth-child(1) {
  left: 0;
  width: 108px;
  min-width: 108px;
  max-width: 108px;
}

.sku-products-sticky-table th:nth-child(2),
.sku-products-sticky-table td:nth-child(2) {
  left: 108px;
  width: 122px;
  min-width: 122px;
  max-width: 122px;
  box-shadow: 10px 0 16px -14px rgba(20, 33, 43, 0.72);
}

.sku-products-sticky-table thead th:nth-child(-n + 2) {
  z-index: 5;
  background: #f6faf9;
}

.sku-products-sticky-table tbody td:nth-child(-n + 2) {
  z-index: 3;
}

.sku-products-sticky-table tbody tr:nth-child(even) td:nth-child(-n + 2) {
  background: #fbfdfd;
}

.sku-products-sticky-table tbody tr:hover td:nth-child(-n + 2) {
  background: #f0f7f5;
}

.sku-list-identity {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sku-list-manual-alert {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  font-size: 11px;
}

.sku-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sku-row-actions .button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.sku-row-actions .sku-adopt-suggestions {
  border-color: rgba(24, 133, 86, 0.3);
  background: rgba(24, 133, 86, 0.08);
  color: #147349;
}

.sku-row-actions .sku-adopt-suggestions:hover {
  border-color: #188556;
  background: rgba(24, 133, 86, 0.14);
}

.sku-alert-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid #dce7e5;
  border-radius: 7px;
  background: #f7faf9;
}

.sku-alert-legend .manual-rate-alert {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  font-size: 10px;
  cursor: default;
}

.sku-alert-legend small {
  color: #53646f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.sku-alert-legend .sku-alert-legend-tip {
  margin-left: auto;
  color: var(--muted);
  font-weight: 600;
}

.inventory-dashboard .kpi-grid {
  grid-template-columns: repeat(6, minmax(142px, 1fr));
}

.inventory-dashboard .kpi-card {
  min-height: 102px;
  border-top-width: 3px;
}

.inventory-dashboard .kpi-card.tone-stock { border-top-color: #198754; background: #f5fbf8; }
.inventory-dashboard .kpi-card.tone-sales { border-top-color: #1677a8; background: #f4fafc; }
.inventory-dashboard .kpi-card.tone-orders { border-top-color: #7868a6; background: #faf8fc; }
.inventory-dashboard .kpi-card.tone-ad { border-top-color: #d28a24; background: #fffbf4; }
.inventory-dashboard .kpi-card.tone-return { border-top-color: #bd594f; background: #fff8f7; }
.inventory-dashboard .kpi-card.tone-profit { border-top-color: #2f667c; background: #f6fafb; }

.inventory-context-note {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  border: 1px solid #d7e5e1;
  border-left: 4px solid #278364;
  border-radius: 7px;
  background: #f7fbf9;
  padding: 9px 12px;
}

.inventory-context-note strong {
  flex: 0 0 auto;
  color: #164f3c;
  font-size: 12px;
}

.inventory-context-note span {
  color: #5c6b74;
  font-size: 11px;
  line-height: 1.45;
}

.inventory-overview-table .table-wrap table {
  min-width: 1550px;
}

.inventory-overview-table th:first-child,
.inventory-overview-table td:first-child {
  position: sticky;
  left: 0;
  width: 224px;
  min-width: 224px;
  max-width: 224px;
  background: #fff;
}

.inventory-overview-table thead th:first-child {
  z-index: 5;
  background: #f6faf9;
}

.inventory-overview-table tbody td:first-child {
  z-index: 3;
  box-shadow: 10px 0 16px -15px rgba(20, 33, 43, 0.75);
}

.inventory-overview-table tbody tr:nth-child(even) td:first-child { background: #fbfdfd; }
.inventory-overview-table tbody tr:hover td:first-child { background: #f0f7f5; }

.inventory-product-identity {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.inventory-product-identity > img,
.inventory-product-identity > span {
  width: 36px;
  height: 36px;
  border: 1px solid #dce6e8;
  border-radius: 6px;
  object-fit: cover;
}

.inventory-product-identity > span {
  display: grid;
  place-items: center;
  background: #edf5f3;
  color: #27735d;
  font-size: 10px;
  font-weight: 900;
}

.inventory-product-identity > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.inventory-product-identity strong,
.inventory-product-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-product-identity small,
.inventory-platform-stock small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.inventory-platform-stock { color: #166f96; }
.inventory-overview-table td.is-available { color: #177a50; font-weight: 900; }
.inventory-total-supply { color: #263d49; font-weight: 900; }

.inventory-node-list {
  display: flex;
  min-width: 210px;
  flex-wrap: wrap;
  gap: 5px;
}

.inventory-node-stack {
  display: grid;
  align-content: start;
  gap: 3px;
}

.inventory-node-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #dbe5e7;
  border-radius: 6px;
  background: #f7fafb;
  padding: 4px 6px;
  color: #40545f;
  font-size: 10px;
  white-space: nowrap;
}

.inventory-node-badge strong { color: #142630; font-size: 11px; }
.inventory-node-badge small { color: #71808a; font-size: 9px; }
.inventory-node-badge.is-overseas_available { border-color: #bcded0; background: #f0faf5; }
.inventory-node-badge.is-russia_transit,
.inventory-node-badge.is-fbo_transit { border-color: #ead7ad; background: #fffaf0; }

.inventory-deadline {
  display: inline-flex;
  width: max-content;
  align-items: center;
  border-left: 3px solid #7b929c;
  padding-left: 5px;
  color: #647681;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-deadline.is-overdue { border-color: #c8413a; color: #b3342f; }
.inventory-deadline.is-due-soon { border-color: #d58b1e; color: #a86810; }
.inventory-deadline.is-on-time { border-color: #278364; color: #357461; }

.supply-sync-time {
  color: #6a7b86;
  font-size: 12px;
  white-space: nowrap;
}

.platform-supply-panel {
  min-width: 0;
  overflow: hidden;
}

.platform-supply-panel .panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.supply-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid #e1eaed;
  border-bottom: 1px solid #e1eaed;
  background: #f7fafb;
}

.supply-kpi {
  min-height: 94px;
  padding: 13px 14px;
  border: 1px solid #dbe7ea;
  border-left: 4px solid #7b939d;
  border-radius: 8px;
  background: #fff;
}

.supply-kpi span,
.supply-kpi small,
.supply-kpi strong {
  display: block;
}

.supply-kpi span { color: #59707b; font-size: 12px; }
.supply-kpi strong { margin-top: 5px; color: #12232d; font-size: 25px; line-height: 1.1; }
.supply-kpi small { margin-top: 6px; color: #7b8d96; font-size: 11px; }
.supply-kpi.is-reserved { border-left-color: #d9a238; }
.supply-kpi.is-planned { border-left-color: #8a6caf; }
.supply-kpi.is-transit { border-left-color: #2f78b7; }
.supply-kpi.is-received { border-left-color: #23896a; }
.supply-kpi.is-warning { border-left-color: #c94a4a; }

.supply-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
}

.supply-toolbar .segmented-control {
  display: inline-grid;
  width: auto;
  grid-auto-flow: column;
  gap: 3px;
  border: 1px solid #d6e2e6;
  border-radius: 8px;
  background: #f4f8f9;
  padding: 3px;
}

.supply-toolbar .segmented-control button {
  min-width: 72px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5f747f;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.supply-toolbar .segmented-control button.is-active {
  background: #fff;
  color: #0a6289;
  box-shadow: 0 1px 4px rgba(28, 55, 67, 0.14);
}

.supply-toolbar .table-select { width: 170px; }
.supply-table-shell {
  max-width: 100%;
  min-height: 280px;
  overflow: auto;
  border: 0;
  border-top: 1px solid #e4ecef;
  border-radius: 0;
  box-shadow: none;
}
.supply-request-table { min-width: 1240px; }
.supply-request-table th:nth-child(1) { width: 154px; }
.supply-request-table th:nth-child(2) { width: 96px; }
.supply-request-table th:nth-child(3) { width: 70px; }
.supply-request-table th:nth-child(4) { width: 220px; }
.supply-request-table th:nth-child(5) { width: 190px; }
.supply-request-table th:nth-child(6) { width: 170px; }
.supply-request-table th:nth-child(7) { width: 100px; }
.supply-request-table th:nth-child(8) { width: 140px; }

.platform-chip,
.supply-stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid #ccdadd;
  border-radius: 6px;
  background: #f4f8f9;
  color: #3e5964;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.platform-chip.is-ozon { border-color: #b9caee; background: #eef3ff; color: #2857a8; }
.platform-chip.is-wb { border-color: #ddb9df; background: #fbf0fb; color: #87398b; }
.supply-stage-pill.is-reserved { border-color: #ead39d; background: #fff8e8; color: #895d0f; }
.supply-stage-pill.is-planned { border-color: #d8cae8; background: #f7f2fb; color: #70508f; }
.supply-stage-pill.is-transit { border-color: #b9d6eb; background: #edf7ff; color: #1f6499; }
.supply-stage-pill.is-received { border-color: #b5decf; background: #edf9f4; color: #176b50; }
.supply-stage-pill.is-warning { border-color: #ebc0c0; background: #fff1f1; color: #a62e2e; }

.supply-reconcile-text,
.supply-request-table td > small.muted {
  display: block;
  margin-top: 5px;
  color: #7a8d96;
  font-size: 11px;
  line-height: 1.4;
}

.supply-item-briefs { display: grid; gap: 4px; }
.supply-item-brief { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.supply-item-brief strong { color: #173440; }
.supply-item-brief span { color: #6a7d86; white-space: nowrap; }
.text-danger { color: #b73737; }
.text-success { color: #177456; }
.text-planned { color: #70508f; }

.supply-sync-warning {
  display: flex;
  gap: 10px;
  margin: 12px 18px 18px;
  padding: 10px 12px;
  border: 1px solid #e9c0b6;
  border-radius: 6px;
  background: #fff6f2;
  color: #874337;
  font-size: 12px;
}

.supply-detail-modal { width: min(1120px, calc(100vw - 40px)); }
.supply-detail-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 14px; color: #536b76; font-size: 13px; }

@media (max-width: 1050px) {
  .supply-kpi-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .supply-kpi-grid .supply-kpi:last-child { grid-column: span 2; }
}

@media (max-width: 680px) {
  .supply-kpi-grid { grid-template-columns: 1fr; }
  .supply-kpi-grid .supply-kpi:last-child { grid-column: auto; }
  .platform-supply-panel .panel-header,
  .platform-supply-panel .panel-actions { align-items: stretch; flex-direction: column; }
  .platform-supply-panel .panel-header { padding-top: 12px; padding-bottom: 12px; }
  .platform-supply-panel .panel-actions .button { width: 100%; }
  .supply-toolbar { align-items: stretch; flex-direction: column; }
  .supply-toolbar .segmented-control { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .supply-toolbar .segmented-control button { min-width: 0; }
  .supply-toolbar .table-select { width: 100%; }
  .supply-sync-time { display: none; }
}
.inventory-node-badge.is-frozen { border-color: #e7c4c0; background: #fff5f4; }

.inventory-batch-table .table-wrap table { min-width: 1450px; }
.inventory-batch-table td > small,
.inventory-batch-table td > strong { display: block; }
.inventory-batch-table td > small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.inventory-cost-state {
  display: grid;
  min-width: 96px;
  gap: 3px;
}

.inventory-cost-state > span {
  border-left: 3px solid #9aaab1;
  padding-left: 6px;
  color: #526872;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.inventory-cost-state > small { color: #7d8c94; font-size: 9px; }
.inventory-cost-state > .is-active { border-color: #21845f; color: #176c4d; }
.inventory-cost-state > .is-queued { border-color: #d58b1e; color: #99600e; }
.inventory-cost-state > .is-deployed { border-color: #3679ad; color: #275f89; }
.inventory-cost-state > .is-missing { border-color: #c8413a; color: #ad302b; }

.inventory-batch-actions {
  display: grid;
  min-width: 132px;
  gap: 5px;
}

.inventory-action-row {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid #edf1f2;
  padding-bottom: 5px;
}

.inventory-action-row:last-child { border-bottom: 0; }
.inventory-action-row > small { color: #71818a; font-size: 9px; }
.inventory-next-button { justify-content: center; border-color: #bdd9cf; color: #176c4d; font-weight: 850; }
.inventory-next-button:hover { border-color: #21845f; background: #f1faf6; }
.inventory-next-button.is-compact { min-height: 28px; padding: 5px 8px; font-size: 10px; }
.inventory-advanced-button { min-height: 26px; border-style: dashed; padding: 4px 7px; color: #72828b; font-size: 9px; }

.inventory-transit-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #edd8aa;
  border-left: 4px solid #d58b1e;
  border-radius: 7px;
  background: #fffaf0;
  padding: 10px 12px;
}

.inventory-transit-alert.has-overdue { border-color: #edc4c0; border-left-color: #c8413a; background: #fff7f6; }
.inventory-transit-alert strong { color: #834d09; font-size: 12px; }
.inventory-transit-alert.has-overdue strong { color: #a72f2b; }
.inventory-transit-alert span { color: #687983; font-size: 11px; }

.inventory-transit-date {
  display: grid;
  min-width: 108px;
  gap: 4px;
}

.inventory-transit-date strong { color: #344b56; font-size: 11px; }

.inventory-workflow-route {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto 18px auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2eaec;
  padding-bottom: 12px;
}

.inventory-workflow-route > div { display: grid; gap: 3px; }
.inventory-workflow-route small { color: #7b8b93; font-size: 10px; }
.inventory-workflow-route strong { color: #193541; font-size: 13px; }
.inventory-workflow-route > span { color: #667983; font-size: 12px; font-weight: 800; }
.inventory-workflow-route > span.is-target { color: #176c4d; }
.inventory-workflow-route > b { color: #9aabb2; text-align: center; }
.inventory-workflow-fields { margin-top: 14px; }

.inventory-route {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.inventory-capital-page .kpi-grid {
  grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.inventory-capital-breakdown {
  min-width: 0;
  overflow: hidden;
}

.inventory-capital-bars {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}

.inventory-capital-bar-row {
  display: grid;
  grid-template-columns: 170px minmax(180px, 1fr) 130px;
  align-items: center;
  gap: 14px;
}

.inventory-capital-bar-row > div {
  display: grid;
  gap: 2px;
}

.inventory-capital-bar-row strong {
  color: #253b46;
  font-size: 12px;
}

.inventory-capital-bar-row small {
  color: #7a8b94;
  font-size: 10px;
}

.inventory-capital-bar-row > span {
  display: block;
  height: 9px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf2f4;
}

.inventory-capital-bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #21845f;
}

.inventory-capital-bar-row.is-production i { background: #c18b2c; }
.inventory-capital-bar-row.is-transit i { background: #2f78b7; }
.inventory-capital-bar-row.is-overseas i { background: #21845f; }
.inventory-capital-bar-row.is-ozon i { background: #4169b2; }
.inventory-capital-bar-row.is-wb i { background: #9a4f9e; }
.inventory-capital-bar-row.is-frozen i { background: #c44d4d; }

.inventory-capital-bar-row b {
  color: #1c303a;
  font-size: 12px;
  text-align: right;
}

.inventory-capital-table .table-wrap table {
  min-width: 1560px;
}

.inventory-capital-table th:first-child,
.inventory-capital-table td:first-child {
  position: sticky;
  z-index: 2;
  left: 0;
  width: 220px;
  min-width: 220px;
  background: inherit;
  box-shadow: 1px 0 0 #dfe8eb;
}

.inventory-capital-table thead th:first-child {
  z-index: 3;
  background: #f6faf9;
}

.inventory-capital-value {
  display: grid;
  gap: 3px;
  min-width: 105px;
}

.inventory-capital-value strong {
  color: #243b45;
  font-size: 12px;
  white-space: nowrap;
}

.inventory-capital-value small,
.inventory-capital-table td > small {
  color: #74858e;
  font-size: 10px;
  white-space: nowrap;
}

.inventory-capital-total strong {
  color: #176b50;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .inventory-capital-page .kpi-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 680px) {
  .inventory-capital-page .kpi-grid {
    grid-template-columns: 1fr;
  }

  .inventory-capital-bar-row {
    grid-template-columns: 1fr 92px;
    gap: 7px 10px;
  }

  .inventory-capital-bar-row > span {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.inventory-route b { color: #8ca0a9; }
.inventory-route strong { color: #1b7255; }

.inventory-modal {
  width: min(860px, calc(100vw - 32px));
}

.sku-cost-effective-grid {
  max-width: 430px;
  margin: 10px 0 4px;
}

@media (max-width: 1200px) {
  .inventory-dashboard .kpi-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}

@media (max-width: 720px) {
  .inventory-dashboard .kpi-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .inventory-context-note { align-items: flex-start; flex-direction: column; gap: 4px; }
  .inventory-transit-alert { grid-template-columns: 1fr; }
  .inventory-workflow-route { grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); }
  .inventory-workflow-route > div { grid-column: 1 / -1; }
  .inventory-workflow-route > span { min-width: 0; text-align: center; }
}

@media (max-width: 900px) {
  .sku-alert-legend .sku-alert-legend-tip {
    width: 100%;
    margin-left: 0;
  }
}

.ad-records-sticky-table .table-wrap table {
  min-width: 1520px;
}

.ad-records-sticky-table th:nth-child(-n + 3),
.ad-records-sticky-table td:nth-child(-n + 3) {
  position: sticky;
  background: #fff;
}

.ad-records-sticky-table th:nth-child(1),
.ad-records-sticky-table td:nth-child(1) {
  left: 0;
  width: 96px;
  min-width: 96px;
  max-width: 96px;
}

.ad-records-sticky-table th:nth-child(2),
.ad-records-sticky-table td:nth-child(2) {
  left: 96px;
  width: 104px;
  min-width: 104px;
  max-width: 104px;
}

.ad-records-sticky-table th:nth-child(3),
.ad-records-sticky-table td:nth-child(3) {
  left: 200px;
  width: var(--ad-fixed-product-width, 220px);
  min-width: var(--ad-fixed-product-width, 220px);
  max-width: var(--ad-fixed-product-width, 220px);
  box-shadow: 10px 0 16px -14px rgba(20, 33, 43, 0.72);
}

.ad-records-sticky-table thead th:nth-child(3) {
  overflow: visible;
}

.ad-fixed-resize-handle {
  position: absolute;
  z-index: 7;
  top: 0;
  right: -5px;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
}

.ad-fixed-resize-handle::after {
  position: absolute;
  top: 20%;
  right: 4px;
  bottom: 20%;
  width: 2px;
  border-radius: 2px;
  background: #9fb3bd;
  content: "";
  opacity: 0.65;
}

.ad-fixed-resize-handle:hover::after,
.is-resizing-ad-fixed .ad-fixed-resize-handle::after {
  background: var(--accent);
  opacity: 1;
}

.is-resizing-ad-fixed,
.is-resizing-ad-fixed * {
  cursor: col-resize !important;
  user-select: none !important;
}

.ad-records-sticky-table th:nth-child(-n + 3),
.ad-records-sticky-table td:nth-child(-n + 3) {
  padding-right: 10px;
  padding-left: 10px;
}

.ad-records-sticky-table thead th:nth-child(-n + 3) {
  z-index: 4;
  background: #f6faf9;
}

.ad-records-sticky-table tbody td:nth-child(-n + 3) {
  z-index: 2;
}

.ad-records-sticky-table tbody tr:nth-child(even) td:nth-child(-n + 3) {
  background: #fbfdfd;
}

.ad-records-sticky-table tbody tr:hover td:nth-child(-n + 3) {
  background: #f0f7f5;
}

.cpo-all-products-table .table-wrap table {
  min-width: 1280px;
}

.cpo-selected-products-table .table-wrap table {
  min-width: 980px;
}

.cpo-all-products-table th:nth-child(-n + 2),
.cpo-all-products-table td:nth-child(-n + 2),
.cpo-selected-products-table th:nth-child(-n + 2),
.cpo-selected-products-table td:nth-child(-n + 2) {
  position: sticky;
  z-index: 2;
  background: #ffffff;
}

.cpo-all-products-table th:nth-child(1),
.cpo-all-products-table td:nth-child(1),
.cpo-selected-products-table th:nth-child(1),
.cpo-selected-products-table td:nth-child(1) {
  left: 0;
  width: 96px;
  min-width: 96px;
  max-width: 96px;
}

.cpo-all-products-table th:nth-child(2),
.cpo-all-products-table td:nth-child(2),
.cpo-selected-products-table th:nth-child(2),
.cpo-selected-products-table td:nth-child(2) {
  left: 96px;
  width: 104px;
  min-width: 104px;
  max-width: 104px;
  box-shadow: 10px 0 16px -16px rgba(16, 37, 51, 0.55);
}

.cpo-all-products-table thead th:nth-child(-n + 2),
.cpo-selected-products-table thead th:nth-child(-n + 2) {
  z-index: 4;
  background: #f6faf9;
}

.cpo-all-products-table tbody tr:nth-child(even) td:nth-child(-n + 2),
.cpo-selected-products-table tbody tr:nth-child(even) td:nth-child(-n + 2) {
  background: #fbfdfd;
}

.cpo-all-products-table tbody tr:hover td:nth-child(-n + 2),
.cpo-selected-products-table tbody tr:hover td:nth-child(-n + 2) {
  background: #f0f7f5;
}

.daily-sales-store-table .table-wrap table {
  min-width: 1960px;
}

.daily-sales-sku-table .table-wrap table {
  min-width: 2160px;
}

.daily-sales-store-table th:nth-child(-n + 2),
.daily-sales-store-table td:nth-child(-n + 2),
.daily-sales-sku-table th:nth-child(-n + 3),
.daily-sales-sku-table td:nth-child(-n + 3) {
  position: sticky;
  z-index: 2;
  background: #fff;
}

.daily-sales-store-table th:nth-child(1),
.daily-sales-store-table td:nth-child(1),
.daily-sales-sku-table th:nth-child(1),
.daily-sales-sku-table td:nth-child(1) {
  left: 0;
  width: 104px;
  min-width: 104px;
  max-width: 104px;
}

.daily-sales-store-table th:nth-child(2),
.daily-sales-store-table td:nth-child(2),
.daily-sales-sku-table th:nth-child(2),
.daily-sales-sku-table td:nth-child(2) {
  left: 104px;
  width: 112px;
  min-width: 112px;
  max-width: 112px;
}

.daily-sales-store-table th:nth-child(2),
.daily-sales-store-table td:nth-child(2) {
  box-shadow: 10px 0 16px -16px rgba(16, 37, 51, 0.55);
}

.daily-sales-sku-table th:nth-child(3),
.daily-sales-sku-table td:nth-child(3) {
  left: 216px;
  width: 152px;
  min-width: 152px;
  max-width: 152px;
  box-shadow: 10px 0 16px -16px rgba(16, 37, 51, 0.55);
}

.daily-sales-store-table thead th:nth-child(-n + 2),
.daily-sales-sku-table thead th:nth-child(-n + 3) {
  z-index: 4;
  background: #f6faf9;
}

.daily-sales-store-table tbody tr:nth-child(even) td:nth-child(-n + 2),
.daily-sales-sku-table tbody tr:nth-child(even) td:nth-child(-n + 3) {
  background: #fbfdfd;
}

.daily-sales-store-table tbody tr:hover td:nth-child(-n + 2),
.daily-sales-sku-table tbody tr:hover td:nth-child(-n + 3) {
  background: #f0f7f5;
}

.daily-sales-store-table .daily-sales-summary-row td,
.daily-sales-sku-table .daily-sales-summary-row td {
  border-top: 1px solid rgba(27, 132, 106, 0.28);
  border-bottom: 2px solid rgba(27, 132, 106, 0.32);
  background: #edf7f4 !important;
  font-weight: 800;
}

.daily-sales-summary-row .summary-marker {
  display: inline-block;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  white-space: nowrap;
}

.daily-sales-summary-row .summary-filter-cell {
  overflow: visible;
  z-index: 7 !important;
}

.daily-sales-store-table .daily-sales-summary-row .summary-filter-cell:nth-child(3) {
  position: relative;
}

.summary-filter-selector {
  position: relative;
  width: 100%;
  min-width: 0;
}

.summary-filter-trigger {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 5px 7px;
  color: var(--text);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.summary-filter-trigger:hover,
.summary-filter-selector.is-open .summary-filter-trigger {
  border-color: rgba(27, 132, 106, 0.35);
  background: #fff;
}

.summary-filter-trigger > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-filter-chevron {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 15px;
  line-height: 1;
}

.summary-filter-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  left: 0;
  width: 230px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 12px 28px rgba(16, 37, 51, 0.18);
}

.summary-filter-search {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  font: inherit;
}

.summary-filter-options {
  display: grid;
  max-height: 230px;
  overflow-y: auto;
  margin-top: 7px;
  gap: 2px;
  overscroll-behavior: contain;
}

.summary-filter-option {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  padding: 6px 8px;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.summary-filter-option:hover,
.summary-filter-option.is-selected {
  background: #e7f4f0;
  color: var(--green);
  font-weight: 850;
}

.summary-filter-empty {
  padding: 12px 8px 6px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.daily-sales-summary-row .metric-change {
  font-weight: 850;
}

.return-metric .metric-with-change > span:first-child {
  color: var(--red);
  font-weight: 800;
}

.daily-sales-drill-row .table-link {
  font-weight: 850;
}

.metric-with-change {
  display: inline-flex;
  min-height: 34px;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
}

.metric-change {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.metric-change.is-up {
  color: #109b4d;
}

.metric-change.is-down {
  color: #ef3f32;
}

.metric-change.is-flat {
  color: #778694;
}

.kpi-card > .metric-change {
  margin-top: 6px;
}

.daily-sales-stock-tabs {
  flex-shrink: 0;
}

.daily-sales-stock-tabs .tab-button {
  min-width: 72px;
}

.daily-sales-stock-tabs .archive-tab:not(.is-active) {
  color: #7a8792;
  background: #f6f8f9;
}

.cpo-clickable-row {
  cursor: pointer;
}

.cpo-clickable-row:focus-visible td {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.table-sort-button:hover,
.table-sort-button.active {
  color: var(--accent);
}

.table-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.table-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.table-sort-arrow {
  color: currentColor;
  font-size: 12px;
  line-height: 1;
  opacity: 0.78;
}

tbody tr {
  background: #fff;
}

tbody tr:nth-child(even) {
  background: #fbfdfd;
}

tbody tr:hover {
  background: #f0f7f5;
}

td,
th {
  vertical-align: middle;
}

.status-tag,
.tag,
.sync-status-pill {
  border-radius: 999px;
  font-weight: 800;
}

.field span,
.field label {
  color: #526574;
  font-weight: 800;
}

.field input,
.field select {
  min-height: 40px;
  border-radius: 8px;
  background: #fff;
}

.project-choice {
  min-height: 124px;
  border-color: rgba(220, 228, 232, 0.96);
  background: linear-gradient(180deg, #fff, #f8fbfb);
  box-shadow: 0 12px 28px rgba(20, 33, 43, 0.06);
}

.project-choice:hover,
.project-choice:focus-visible {
  border-color: rgba(33, 132, 95, 0.45);
  box-shadow: 0 18px 38px rgba(15, 111, 159, 0.14);
}

.permission-panel {
  min-width: min(760px, 76vw);
  border: 1px solid #dce4e8;
  border-radius: 8px;
  background: #fbfdfd;
  padding: 12px;
}

.permission-actions {
  padding-bottom: 2px;
}

.permission-action {
  background: #fff;
}

.permission-group {
  background: #fff;
}

.permission-choice {
  border-color: #dce4e8;
  background: #f9fbfb;
}

.permission-choice:has(input:checked) {
  border-color: rgba(15, 111, 159, 0.34);
  background: #eaf5f7;
  color: #0a567e;
  font-weight: 800;
}

.modal-root {
  background: rgba(15, 28, 38, 0.44);
  backdrop-filter: blur(4px);
}

.modal {
  border-radius: 8px;
  box-shadow: 0 26px 90px rgba(15, 28, 38, 0.22);
}

.modal-header,
.modal-footer {
  background: #fbfdfd;
}

.toast {
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(20, 33, 43, 0.18);
}

@media (max-width: 760px) {
  .content {
    padding: 16px;
  }

  .topbar {
    min-height: auto;
  }

  .toolbar,
  .actionbar,
  .report-controls {
    padding: 12px;
  }

  .permission-panel {
    min-width: 0;
    width: 100%;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(17, 103, 177, 0.22);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.login-body {
  min-height: 100vh;
  background: #eef3f8;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.login-panel {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 32px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.login-heading {
  margin: 28px 0 24px;
}

.login-heading h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.15;
}

.login-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.project-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-choice {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 18px;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.project-choice:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(17, 103, 177, 0.14);
  transform: translateY(-1px);
}

.project-choice-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.project-choice.wb .project-choice-mark {
  width: auto;
  min-width: 88px;
  padding: 0 10px;
  background: #6f4eb3;
  font-size: 11px;
}

.project-choice strong,
.project-choice small {
  display: block;
}

.project-choice strong {
  font-size: 18px;
}

.project-choice small {
  margin-top: 5px;
  color: var(--muted);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.primary-nav {
  padding: 10px;
}

.nav-group {
  margin-bottom: 4px;
}

.nav-primary {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  text-align: left;
}

.nav-primary:hover,
.nav-primary.is-open {
  background: var(--surface-muted);
}

.nav-primary-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  display: grid;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--line-strong);
  color: transparent;
  font-size: 0;
}

.nav-primary.is-open .nav-icon {
  background: var(--accent);
}

.nav-primary-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.nav-chev {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
}

.nav-secondary {
  display: none;
  margin: 4px 0 8px 17px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.nav-group.is-open .nav-secondary {
  display: block;
}

.nav-secondary button {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  text-align: left;
}

.nav-secondary button:hover {
  background: #f0f4f8;
  color: var(--text);
}

.nav-secondary button.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 750;
  box-shadow: inset 3px 0 0 var(--accent);
}

.main-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(238, 242, 246, 0.94);
  padding: 10px 20px;
  backdrop-filter: blur(10px);
}

.breadcrumb {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

h1 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.15;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-sync-button {
  display: inline-flex;
  min-width: 96px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid #087f5b;
  border-radius: 7px;
  background: #087f5b;
  color: #fff;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.global-sync-button[hidden] {
  display: none;
}

.global-sync-button:hover {
  border-color: #066e4f;
  background: #066e4f;
}

.global-sync-button.is-running {
  border-color: #0b6aa2;
  background: #0b6aa2;
}

.global-sync-button:disabled {
  cursor: wait;
  opacity: 0.88;
}

.api-expiry-alert {
  min-height: 36px;
  border: 1px solid #d5a23d;
  border-radius: 7px;
  background: #fff8e8;
  color: #825a12;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.api-expiry-alert[hidden] {
  display: none;
}

.api-expiry-alert.is-expired {
  border-color: #d16a61;
  background: #fff0ee;
  color: #a73831;
}

.api-expiry-alert.is-unset {
  border-color: #aebbc1;
  background: #f5f8f9;
  color: #53666f;
}

.project-switch {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--accent);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.project-switch:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.global-search {
  display: flex;
  width: min(34vw, 360px);
  min-width: 230px;
  height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 12px;
  color: var(--muted);
}

.global-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.icon-button,
.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
}

.icon-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.avatar {
  background: #1b2b38;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.content {
  padding: 18px 20px 28px;
}

.page-stack {
  display: grid;
  gap: 14px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.kpi-card {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 1px 0 rgba(21, 32, 43, 0.03);
}

.kpi-card.is-warning {
  border-color: rgba(182, 120, 0, 0.25);
  background: linear-gradient(180deg, #fff, #fffdf7);
}

.kpi-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.kpi-value {
  margin-top: 9px;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 850;
  line-height: 1.05;
}

.kpi-trend {
  margin-top: 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.kpi-subtrend {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.kpi-trend.is-warning {
  color: var(--amber);
}

.toolbar,
.tabbar,
.actionbar,
.form-grid,
.report-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar,
.actionbar,
.report-controls {
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.toolbar > .button,
.actionbar > .button,
.report-controls > .button {
  align-self: end;
}

.toolbar-spacer {
  flex: 1 1 auto;
}

.field {
  display: grid;
  min-width: 154px;
  gap: 5px;
}

.field.wide {
  min-width: 230px;
}

.date-range-field {
  min-width: 315px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select {
  height: 36px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  outline: 0;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 103, 177, 0.12);
}

.date-range-control {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr);
  align-items: center;
  gap: 6px;
}

.date-range-shell {
  display: grid;
  gap: 8px;
}

.date-range-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.date-preset-button {
  min-height: 28px;
  border: 1px solid rgba(17, 103, 177, 0.18);
  border-radius: 999px;
  background: rgba(17, 103, 177, 0.08);
  color: #0f5f78;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.date-preset-button:hover {
  border-color: rgba(17, 103, 177, 0.36);
  background: rgba(17, 103, 177, 0.14);
}

.date-range-control span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.date-range-control input {
  width: 100%;
}

.button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 13px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.primary {
  box-shadow: 0 6px 14px rgba(17, 103, 177, 0.14);
}

.button.danger {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.button.danger:hover {
  border-color: #a92c2c;
  background: #a92c2c;
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}

.tabbar {
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.tab-button {
  min-height: 38px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 16px;
  font-weight: 750;
}

.tab-button.is-active {
  border-bottom-color: var(--accent);
  color: var(--accent-strong);
}

.data-area {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(21, 32, 43, 0.03);
}

.sync-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  box-shadow: 0 1px 0 rgba(21, 32, 43, 0.03);
}

.sync-panel.done {
  grid-template-columns: 1fr;
}

.sync-panel.done .progress-track,
.sync-panel.done .sync-steps,
.sync-panel.done .sync-log {
  display: none;
}

.sync-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sync-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sync-status-pill,
.row-count-pill {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 750;
}

.sync-status-pill.running {
  border-color: rgba(17, 103, 177, 0.24);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.sync-status-pill.done {
  border-color: rgba(25, 135, 84, 0.24);
  background: var(--green-soft);
  color: var(--green);
}

.sync-status-pill.failed,
.sync-status-pill.cancelled {
  border-color: rgba(199, 55, 55, 0.22);
  background: var(--red-soft);
  color: var(--red);
}

.sync-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e8eef4;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transition: width 0.25s ease;
}

.sync-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 220px));
  gap: 8px;
}

.sync-step {
  display: grid;
  min-height: 54px;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

.sync-step-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sync-step-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-step-problems {
  display: grid;
  gap: 4px;
  color: var(--red);
  font-size: 11px;
  line-height: 1.35;
}

.sync-step-problems div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-step strong {
  color: inherit;
  font-weight: 850;
}

.sync-step.running {
  border-color: var(--accent);
  background: #f4f9fd;
  color: var(--accent-strong);
}

.sync-step.done {
  border-color: var(--green);
  background: #f7fcfa;
  color: var(--green);
}

.sync-step.failed,
.sync-step.cancelled {
  border-color: var(--red);
  background: #fff8f8;
  color: var(--red);
}

.sync-log {
  display: grid;
  max-height: 78px;
  overflow: auto;
  gap: 5px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sync-log-row.warning,
.sync-log-row.error {
  color: var(--red);
}

.data-area-header {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}

.data-title {
  font-size: 15px;
  font-weight: 850;
}

.data-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  max-height: calc(100vh - 268px);
  min-height: 260px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

thead th {
  position: sticky;
  z-index: 2;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: #f7fafc;
  color: #425164;
  font-weight: 800;
  text-align: left;
}

th,
td {
  min-height: 44px;
  border-bottom: 1px solid #edf1f5;
  padding: 9px 11px;
  vertical-align: middle;
  white-space: nowrap;
}

tbody tr:hover {
  background: #fbfdff;
}

.select-cell {
  width: 44px;
}

.product-cell {
  display: flex;
  min-width: 220px;
  align-items: center;
  gap: 10px;
}

.thumb {
  display: grid;
  overflow: hidden;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(17, 103, 177, 0.12), rgba(25, 135, 84, 0.15)),
    #fff;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.profit-sku-cell .muted {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identifier-stack {
  display: grid;
  min-width: 150px;
  gap: 3px;
}

.identifier-stack strong {
  color: var(--text);
  font-size: 12px;
}

.identifier-stack small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.identifier-copy-line {
  position: relative;
  display: flex;
  min-height: 18px;
  align-items: center;
  padding-right: 38px;
}

.identifier-copy-line strong,
.identifier-copy-line small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identifier-copy-button {
  position: absolute;
  right: 0;
  width: 34px;
  height: 20px;
  border: 1px solid #c9d8de;
  border-radius: 5px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  opacity: 0;
  padding: 0;
  transition: opacity 120ms ease, border-color 120ms ease, background 120ms ease;
}

.identifier-copy-line:hover .identifier-copy-button,
.identifier-copy-button:focus-visible {
  opacity: 1;
}

.identifier-copy-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.sku-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
}

.sku-preview img {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 7px;
  object-fit: cover;
}

.muted {
  color: var(--muted);
}

.empty-table {
  display: grid;
  min-height: 96px;
  place-items: center;
  color: var(--muted);
}

.money {
  color: var(--accent-strong);
  font-weight: 850;
}

.money-dual {
  display: inline-flex;
  min-width: 94px;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.money-dual small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.cost-pair {
  display: grid;
  gap: 7px;
  min-width: 170px;
}

.cost-pair > div {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.cost-label {
  min-width: 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.rule-cell {
  min-width: 310px;
  max-width: 520px;
  white-space: normal;
}

.rule-cell .muted {
  line-height: 1.45;
}

.negative {
  color: var(--red);
}

.tag {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 750;
}

.tag.green {
  background: var(--green-soft);
  color: var(--green);
}

.tag.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.red {
  background: var(--red-soft);
  color: var(--red);
}

.tag.blue {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tag.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.pagination-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 8px 12px;
  backdrop-filter: blur(8px);
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  min-width: 360px;
}

.permission-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.permission-choice input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.store-scope-field {
  grid-column: 1 / -1;
}

.store-scope-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfd;
  padding: 10px;
}

.store-scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.store-scope-choice {
  min-width: 0;
  white-space: normal;
}

.store-scope-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.permission-panel {
  display: grid;
  min-width: min(720px, 74vw);
  gap: 10px;
}

.permission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-action {
  min-height: 30px;
  border: 1px solid rgba(17, 103, 177, 0.18);
  border-radius: 7px;
  background: #f7fbff;
  color: var(--accent);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.permission-action:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.permission-groups {
  display: grid;
  gap: 10px;
}

.permission-group {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}

.permission-group-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.mini-select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  align-items: start;
  gap: 16px;
}

.chart-panel,
.side-panel,
.plain-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
}

.panel-title {
  font-weight: 850;
}

.bar-chart {
  display: grid;
  min-height: 220px;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 12px;
  padding: 22px 20px;
}

.bar-item {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.bar {
  width: 100%;
  max-width: 46px;
  min-height: 24px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #2c7fbf, #198754);
}

.bar-label {
  color: var(--muted);
  font-size: 12px;
}

.operations-dashboard {
  gap: 12px;
}

.ops-control-band {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f8fbfc;
  padding: 12px 14px;
}

.ops-period-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.ops-period-copy strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.ops-period-copy span,
.ops-panel-header span {
  color: var(--muted);
  font-size: 12px;
}

.ops-controls {
  display: flex;
  align-items: end;
  gap: 12px;
}

.ops-store-select {
  display: grid;
  min-width: 158px;
  gap: 4px;
}

.ops-store-select > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ops-store-select select {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 30px 0 10px;
  color: var(--text);
  font: inherit;
}

.ops-range-control {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}

.ops-range-control button {
  min-width: 66px;
  height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ops-range-control button:last-child {
  border-right: 0;
}

.ops-range-control button:hover {
  background: #f2f7f8;
  color: var(--text);
}

.ops-range-control button.is-active {
  background: var(--accent);
  color: #fff;
}

.ops-refreshing {
  border-left: 3px solid var(--accent);
  background: #eef7fa;
  padding: 8px 10px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.operations-dashboard .kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.operations-dashboard .kpi-card {
  min-height: 112px;
  border-left-width: 4px;
  box-shadow: 0 4px 14px rgba(20, 33, 43, 0.05);
}

.operations-dashboard .kpi-card.tone-sales {
  border-left-color: #1672a5;
  background: #f4f9fc;
}

.operations-dashboard .kpi-card.tone-orders {
  border-left-color: #21845f;
  background: #f3faf7;
}

.operations-dashboard .kpi-card.tone-ads {
  border-left-color: #b7791f;
  background: #fff9ef;
}

.operations-dashboard .kpi-card.tone-returns {
  border-left-color: #c5544d;
  background: #fff6f5;
}

.operations-dashboard .kpi-card.tone-after-sales {
  border-left-color: #a04d7b;
  background: #fff7fb;
}

.operations-dashboard .kpi-card.tone-stock {
  border-left-color: #147f83;
  background: #f2fafa;
}

.operations-dashboard .kpi-card.tone-action {
  grid-column: span 2;
  border-left-color: #5367a5;
  background: #f5f7fc;
}

.ops-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(20, 33, 43, 0.05);
}

.ops-panel-header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}

.ops-panel-header > div:first-child {
  display: grid;
  gap: 3px;
}

.ops-panel-header strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.ops-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ops-legend span::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 2px;
  content: "";
}

.ops-legend .is-sales::before { background: #1672a5; }
.ops-legend .is-orders::before { background: #21845f; }
.ops-legend .is-ads::before { border-radius: 50%; background: #d18a1d; }

.ops-trend-scroll {
  overflow-x: auto;
  padding: 14px 14px 10px;
}

.ops-trend-chart {
  display: grid;
  min-width: max(100%, calc(var(--ops-day-count) * 34px));
  height: 250px;
  grid-template-columns: repeat(var(--ops-day-count), minmax(24px, 1fr));
  align-items: end;
  gap: 7px;
}

.ops-trend-day {
  display: grid;
  min-width: 0;
  height: 100%;
  grid-template-rows: 20px 1fr 20px;
  gap: 4px;
  align-items: end;
  text-align: center;
}

.ops-day-order {
  overflow: hidden;
  color: #21845f;
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-bar-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-bottom: 1px solid #dbe6eb;
  background: repeating-linear-gradient(to top, transparent 0, transparent 44px, #eef3f5 45px);
}

.ops-sales-bar {
  position: absolute;
  right: 18%;
  bottom: 0;
  left: 18%;
  min-height: 4px;
  border-radius: 4px 4px 1px 1px;
  background: #1672a5;
}

.ops-ad-dot {
  position: absolute;
  left: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, 50%);
  border: 2px solid #fff;
  border-radius: 50%;
  background: #d18a1d;
  box-shadow: 0 0 0 1px rgba(183, 121, 31, 0.35);
}

.ops-day-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: clip;
  white-space: nowrap;
}

.ops-two-column {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  align-items: start;
  gap: 12px;
}

.ops-table-wrap {
  max-height: 420px;
  overflow: auto;
}

.ops-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.ops-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #f5f8f9;
  color: var(--muted);
  font-weight: 850;
  white-space: nowrap;
}

.ops-table th,
.ops-table td {
  border-bottom: 1px solid #edf1f3;
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}

.ops-table tbody tr:hover td {
  background: #f8fbfb;
}

.ops-table td > strong,
.ops-table td > small {
  display: block;
}

.ops-table td > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.ops-rate-pair {
  display: grid;
  gap: 3px;
}

.ops-rate-pair > small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.ops-sku-identity {
  display: grid;
  min-width: 150px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.ops-sku-identity > img,
.ops-sku-identity > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f3f7f8;
  object-fit: cover;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.ops-sku-identity > div {
  min-width: 0;
}

.ops-sku-identity strong,
.ops-sku-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-sku-identity small {
  max-width: 190px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.ops-signal-list {
  display: flex;
  min-width: 120px;
  flex-wrap: wrap;
  gap: 4px;
}

.ops-status-cell {
  display: grid;
  min-width: 132px;
  gap: 4px;
}

.ops-status-cell > small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.ops-signal {
  border-radius: 5px;
  padding: 3px 5px;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.ops-signal.is-danger { background: #fdeceb; color: #ac3f39; }
.ops-signal.is-warning { background: #fff1d9; color: #966014; }
.ops-signal.is-info { background: #e9f3fa; color: #17678f; }
.ops-signal.is-ok { background: #e8f5ef; color: #21845f; }
.ops-signal.is-muted { background: #eef2f4; color: #687984; }

.ops-empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.ops-status-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(20, 33, 43, 0.05);
}

.ops-status-sync {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.ops-status-sync strong {
  color: var(--text);
  font-size: 12px;
}

.ops-status-groups {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  background: #f9fbfc;
}

.ops-status-group {
  --status-accent: #82929e;
  --status-surface: #f7f9fa;
  display: flex;
  min-width: 0;
  min-height: 190px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 3px solid transparent;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.ops-status-group:nth-child(-n + 3) {
  grid-column: span 2;
}

.ops-status-group:nth-child(n + 4) {
  grid-column: span 3;
}

.ops-status-group-head {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--status-surface);
}

.ops-status-group-title,
.ops-status-group-total {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.ops-status-group-title > strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.ops-status-group-title > span,
.ops-status-group-total > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.ops-status-group-total {
  flex: 0 0 auto;
  text-align: right;
}

.ops-status-group-total > strong {
  color: var(--text);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.ops-status-group.is-pending { --status-accent: #d18a1d; --status-surface: #fffaf1; border-top-color: var(--status-accent); }
.ops-status-group.is-shipping { --status-accent: #1672a5; --status-surface: #f4f9fc; border-top-color: var(--status-accent); }
.ops-status-group.is-completed { --status-accent: #21845f; --status-surface: #f3faf7; border-top-color: var(--status-accent); }
.ops-status-group.is-cancelled { --status-accent: #c5544d; --status-surface: #fff6f5; border-top-color: var(--status-accent); }
.ops-status-group.is-return { --status-accent: #82628d; --status-surface: #faf6fb; border-top-color: var(--status-accent); }

.ops-status-group-list {
  display: grid;
  flex: 1;
  align-content: start;
  padding: 4px 12px;
}

.ops-status-group-row {
  display: grid;
  min-width: 0;
  min-height: 42px;
  grid-template-columns: 8px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #edf1f3;
  padding: 6px 2px;
}

.ops-status-group-row:last-child {
  border-bottom: 0;
}

.ops-status-group-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-status-group-row b {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.ops-status-group-row small {
  min-width: 70px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.ops-status-group-empty {
  display: grid;
  min-height: 54px;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.ops-status-group-check {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 9px 14px;
  background: var(--status-surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.ops-status-group-check strong {
  color: var(--status-accent);
  font-size: 13px;
  font-weight: 900;
}

.ops-status-group-check small {
  color: var(--muted);
  font-size: 10px;
}

.ops-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-accent);
}

.status-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.status-row {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf1f5;
  padding-bottom: 10px;
}

.status-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 0.58fr);
  gap: 16px;
}

.form-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.form-panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.form-grid .field {
  min-width: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.auth-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-name {
  font-weight: 850;
}

.auth-section {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.auth-section-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.auth-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.danger-note {
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.45;
}

.ozon-auth-page {
  gap: 14px;
}

.auth-overview-band {
  display: flex;
  min-height: 86px;
  align-items: center;
  gap: 22px;
  border: 1px solid #d9e5e8;
  border-radius: 8px;
  background: #fff;
  padding: 14px 18px;
}

.auth-overview-copy {
  display: grid;
  min-width: 180px;
  gap: 4px;
}

.auth-overview-copy strong {
  color: #142630;
  font-size: 18px;
}

.auth-overview-copy span,
.auth-directory-head span {
  color: #74848d;
  font-size: 12px;
}

.auth-overview-metrics {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(5, minmax(78px, 1fr));
  border-right: 1px solid #e1e9ec;
  border-left: 1px solid #e1e9ec;
}

.auth-overview-metrics > div {
  display: grid;
  min-height: 48px;
  align-content: center;
  gap: 3px;
  padding: 0 18px;
}

.auth-overview-metrics > div + div {
  border-left: 1px solid #edf1f3;
}

.auth-overview-metrics span {
  color: #6d7e87;
  font-size: 11px;
}

.auth-overview-metrics strong {
  color: #17303b;
  font-size: 22px;
}

.auth-overview-metrics .has-warning strong {
  color: #b64a3f;
}

.auth-directory {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d9e5e8;
  border-radius: 8px;
  background: #fff;
}

.auth-directory-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
}

.auth-directory-head > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.auth-directory-head strong {
  color: #172a34;
  font-size: 16px;
}

.auth-store-columns,
.auth-store-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(130px, 0.75fr) minmax(220px, 1.2fr) minmax(150px, 0.8fr) 96px;
  align-items: center;
  gap: 16px;
}

.auth-store-columns {
  min-height: 38px;
  border-top: 1px solid #e3ebee;
  border-bottom: 1px solid #e3ebee;
  background: #f4f8f9;
  padding: 0 18px;
  color: #6e7f87;
  font-size: 11px;
  font-weight: 800;
}

.auth-store-row {
  min-height: 78px;
  padding: 10px 18px;
}

.auth-store-row + .auth-store-row {
  border-top: 1px solid #edf2f4;
}

.auth-store-row:hover {
  background: #f8fbfc;
}

.auth-store-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.auth-store-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 8px;
  background: #e6f2f0;
  color: #16725e;
  font-size: 16px;
  font-weight: 900;
}

.auth-store-identity > div,
.auth-credential-state,
.auth-store-updated,
.auth-expiry-summary {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.auth-store-identity strong,
.auth-credential-state strong,
.auth-store-updated strong {
  overflow: hidden;
  color: #172b35;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-store-identity small,
.auth-credential-state small,
.auth-store-updated small,
.auth-sync-state small {
  color: #7a8a92;
  font-size: 10px;
}

.auth-credential-state.is-ready strong {
  color: #197057;
}

.auth-credential-state.is-missing strong {
  color: #b64a3f;
}

.auth-expiry-summary {
  gap: 5px;
}

.auth-expiry-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 8px;
  border-left: 3px solid #b8c5cb;
  border-radius: 5px;
  background: #f5f8f9;
  padding: 6px 8px;
}

.auth-expiry-line span,
.auth-expiry-line small {
  color: #75858d;
  font-size: 10px;
}

.auth-expiry-line strong {
  color: #53656e;
  font-size: 11px;
  white-space: nowrap;
}

.auth-expiry-line small {
  grid-column: 1 / -1;
  line-height: 1.35;
}

.auth-expiry-summary .auth-expiry-line {
  background: transparent;
  padding: 2px 0 2px 7px;
}

.auth-expiry-summary .auth-expiry-line small {
  display: none;
}

.auth-expiry-line.is-healthy { border-left-color: #2c8b70; background: #f1f9f5; }
.auth-expiry-line.is-healthy strong { color: #20725b; }
.auth-expiry-line.is-warning { border-left-color: #d39a2f; background: #fff8e9; }
.auth-expiry-line.is-warning strong { color: #8c6216; }
.auth-expiry-line.is-expired { border-left-color: #cb5046; background: #fff1ef; }
.auth-expiry-line.is-expired strong { color: #ad3f36; }
.auth-expiry-line.is-unset { border-left-color: #8b9ba3; }

.auth-expiry-note {
  border: 1px solid #d7e6e7;
  border-radius: 7px;
  background: #f3f8f8;
  color: #5f737c;
  padding: 9px 11px;
  font-size: 11px;
  line-height: 1.5;
}

.auth-sync-state {
  display: grid;
  gap: 8px;
}

.auth-sync-state > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-sync-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid #d6e0e4;
  border-radius: 6px;
  background: #f3f6f7;
  color: #60727b;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.auth-sync-badge.is-running { border-color: #b9d8e8; background: #edf7fb; color: #176d97; }
.auth-sync-badge.is-success { border-color: #b9dece; background: #eff9f4; color: #187054; }
.auth-sync-badge.is-waiting { border-color: #e7d3a8; background: #fff9ec; color: #8b6419; }
.auth-sync-badge.is-warning { border-color: #ebc0ba; background: #fff2f0; color: #ad4136; }

.auth-sync-progress,
.auth-initial-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 4px;
  background: #e6edef;
}

.auth-sync-progress span,
.auth-initial-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #27846d;
}

.auth-view-button {
  width: 88px;
  justify-self: end;
}

.modal.auth-detail-modal {
  width: min(940px, 100%);
}

.auth-detail-modal .modal-header,
.auth-detail-modal .modal-footer {
  position: sticky;
  z-index: 2;
  background: #fff;
}

.auth-detail-modal .modal-header {
  top: 0;
}

.auth-detail-modal .modal-footer {
  bottom: 0;
}

.auth-detail-body {
  display: grid;
  gap: 14px;
}

.auth-initial-sync {
  display: grid;
  gap: 12px;
  border: 1px solid #d8e5e8;
  border-left: 4px solid #7c929b;
  border-radius: 8px;
  background: #f8fbfc;
  padding: 14px;
}

.auth-initial-sync.is-running { border-left-color: #2c83ad; }
.auth-initial-sync.is-success { border-left-color: #27846d; }
.auth-initial-sync.is-waiting { border-left-color: #c79534; }
.auth-initial-sync.is-warning { border-left-color: #c75145; }

.auth-initial-sync-head,
.auth-initial-actions,
.auth-pending-types,
.auth-key-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-initial-sync-head > div {
  display: grid;
  gap: 3px;
}

.auth-initial-sync-head span,
.auth-initial-metrics span,
.auth-pending-types span,
.auth-key-state span {
  color: #74858e;
  font-size: 10px;
}

.auth-initial-sync-head strong {
  color: #172b35;
  font-size: 16px;
}

.auth-initial-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #e2eaed;
  border-bottom: 1px solid #e2eaed;
}

.auth-initial-metrics > div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
}

.auth-initial-metrics > div + div {
  border-left: 1px solid #e2eaed;
}

.auth-initial-metrics strong,
.auth-pending-types strong,
.auth-key-state strong {
  color: #203640;
  font-size: 12px;
}

.auth-pending-types {
  justify-content: flex-start;
}

.auth-sync-message {
  color: #65767f;
  font-size: 11px;
  line-height: 1.5;
}

.auth-initial-actions {
  justify-content: flex-end;
}

.auth-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-key-state {
  margin-top: auto;
  border-top: 1px solid #dce6e9;
  padding-top: 10px;
}

.auth-detail-footer .toolbar-spacer {
  flex: 1;
}

@media (max-width: 900px) {
  .auth-overview-band {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .auth-overview-metrics {
    min-width: 100%;
    order: 3;
    border: 1px solid #e1e9ec;
  }

  .auth-overview-band > .button {
    margin-left: auto;
  }

  .auth-store-columns {
    display: none;
  }

  .auth-store-row {
    grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) 96px;
  }

  .auth-credential-state,
  .auth-store-updated {
    display: none;
  }

  .auth-store-identity { grid-column: 1; grid-row: 1; }
  .auth-expiry-summary { grid-column: 2; grid-row: 1; }
  .auth-view-button { grid-column: 3; grid-row: 1; }
  .auth-sync-state { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 620px) {
  .auth-overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-overview-metrics > div:nth-child(n + 3) {
    border-top: 1px solid #edf1f3;
  }

  .auth-overview-metrics > div:nth-child(odd) {
    border-left: 0;
  }

  .auth-overview-metrics > div:nth-child(5) {
    grid-column: 1 / -1;
  }

  .auth-store-row {
    grid-template-columns: minmax(0, 1fr) 88px;
  }

  .auth-sync-state {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .auth-expiry-summary {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-view-button {
    grid-column: 2;
    grid-row: 1;
  }

  .auth-detail-grid,
  .auth-initial-metrics {
    grid-template-columns: 1fr;
  }

  .auth-initial-metrics > div + div {
    border-top: 1px solid #e2eaed;
    border-left: 0;
  }
}

.delete-summary {
  display: grid;
  gap: 8px;
  border: 1px solid var(--red-soft);
  border-radius: 8px;
  background: #fff7f7;
  padding: 14px;
  line-height: 1.6;
}

.delete-summary strong {
  color: var(--red);
  font-size: 18px;
}

.placeholder {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.placeholder strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 18px;
}

.modal-root {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(13, 24, 33, 0.38);
  padding: 20px;
}

.modal-root.is-open {
  display: flex;
}

.modal {
  width: min(680px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal.sku-modal {
  width: min(980px, 100%);
}

.modal.ad-campaign-detail-modal {
  width: min(1240px, 100%);
}

.campaign-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.campaign-detail-meta span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: var(--surface-soft);
  color: var(--muted);
  white-space: nowrap;
}

.campaign-product-table {
  max-height: 58vh;
  overflow: auto;
  overscroll-behavior: contain;
}

.campaign-product-table thead th {
  position: sticky;
  z-index: 1;
  top: 0;
}

.cpo-campaign-detail-modal .campaign-product-table table {
  min-width: 760px;
  table-layout: fixed;
}

.cpo-campaign-detail-modal .campaign-product-table th:nth-child(1) {
  width: 190px;
}

.cpo-campaign-detail-modal .campaign-product-table th:nth-child(2) {
  width: 90px;
}

.cpo-campaign-detail-modal .campaign-product-table th:nth-child(3) {
  width: 130px;
}

.cpo-campaign-detail-modal .campaign-product-table th:nth-child(4),
.cpo-campaign-detail-modal .campaign-product-table th:nth-child(6) {
  width: 120px;
}

.cpo-campaign-detail-modal .campaign-product-table th:nth-child(5) {
  width: 90px;
}

.cpo-campaign-detail-modal .campaign-product-table .identifier-stack {
  white-space: normal;
}

.cpo-selected-detail-modal .campaign-product-table table {
  min-width: 880px;
}

.cpo-selected-detail-modal .campaign-product-table th:nth-child(1) {
  width: 190px;
}

.cpo-selected-detail-modal .campaign-product-table th:nth-child(2),
.cpo-selected-detail-modal .campaign-product-table th:nth-child(3),
.cpo-selected-detail-modal .campaign-product-table th:nth-child(6) {
  width: 95px;
}

.cpo-selected-detail-modal .campaign-product-table th:nth-child(4),
.cpo-selected-detail-modal .campaign-product-table th:nth-child(5),
.cpo-selected-detail-modal .campaign-product-table th:nth-child(7) {
  width: 125px;
}

.cpo-products-summary-row td {
  border-bottom: 2px solid rgba(15, 111, 159, 0.24);
  background: #eaf5f7;
  color: var(--accent-strong);
}

.cpo-products-summary-row .muted {
  margin-top: 3px;
  color: var(--muted);
}

.archived-product-badge {
  display: inline-flex;
  margin-top: 6px;
  border-color: #cfd8de;
  background: #f1f4f6;
  color: #647384;
}

.cpo-source-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.cpo-source-group {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}

.cpo-source-group + .cpo-source-group {
  border-left: 1px solid var(--line);
}

.cpo-source-group > div:not(.cpo-source-title) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cpo-source-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cpo-source-group span {
  color: var(--muted);
}

@media (max-width: 760px) {
  .cpo-source-breakdown {
    grid-template-columns: 1fr;
  }

  .cpo-source-group + .cpo-source-group {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

.campaign-detail-note {
  margin-top: 12px;
}

.modal-header,
.modal-footer {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-title {
  font-weight: 850;
}

.modal-body {
  padding: 14px;
}

.form-error {
  min-height: 1.2rem;
  margin-bottom: 0.75rem;
  color: var(--red);
  font-size: 13px;
}

.modal-section {
  display: grid;
  gap: 12px;
}

.modal-section + .modal-section {
  margin-top: 18px;
}

.modal-section-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
}

.finance-grid .field label,
.finance-grid .field span {
  color: #5f6f86;
  font-size: 15px;
}

.finance-grid input {
  height: 42px;
  font-size: 15px;
}

.finance-note {
  border: 1px solid var(--accent-soft);
  border-radius: 8px;
  background: #f5f9fd;
  color: #425164;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.finance-cost-groups {
  display: grid;
}

.finance-cost-group {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px 0 4px;
}

.finance-cost-group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.finance-cost-group-title::before {
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: #c57a18;
  content: "";
}

.finance-cost-group-title small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.finance-cost-group.is-platform .finance-cost-group-title::before {
  background: #1167b1;
}

.finance-cost-group.is-sales .finance-cost-group-title::before {
  background: #198754;
}

.finance-cost-group.is-tax .finance-cost-group-title::before {
  background: #bd3f4b;
}

.finance-auto-cost {
  display: grid;
  min-height: 42px;
  align-content: center;
  gap: 3px;
  border-left: 3px solid #198754;
  background: #f3faf6;
  padding: 6px 10px;
}

.finance-auto-cost span {
  color: #496257;
  font-size: 12px;
  font-weight: 750;
}

.finance-auto-cost strong {
  color: #16683f;
  font-size: 13px;
}

.commission-rate-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.commission-rate-cell small {
  border: 1px solid #b9d4e8;
  border-radius: 4px;
  background: #f3f8fc;
  color: #225f88;
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 800;
}

.rate-field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.manual-rate-alert {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #c43d32;
  color: #fff;
  cursor: help;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.manual-rate-alert.is-above {
  background: #188556;
}

.manual-rate-alert.is-below {
  background: #c43d32;
}

.field.is-manual-rate input {
  border-color: #d88982;
  background: #fff8f7;
}

.after-sales-benchmark,
.ad-rate-benchmark {
  display: grid;
  grid-column: 1 / -1;
  gap: 5px;
  border: 1px solid #b8dfcb;
  border-left: 4px solid #198754;
  border-radius: 7px;
  background: #f3faf6;
  padding: 9px 11px;
}

.after-sales-benchmark > div,
.ad-rate-benchmark > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.after-sales-benchmark span,
.after-sales-benchmark small,
.ad-rate-benchmark span,
.ad-rate-benchmark small {
  color: #496257;
  font-size: 12px;
  font-weight: 750;
}

.after-sales-benchmark strong,
.ad-rate-benchmark strong {
  color: #16683f;
  font-size: 18px;
}

.after-sales-benchmark.is-warning,
.ad-rate-benchmark.is-warning {
  border-color: #f0c9a5;
  border-left-color: #c96f1d;
  background: #fff8f0;
}

.after-sales-benchmark.is-warning strong,
.after-sales-benchmark.is-warning small,
.ad-rate-benchmark.is-warning strong,
.ad-rate-benchmark.is-warning small {
  color: #9a4d0c;
}

.after-sales-benchmark.is-review,
.ad-rate-benchmark.is-review {
  border-color: #bfd4e8;
  border-left-color: #3779aa;
  background: #f4f8fc;
}

.after-sales-benchmark.is-neutral,
.ad-rate-benchmark.is-neutral {
  border-color: var(--line);
  border-left-color: var(--muted);
  background: #f7f9fa;
}

.ad-rate-benchmark {
  border-color: #b9d4e8;
  border-left-color: #2878ad;
  background: #f3f8fc;
}

.ad-rate-benchmark strong,
.ad-rate-benchmark span,
.ad-rate-benchmark small {
  color: #225f88;
}

.ad-rate-benchmark.is-warning {
  border-color: #f0c9a5;
  border-left-color: #c96f1d;
  background: #fff8f0;
}

.ad-rate-benchmark.is-warning strong,
.ad-rate-benchmark.is-warning span,
.ad-rate-benchmark.is-warning small {
  color: #9a4d0c;
}

.ad-rate-benchmark.is-review {
  border-color: #bfd4e8;
  border-left-color: #3779aa;
  background: #f4f8fc;
}

.ad-rate-benchmark.is-neutral {
  border-color: var(--line);
  border-left-color: var(--muted);
  background: #f7f9fa;
}

.cost-header {
  display: inline-block;
  border-left: 3px solid currentColor;
  padding-left: 7px;
}

.cost-header.is-platform {
  color: #1167b1;
}

.cost-header.is-sales {
  color: #198754;
}

.money-with-source {
  display: grid;
  gap: 2px;
}

.money-with-source small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.profit-source {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}

.profit-source.is-estimate {
  border-color: #d7a45a;
  background: #fff8ec;
  color: #8b570c;
}

.profit-source.is-api {
  border-color: #8dc9aa;
  background: #eff9f3;
  color: #17663f;
}

.profit-orders-controls {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 12px;
  border-bottom: 1px solid #dbe5e4;
  padding-bottom: 14px;
}

.profit-orders-page,
.profit-orders-table,
.profit-orders-table .data-area,
.profit-orders-table .table-wrap,
.profit-comparison-summary {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.profit-orders-control-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profit-orders-tabs {
  width: max-content;
  border: 1px solid #dbe5e4;
  border-radius: 7px;
  background: #eef4f3;
  padding: 4px;
}

.profit-orders-tabs .tab-button {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  padding: 0 18px;
  color: #5c6d78;
}

.profit-orders-tabs .tab-button.is-active {
  border: 0;
  background: #fff;
  box-shadow: 0 2px 7px rgba(20, 33, 43, 0.1);
  color: #1167b1;
}

.profit-orders-filterbar {
  display: grid;
  grid-template-columns: minmax(140px, 170px) minmax(330px, 1fr) auto;
  align-items: start;
  border: 0;
  background: transparent;
  padding: 0;
}

.profit-orders-filterbar .field {
  min-width: 140px;
}

.profit-orders-filterbar .date-range-field {
  min-width: 0;
}

.profit-orders-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 17px;
}

.profit-orders-table table {
  min-width: 1120px;
}

.profit-orders-table .table-wrap {
  min-height: 300px;
  max-height: calc(100vh - 390px);
}

.profit-stacked-cost {
  min-width: 154px;
}

.profit-stacked-cost > span {
  display: grid;
  grid-template-columns: minmax(48px, 1fr) auto auto;
  align-items: baseline;
  gap: 7px;
  padding: 2px 0;
  white-space: nowrap;
}

.profit-stacked-cost > span + span {
  border-top: 1px dashed #dfe8e7;
}

.profit-stacked-cost small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.profit-stacked-cost strong {
  color: #263b45;
  font-size: 12px;
}

.profit-stacked-cost em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}

.profit-credit {
  color: #177148;
  font-weight: 800;
}

.profit-cost-band-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profit-difference-reasons {
  display: grid;
  min-width: 148px;
  gap: 4px;
}

.profit-difference-reason {
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.profit-difference-reason.is-better { color: #157347; }
.profit-difference-reason.is-worse { color: var(--red); }
.profit-difference-reason.is-even { color: var(--muted); }

.profit-difference {
  font-weight: 850;
}

.profit-difference.is-better {
  color: #157347;
}

.profit-difference.is-worse {
  color: var(--red);
}

.profit-difference.is-even {
  color: var(--muted);
}

.profit-comparison-summary {
  display: grid;
  overflow: hidden;
  grid-template-columns: 0.9fr repeat(3, minmax(0, 1fr));
  border: 1px solid #dbe5e4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 33, 43, 0.05);
}

.comparison-summary-item {
  position: relative;
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 6px;
  padding: 18px 20px;
}

.comparison-summary-item + .comparison-summary-item {
  border-left: 1px solid #e5eceb;
}

.comparison-summary-item::before {
  position: absolute;
  top: 0;
  right: 20px;
  left: 20px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: #aab9bf;
  content: "";
}

.comparison-summary-item.is-estimate::before {
  background: #d79a3b;
}

.comparison-summary-item.is-sales::before {
  background: #1167b1;
}

.comparison-summary-item.is-real::before,
.comparison-summary-item.is-difference.is-better::before {
  background: #238a61;
}

.comparison-summary-item.is-difference.is-worse::before {
  background: #c84b46;
}

.comparison-summary-item > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.comparison-summary-item > strong {
  overflow-wrap: anywhere;
  color: #172834;
  font-size: 23px;
  line-height: 1.1;
}

.comparison-summary-item.is-difference.is-better > strong {
  color: #157347;
}

.comparison-summary-item.is-difference.is-worse > strong {
  color: var(--red);
}

.comparison-summary-item > small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.profit-comparison-table table {
  min-width: 1060px;
}

.difference-result {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.difference-result.is-better {
  border-color: #8dc9aa;
  background: #eff9f3;
  color: #17663f;
}

.difference-result.is-worse {
  border-color: #e8aaa7;
  background: #fff3f2;
  color: #a63631;
}

.difference-result.is-even {
  background: var(--surface-soft);
  color: var(--muted);
}

@media (max-width: 760px) {
  .profit-orders-control-top {
    align-items: stretch;
    flex-direction: column;
  }

  .profit-orders-tabs {
    width: 100%;
  }

  .profit-orders-tabs .tab-button {
    min-width: 0;
    flex: 1 1 0;
    padding: 0 8px;
  }

  .profit-orders-filterbar {
    grid-template-columns: 1fr;
  }

  .profit-orders-filterbar .field,
  .profit-orders-filterbar .date-range-field {
    width: 100%;
    min-width: 100%;
  }

  .profit-orders-filter-actions {
    margin-top: 0;
  }

  .profit-comparison-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profit-cost-band-grid {
    grid-template-columns: 1fr;
  }

  .comparison-summary-item + .comparison-summary-item {
    border-left: 0;
  }

  .comparison-summary-item:nth-child(even) {
    border-left: 1px solid #e5eceb;
  }

  .comparison-summary-item:nth-child(n + 3) {
    border-top: 1px solid #e5eceb;
  }
}

.toast-root {
  position: fixed;
  z-index: 40;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 10px;
}

.toast {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.toast.success {
  border-left-color: var(--green);
}

.toast.warning {
  border-left-color: var(--amber);
}

.toast.error {
  border-left-color: var(--red);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .kpi-grid,
  .auth-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .primary-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .global-search {
    width: 100%;
  }

  .global-sync-button {
    flex: 0 0 auto;
  }

  .project-choice-grid {
    grid-template-columns: 1fr;
  }

  .login-shell {
    padding: 18px;
  }

  .login-panel {
    padding: 22px;
  }

  .content {
    padding: 16px;
  }

  .kpi-grid,
  .auth-grid,
  .form-grid,
  .sync-steps {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .actionbar,
  .report-controls {
    align-items: stretch;
  }

  .field,
  .field.wide,
  .date-range-field,
  .button {
    width: 100%;
  }

  .date-range-control {
    grid-template-columns: 1fr;
  }

  .date-range-control span {
    text-align: center;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }
}

/* MuCheng final visual layer */
.login-body {
  background:
    radial-gradient(circle at 15% 10%, rgba(17, 103, 177, 0.12), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(25, 135, 84, 0.11), transparent 28%),
    linear-gradient(135deg, #f4f8fb 0%, #edf4f0 100%);
}

.login-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(185, 197, 209, 0.72);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 70px rgba(21, 32, 43, 0.14);
  backdrop-filter: blur(14px);
}

.login-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #1167b1, #198754, #f0a431);
  content: "";
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.96)),
    #fbfcfe;
}

.brand {
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(17, 103, 177, 0.08), rgba(25, 135, 84, 0.06));
}

.brand-mark,
.project-choice-mark,
.avatar {
  background: linear-gradient(135deg, #1167b1, #198754);
  box-shadow: 0 8px 18px rgba(17, 103, 177, 0.22);
}

.project-choice.wb .project-choice-mark {
  background: linear-gradient(135deg, #6f4eb3, #1167b1);
}

.brand-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.version-badge {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border: 1px solid rgba(17, 103, 177, 0.18);
  border-radius: 999px;
  background: #eef7f1;
  color: #198754;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.topbar {
  background: rgba(247, 250, 252, 0.86);
  box-shadow: 0 8px 28px rgba(21, 32, 43, 0.05);
}

.project-switch,
.global-search,
.icon-button {
  box-shadow: 0 1px 0 rgba(21, 32, 43, 0.04);
}

.project-switch {
  border-color: rgba(17, 103, 177, 0.22);
  background: #ffffff;
}

.project-switch:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #1167b1, #198754);
}

.global-search:focus-within {
  border-color: rgba(17, 103, 177, 0.52);
  box-shadow: 0 0 0 3px rgba(17, 103, 177, 0.12);
}

.project-choice {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.98)),
    var(--surface-soft);
}

.project-choice:hover {
  border-color: rgba(25, 135, 84, 0.55);
  box-shadow: 0 16px 32px rgba(17, 103, 177, 0.14);
}

.nav-primary:hover,
.nav-primary.is-open,
.nav-secondary button:hover {
  background: #edf6f2;
}

.nav-secondary button.is-active {
  background: #e8f2fb;
  box-shadow: inset 3px 0 0 #198754;
}

/* MuCheng ERP 2026 true final override */
:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-muted: #eef4f2;
  --line: #dce4e8;
  --line-strong: #b8c6cf;
  --text: #14212b;
  --muted: #647384;
  --accent: #0f6f9f;
  --accent-strong: #0a567e;
  --accent-soft: #e8f4f8;
  --green: #21845f;
  --green-soft: #e8f5ef;
  --shadow: 0 16px 42px rgba(20, 33, 43, 0.08);
}

body {
  background: linear-gradient(180deg, #f7fafb 0, #f1f5f7 280px, #eef3f5 100%);
}

.login-body,
.project-gate {
  background:
    linear-gradient(120deg, rgba(15, 111, 159, 0.12), rgba(33, 132, 95, 0.1)),
    linear-gradient(180deg, #f8fbfc, #eef5f3);
}

.login-panel,
.project-gate-panel,
.table-wrap,
.kpi-card,
.form-panel,
.auth-card,
.chart-panel,
.side-panel,
.plain-panel,
.sync-panel {
  border: 1px solid rgba(220, 228, 232, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 12px 30px rgba(20, 33, 43, 0.06);
}

.login-panel,
.project-gate-panel {
  box-shadow: 0 28px 80px rgba(20, 33, 43, 0.16);
}

.sidebar {
  border-right: 1px solid rgba(184, 198, 207, 0.68);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 250, 0.96));
  box-shadow: 8px 0 24px rgba(20, 33, 43, 0.03);
}

.brand {
  min-height: 78px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(184, 198, 207, 0.7);
  background:
    linear-gradient(135deg, rgba(15, 111, 159, 0.11), rgba(33, 132, 95, 0.08)),
    #fff;
  padding: 20px 18px;
}

.brand-mark,
.project-choice-mark,
.project-gate-mark,
.project-choice-icon,
.avatar {
  background: linear-gradient(135deg, #0f6f9f, #21845f);
  box-shadow: 0 10px 22px rgba(15, 111, 159, 0.22);
}

.topbar {
  min-height: 72px;
  border-bottom: 1px solid rgba(184, 198, 207, 0.7);
  background: rgba(247, 250, 251, 0.88);
  box-shadow: 0 10px 28px rgba(20, 33, 43, 0.05);
}

.content {
  padding: 22px 24px 34px;
}

.toolbar,
.actionbar,
.report-controls {
  border: 1px solid rgba(220, 228, 232, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.button.primary,
.project-switch:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #0f6f9f, #21845f);
  box-shadow: 0 10px 22px rgba(15, 111, 159, 0.2);
}

.global-search,
.project-switch,
.icon-button,
.button,
.field input,
.field select,
.mini-select {
  border-color: #d7e2e6;
  border-radius: 8px;
}

thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  border-bottom: 1px solid #d7e2e6;
  background: #f6faf9;
  color: #405261;
  font-size: 12px;
  font-weight: 850;
}

tbody tr:nth-child(even) {
  background: #fbfdfd;
}

tbody tr:hover {
  background: #f0f7f5;
}

.nav-primary:hover,
.nav-primary.is-open,
.nav-secondary button:hover {
  background: #edf6f4;
}

.nav-secondary button.is-active {
  background: #e7f3f7;
  color: #0a567e;
  box-shadow: inset 3px 0 0 #21845f;
}

.permission-panel {
  min-width: min(760px, 76vw);
  border: 1px solid #dce4e8;
  border-radius: 8px;
  background: #fbfdfd;
  padding: 12px;
}

.permission-choice:has(input:checked) {
  border-color: rgba(15, 111, 159, 0.34);
  background: #eaf5f7;
  color: #0a567e;
  font-weight: 800;
}

.abnormal-filter-toolbar {
  align-items: flex-end;
}

.abnormal-filter-toolbar .field-wide {
  min-width: min(100%, 470px);
}

.abnormal-toolbar-actions {
  display: flex;
  align-items: center;
  align-self: flex-end;
  gap: 8px;
  margin-left: auto;
}

.abnormal-orders-page .kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.abnormal-orders-page .kpi-card.tone-returns {
  border-top: 3px solid #c54545;
  background: #fffafa;
}

.abnormal-orders-page .kpi-card.tone-orders {
  border-top: 3px solid #287ca4;
  background: #f8fcfe;
}

.abnormal-orders-page .kpi-card.tone-action {
  border-top: 3px solid #d06b3d;
  background: #fffaf7;
}

.abnormal-orders-page .kpi-card.tone-stock {
  border-top: 3px solid #c29224;
  background: #fffdf7;
}

.abnormal-orders-page .kpi-card.tone-ads {
  border-top: 3px solid #8a5bab;
  background: #fcf9fe;
}

.abnormal-orders-page .kpi-card.tone-sales {
  border-top: 3px solid #21845f;
  background: #f8fcfa;
}

.abnormal-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.abnormal-summary-grid .data-area {
  min-width: 0;
}

.abnormal-summary-table .table-wrap table {
  min-width: 1120px;
}

.abnormal-detail-table .table-wrap table {
  min-width: 2480px;
}

.abnormal-detail-table th:first-child,
.abnormal-detail-table td:first-child {
  position: sticky;
  z-index: 2;
  left: 0;
  width: 170px;
  min-width: 170px;
  background: inherit;
  box-shadow: 1px 0 0 #dfe8eb;
}

.abnormal-detail-table thead th:first-child {
  z-index: 3;
  background: #f6faf9;
}

.abnormal-sku-cell,
.abnormal-status-cell {
  display: grid;
  gap: 5px;
  min-width: 150px;
}

.abnormal-sku-cell strong {
  color: #17303d;
  font-size: 13px;
}

.abnormal-sku-cell small,
.abnormal-status-cell small {
  display: -webkit-box;
  overflow: hidden;
  color: #6e7f8b;
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cost-negative {
  color: #ad3737;
  font-weight: 750;
}

.cost-ad {
  color: #73509b;
  font-weight: 750;
}

.cost-total {
  color: #17303d;
  font-weight: 900;
}

@media (max-width: 760px) {
  .content {
    padding: 16px;
  }

  .permission-panel {
    min-width: 0;
    width: 100%;
  }

  .abnormal-orders-page .kpi-grid,
  .abnormal-summary-grid {
    grid-template-columns: 1fr;
  }

  .abnormal-toolbar-actions {
    width: 100%;
    margin-left: 0;
  }

  .abnormal-toolbar-actions .button {
    flex: 1;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .abnormal-orders-page .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .abnormal-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Operations dashboard responsive overrides */
@media (max-width: 1080px) {
  .operations-dashboard .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .ops-control-band,
  .ops-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .ops-store-select {
    width: 100%;
  }

  .ops-range-control {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .ops-range-control button {
    width: 100%;
    min-width: 0;
  }

  .operations-dashboard .kpi-grid {
    grid-template-columns: 1fr;
  }

  .ops-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ops-trend-chart {
    min-width: max(620px, calc(var(--ops-day-count) * 34px));
  }

  .ops-status-groups {
    grid-template-columns: 1fr;
  }

  .ops-status-group:nth-child(n) {
    grid-column: auto;
  }

  .ops-status-sync {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  .ops-status-group-row {
    grid-template-columns: 8px minmax(0, 1fr) auto;
  }

  .ops-status-group-row small {
    grid-column: 2 / 4;
    text-align: left;
  }
}

.finance-category-header-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.finance-category-header-select {
  width: 108px;
  height: 28px;
  border: 1px solid #cbd9df;
  border-radius: 6px;
  background: #fff;
  color: #243746;
  padding: 0 24px 0 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  outline: 0;
  cursor: pointer;
}

.finance-category-header-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 103, 177, 0.12);
}

.finance-details-page .kpi-card {
  position: relative;
  overflow: hidden;
  border-top-width: 3px;
}

.finance-details-page .kpi-card.finance-kpi-income {
  border-top-color: #16805c;
  background: #f7fcfa;
}

.finance-details-page .kpi-card.finance-kpi-expense {
  border-top-color: #c44b45;
  background: #fff9f8;
}

.finance-details-page .kpi-card.finance-kpi-net {
  border-top-color: #2479a6;
  background: #f7fbfd;
}

.finance-details-page .kpi-card.finance-kpi-pending {
  border-top-color: #c88722;
  background: #fffbf5;
}

.finance-details-toolbar .finance-search-field {
  min-width: min(330px, 100%);
}

.finance-details-table .table-wrap table {
  min-width: 1320px;
}

.finance-details-table th:nth-child(1),
.finance-details-table td:nth-child(1) {
  position: sticky;
  z-index: 2;
  left: 0;
  width: 146px;
  min-width: 146px;
  background: #fff;
  box-shadow: 1px 0 0 #e3eaee;
}

.finance-details-table th:nth-child(2),
.finance-details-table td:nth-child(2) {
  position: sticky;
  z-index: 2;
  left: 146px;
  width: 148px;
  min-width: 148px;
  background: #fff;
  box-shadow: 1px 0 0 #e3eaee;
}

.finance-details-table thead th:nth-child(1),
.finance-details-table thead th:nth-child(2) {
  z-index: 4;
  background: #f7fafc;
}

.finance-details-table tbody tr:hover td:nth-child(1),
.finance-details-table tbody tr:hover td:nth-child(2) {
  background: #fbfdff;
}

/* Finance report: month closing -> daily ledger -> order detail */
.finance-report-page {
  --finance-sales: #187aa0;
  --finance-settlement: #2c6f5b;
  --finance-ad: #b66d20;
  --finance-profit: #72549a;
}

.finance-report-toolbar {
  align-items: end;
}

.finance-report-basis {
  display: grid;
  gap: 3px;
  min-width: 270px;
  padding: 6px 10px;
  border-left: 3px solid #2d7b68;
}

.finance-report-basis strong {
  color: #1e3440;
  font-size: 13px;
}

.finance-report-basis span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.finance-report-page .kpi-card.finance-report-kpi {
  min-height: 104px;
  border-top-width: 3px;
}

.finance-report-page .kpi-card.tone-sales {
  border-top-color: var(--finance-sales);
  background: #f4fafc;
}

.finance-report-page .kpi-card.tone-settlement,
.finance-report-page .kpi-card.tone-closed {
  border-top-color: var(--finance-settlement);
  background: #f5fbf8;
}

.finance-report-page .kpi-card.tone-ad {
  border-top-color: var(--finance-ad);
  background: #fff9f2;
}

.finance-report-page .kpi-card.tone-profit {
  border-top-color: var(--finance-profit);
  background: #faf8fc;
}

.finance-cost-composition {
  display: grid;
  gap: 10px;
  padding: 14px 2px 16px;
  border-top: 1px solid #d8e4e8;
  border-bottom: 1px solid #d8e4e8;
  background: #fbfdfe;
}

.finance-cost-composition-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.finance-cost-composition-heading > div {
  display: grid;
  gap: 3px;
}

.finance-cost-composition-heading > div:last-child {
  justify-items: end;
}

.finance-cost-composition-heading strong {
  color: #18313d;
  font-size: 14px;
}

.finance-cost-composition-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.finance-cost-track {
  display: flex;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 1px solid #d3dfe3;
  border-radius: 4px;
  background: #eef3f5;
}

.finance-cost-segment {
  display: block;
  min-width: 1px;
  height: 100%;
}

.finance-cost-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: 8px 18px;
}

.finance-cost-legend-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 7px;
  min-width: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.finance-cost-legend-item > span:nth-child(2) {
  overflow: hidden;
  color: #405661;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-cost-legend-item strong {
  color: #182e39;
  font-size: 11px;
}

.finance-cost-legend-item small {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.finance-cost-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.finance-cost-segment.tone-commission,
.finance-cost-dot.tone-commission { background: #2879a5; }
.finance-cost-segment.tone-logistics,
.finance-cost-dot.tone-logistics { background: #1f8a76; }
.finance-cost-segment.tone-platform,
.finance-cost-dot.tone-platform { background: #c28a21; }
.finance-cost-segment.tone-supply,
.finance-cost-dot.tone-supply { background: #7665a8; }
.finance-cost-segment.tone-cross-dock,
.finance-cost-dot.tone-cross-dock { background: #a06b3f; }
.finance-cost-segment.tone-after-sales,
.finance-cost-dot.tone-after-sales { background: #c44f4f; }
.finance-cost-segment.tone-advertising,
.finance-cost-dot.tone-advertising { background: #d36d2f; }
.finance-cost-segment.tone-purchase,
.finance-cost-dot.tone-purchase { background: #4b7e45; }
.finance-cost-segment.tone-first-mile,
.finance-cost-dot.tone-first-mile { background: #3d8994; }
.finance-cost-segment.tone-other,
.finance-cost-dot.tone-other { background: #78858c; }
.finance-cost-segment.tone-tax,
.finance-cost-dot.tone-tax { background: #a64f79; }

.finance-report-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.finance-report-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.finance-report-heading strong {
  color: #172b36;
  font-size: 20px;
}

.finance-report-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.finance-back-button {
  flex: 0 0 auto;
}

.finance-report-table .table-wrap table {
  font-variant-numeric: tabular-nums;
}

.finance-report-table tbody tr:hover td {
  background: #f8fbfc;
}

.finance-period-button {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: #11669a;
  text-align: left;
  cursor: pointer;
}

.finance-period-button strong {
  font-size: 13px;
}

.finance-period-button small,
.finance-state-cell small,
.table-cell-note,
.finance-profit-cell small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: normal;
}

.finance-period-button:hover strong,
.finance-period-button:focus-visible strong {
  text-decoration: underline;
}

.finance-state-cell {
  display: grid;
  gap: 4px;
}

.finance-close-state,
.finance-coverage,
.finance-check {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}

.finance-close-state.is-closed,
.finance-check.is-ok,
.finance-coverage.is-complete {
  border-color: #b8decf;
  background: #edf8f3;
  color: #176b4d;
}

.finance-close-state.is-closed_cost_pending,
.finance-close-state.is-closed_pending_orders,
.finance-close-state.is-settling,
.finance-check.is-waiting {
  border-color: #ead5a9;
  background: #fff8e8;
  color: #966118;
}

.finance-close-state.is-estimate {
  border-color: #b9d9e8;
  background: #eef8fc;
  color: #176b8e;
}

.finance-coverage.is-estimate {
  border-color: #b9d9e8;
  background: #eef8fc;
  color: #176b8e;
}

.finance-close-state.is-review,
.finance-check.is-error,
.finance-coverage.is-missing {
  border-color: #ecc6c1;
  background: #fff3f2;
  color: #a33c35;
}

.finance-report-table td.cost-value {
  color: #a84b3f;
}

.finance-profit-cell {
  display: grid;
  gap: 1px;
}

.finance-profit-cell strong {
  color: #176a50;
  font-size: 13px;
}

.finance-profit-cell.is-incomplete strong,
.finance-profit-cell.is-incomplete small {
  color: #a05c16;
}

.finance-month-table th:nth-child(1) { width: 126px; }
.finance-month-table th:nth-child(2) { width: 148px; }
.finance-day-table th:nth-child(1) { width: 126px; }
.finance-order-table th:nth-child(1) { width: 166px; }
.finance-order-table th:nth-child(2) { width: 112px; }
.finance-order-table th:nth-child(3) { width: 116px; }
.finance-shared-table th:nth-child(1) { width: 132px; }

@media (max-width: 760px) {
  .finance-report-basis {
    order: 3;
    width: 100%;
    min-width: 0;
  }

  .finance-report-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .finance-cost-composition-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .finance-cost-composition-heading > div:last-child {
    justify-items: start;
  }

  .finance-cost-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.finance-details-table th:nth-child(3) { width: 120px; }
.finance-details-table th:nth-child(4) { width: 82px; }
.finance-details-table th:nth-child(5) { width: 240px; }
.finance-details-table th:nth-child(6) { width: 220px; }
.finance-details-table th:nth-child(7) { width: 132px; }
.finance-details-table th:nth-child(8) { width: 142px; }
.finance-details-table th:nth-child(9) { width: 180px; }

.finance-category-badge,
.finance-direction-badge,
.finance-association-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.finance-category-badge.is-sales { border-color: #a7d8c4; background: #edf9f4; color: #146b4c; }
.finance-category-badge.is-platform { border-color: #b9d5e4; background: #eef7fb; color: #1d617f; }
.finance-category-badge.is-logistics { border-color: #cbbfe3; background: #f7f3fb; color: #69518f; }
.finance-category-badge.is-supply { border-color: #efd29d; background: #fff8eb; color: #8b5b0e; }
.finance-category-badge.is-after-sales { border-color: #e8b5b1; background: #fff2f1; color: #a23f3a; }
.finance-category-badge.is-ad { border-color: #b8cee9; background: #f0f6fd; color: #2a6091; }
.finance-category-badge.is-compensation { border-color: #a9d3d0; background: #eef9f8; color: #246f6a; }
.finance-category-badge.is-other { border-color: #d3dce2; background: #f5f7f8; color: #61717c; }

.finance-direction-badge.is-income { border-color: #add9c6; background: #eff9f4; color: #15704f; }
.finance-direction-badge.is-expense { border-color: #e7b8b4; background: #fff2f1; color: #aa423c; }
.finance-direction-badge.is-neutral { border-color: #d3dce2; background: #f5f7f8; color: #687882; }

.finance-association-badge.is-linked { border-color: #add9c6; background: #eff9f4; color: #15704f; }
.finance-association-badge.is-level { border-color: #bfd3e0; background: #f1f7fa; color: #3a647a; }
.finance-association-badge.is-pending { border-color: #efcf92; background: #fff8e9; color: #8b5b0e; }

.finance-object-button {
  display: grid;
  width: 100%;
  max-width: 250px;
  gap: 4px;
  border: 0;
  background: transparent;
  color: #193849;
  padding: 2px 0;
  text-align: left;
  cursor: pointer;
}

.finance-object-button strong,
.finance-fee-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12.5px;
  line-height: 1.35;
  white-space: nowrap;
}

.finance-object-button small,
.finance-fee-cell small {
  overflow: hidden;
  color: #72818b;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-object-button:hover strong,
.finance-object-button:focus-visible strong {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.finance-fee-cell {
  display: grid;
  max-width: 230px;
  gap: 4px;
}

.finance-amount {
  font-size: 13px;
  font-weight: 850;
}

.finance-amount.is-income { color: #15704f; }
.finance-amount.is-expense { color: #ad3737; }

.finance-flow-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.finance-flow-actions .identifier-copy-line {
  max-width: 118px;
}

.finance-detail-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.modal.finance-detail-modal {
  width: min(1060px, 100%);
}

.finance-detail-body {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.finance-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.finance-detail-summary > div {
  display: grid;
  min-height: 70px;
  align-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
  padding: 10px 12px;
}

.finance-detail-summary span,
.finance-breakdown-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.finance-detail-summary strong,
.finance-breakdown-grid strong {
  color: #19323f;
  font-size: 15px;
}

.finance-object-card {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-left: 3px solid #2d7c9f;
  background: #f3f8fa;
  padding: 10px 12px;
}

.finance-object-card strong {
  color: #173847;
  font-size: 14px;
}

.finance-object-card span {
  color: #687a85;
  font-size: 12px;
  text-align: right;
}

.finance-detail-products .table-wrap,
.finance-service-table .table-wrap {
  min-height: 0;
}

.finance-detail-products table,
.finance-service-table table {
  min-width: 720px;
}

.finance-detail-products th,
.finance-detail-products td,
.finance-service-table th,
.finance-service-table td {
  height: auto;
  min-height: 38px;
  padding: 8px 10px;
}

.finance-detail-product-name {
  min-width: 230px;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finance-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.finance-breakdown-grid > div {
  display: grid;
  gap: 5px;
  border-bottom: 2px solid #dfe8ec;
  background: #fafcfd;
  padding: 10px;
}

.finance-service-table td:first-child {
  display: grid;
  gap: 3px;
}

.finance-service-table td:first-child small {
  color: var(--muted);
  font-size: 10px;
}

.finance-processing-note {
  border: 1px solid #c6dbe4;
  border-left: 3px solid #2d7c9f;
  border-radius: 6px;
  background: #f4f9fb;
  color: #3d5663;
  padding: 11px 12px;
  font-size: 12px;
  line-height: 1.6;
}

.finance-raw-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.finance-raw-details summary {
  color: #4f6571;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.finance-raw-details pre {
  max-height: 320px;
  overflow: auto;
  margin: 10px 0 0;
  border: 1px solid #dce5e9;
  border-radius: 6px;
  background: #f7f9fa;
  color: #2c414c;
  padding: 12px;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  .finance-detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-object-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .finance-object-card span {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .finance-details-toolbar .finance-search-field {
    min-width: 100%;
  }

  .finance-detail-summary {
    grid-template-columns: 1fr;
  }
}

/* Role permissions: mirror the primary navigation hierarchy. */
.role-permission-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 2px 0 14px;
}

.role-permission-intro > div {
  display: grid;
  gap: 4px;
}

.role-permission-intro strong {
  color: var(--text);
  font-size: 20px;
}

.role-permission-intro span,
.role-editor-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.role-permission-workspace {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(20, 33, 43, 0.05);
}

.role-selector {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #f6faf9;
  padding: 12px;
}

.role-selector-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 8px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.role-selector-title b {
  min-width: 24px;
  border-radius: 7px;
  background: #e4efec;
  color: #26715a;
  padding: 4px 6px;
  text-align: center;
}

.role-selector-list {
  display: grid;
  gap: 6px;
}

.role-selector-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  padding: 8px 9px 8px 12px;
  text-align: left;
  cursor: pointer;
}

.role-selector-item:hover {
  border-color: #d6e5e1;
  background: #edf6f4;
}

.role-selector-item.is-active {
  border-color: rgba(33, 132, 95, 0.24);
  background: #e7f3f0;
  box-shadow: inset 3px 0 0 #21845f;
}

.role-selector-item > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.role-selector-item strong,
.role-selector-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-selector-item strong {
  font-size: 14px;
}

.role-selector-item small {
  color: var(--muted);
  font-size: 10px;
}

.role-selector-item > b {
  flex: 0 0 auto;
  min-width: 28px;
  border-radius: 7px;
  background: #fff;
  color: #0a567e;
  padding: 5px 6px;
  font-size: 11px;
  text-align: center;
}

.role-permission-editor {
  display: grid;
  min-width: 0;
  gap: 16px;
  padding: 20px;
}

.role-editor-head,
.role-editor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-editor-head {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.role-editor-head > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.role-editor-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  letter-spacing: 0;
}

.role-editor-eyebrow {
  color: #21845f;
  font-size: 11px;
  font-weight: 850;
}

.role-name-row {
  max-width: 420px;
}

.role-name-row .field {
  width: 100%;
}

.role-permission-editor .permission-panel {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
}

.role-permission-editor .permission-actions {
  border-bottom: 1px solid var(--line);
  padding: 0 0 12px;
}

.role-permission-editor .permission-groups {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.role-permission-editor .permission-group {
  align-content: start;
  min-width: 0;
  border-color: #dfe8e6;
  background: #fbfdfd;
  padding: 0;
}

.permission-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  border-bottom: 1px solid #e4ecea;
  background: #f2f8f6;
  padding: 10px 12px;
  cursor: pointer;
}

.permission-group.is-partial .permission-group-head {
  background: #f2f7fb;
}

.permission-group-check {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.permission-group-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #21845f;
}

.permission-group-check > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.permission-group-check strong {
  color: var(--text);
  font-size: 14px;
}

.permission-group-check small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-group-head > b {
  flex: 0 0 auto;
  border-radius: 7px;
  background: #fff;
  color: #4d6874;
  padding: 4px 7px;
  font-size: 10px;
}

.role-permission-editor .permission-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  padding: 10px;
}

.role-permission-editor .permission-choice {
  min-width: 0;
  white-space: normal;
}

.role-permission-editor .permission-choice span {
  overflow-wrap: anywhere;
}

.role-editor-actions {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

@media (max-width: 1050px) {
  .role-permission-editor .permission-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .role-permission-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .role-permission-workspace {
    grid-template-columns: 1fr;
  }

  .role-selector {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .role-selector-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-permission-editor {
    padding: 14px;
  }

  .role-permission-editor .permission-grid {
    grid-template-columns: 1fr;
  }
}

/* Shared horizontal-table identity columns */
.sticky-columns .table-wrap table {
  min-width: var(--table-min-width, 100%);
}

.sticky-columns-1 th:nth-child(1),
.sticky-columns-1 td:nth-child(1),
.sticky-columns-2 th:nth-child(-n + 2),
.sticky-columns-2 td:nth-child(-n + 2),
.sticky-columns-3 th:nth-child(-n + 3),
.sticky-columns-3 td:nth-child(-n + 3) {
  position: sticky;
  overflow: hidden;
  background: #fff;
  text-overflow: ellipsis;
}

.sticky-columns th:nth-child(1),
.sticky-columns td:nth-child(1) {
  left: 0;
  width: var(--sticky-col-1-width);
  min-width: var(--sticky-col-1-width);
  max-width: var(--sticky-col-1-width);
}

.sticky-columns-2 th:nth-child(2),
.sticky-columns-2 td:nth-child(2),
.sticky-columns-3 th:nth-child(2),
.sticky-columns-3 td:nth-child(2) {
  left: var(--sticky-col-1-width);
  width: var(--sticky-col-2-width);
  min-width: var(--sticky-col-2-width);
  max-width: var(--sticky-col-2-width);
}

.sticky-columns-3 th:nth-child(3),
.sticky-columns-3 td:nth-child(3) {
  left: calc(var(--sticky-col-1-width) + var(--sticky-col-2-width));
  width: var(--sticky-col-3-width);
  min-width: var(--sticky-col-3-width);
  max-width: var(--sticky-col-3-width);
}

.sticky-columns-1 th:nth-child(1),
.sticky-columns-2 th:nth-child(-n + 2),
.sticky-columns-3 th:nth-child(-n + 3) {
  z-index: 7;
  background: #f6faf9;
}

.sticky-columns-1 td:nth-child(1),
.sticky-columns-2 td:nth-child(-n + 2),
.sticky-columns-3 td:nth-child(-n + 3) {
  z-index: 4;
}

.sticky-columns-1 tbody tr:nth-child(even) td:nth-child(1),
.sticky-columns-2 tbody tr:nth-child(even) td:nth-child(-n + 2),
.sticky-columns-3 tbody tr:nth-child(even) td:nth-child(-n + 3) {
  background: #fbfdfd;
}

.sticky-columns-1 tbody tr:hover td:nth-child(1),
.sticky-columns-2 tbody tr:hover td:nth-child(-n + 2),
.sticky-columns-3 tbody tr:hover td:nth-child(-n + 3) {
  background: #f0f7f5;
}

.sticky-columns-1 th:nth-child(1),
.sticky-columns-1 td:nth-child(1),
.sticky-columns-2 th:nth-child(2),
.sticky-columns-2 td:nth-child(2),
.sticky-columns-3 th:nth-child(3),
.sticky-columns-3 td:nth-child(3) {
  box-shadow: 10px 0 16px -15px rgba(20, 33, 43, 0.74);
}

.profit-identity-sticky .profit-sku-cell {
  min-width: 0;
  width: 100%;
  gap: 0;
}

.profit-identity-sticky .profit-sku-cell .thumb,
.profit-identity-sticky .profit-sku-cell .muted {
  display: none;
}

.profit-identity-sticky .profit-sku-cell > div:last-child {
  min-width: 0;
  max-width: 100%;
}

.profit-identity-sticky .profit-sku-cell .product-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-table th:first-child,
.ops-table td:first-child,
.campaign-product-table th:first-child,
.campaign-product-table td:first-child,
.finance-detail-products th:first-child,
.finance-detail-products td:first-child,
.supply-detail-table th:first-child,
.supply-detail-table td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  box-shadow: 10px 0 16px -15px rgba(20, 33, 43, 0.68);
}

.ops-table th:first-child,
.campaign-product-table th:first-child,
.finance-detail-products th:first-child,
.supply-detail-table th:first-child {
  z-index: 6;
  background: #f6faf9;
}

.ops-table td:first-child,
.campaign-product-table td:first-child,
.finance-detail-products td:first-child,
.supply-detail-table td:first-child {
  z-index: 3;
}

.ops-table th:first-child,
.ops-table td:first-child {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

.campaign-product-table th:first-child,
.campaign-product-table td:first-child {
  width: 190px;
  min-width: 190px;
  max-width: 190px;
}

.finance-detail-products th:first-child,
.finance-detail-products td:first-child,
.supply-detail-table th:first-child,
.supply-detail-table td:first-child {
  width: 112px;
  min-width: 112px;
  max-width: 112px;
}

.supply-request-table th:nth-child(-n + 2),
.supply-request-table td:nth-child(-n + 2) {
  position: sticky;
  overflow: hidden;
  background: #fff;
  text-overflow: ellipsis;
}

.supply-request-table th:nth-child(1),
.supply-request-table td:nth-child(1) {
  left: 0;
  width: 154px;
  min-width: 154px;
  max-width: 154px;
}

.supply-request-table th:nth-child(2),
.supply-request-table td:nth-child(2) {
  left: 154px;
  width: 96px;
  min-width: 96px;
  max-width: 96px;
  box-shadow: 10px 0 16px -15px rgba(20, 33, 43, 0.68);
}

.supply-request-table thead th:nth-child(-n + 2) {
  z-index: 7;
  background: #f6faf9;
}

.supply-request-table tbody td:nth-child(-n + 2) {
  z-index: 4;
}

.supply-request-table tbody tr:hover td:nth-child(-n + 2) {
  background: #f0f7f5;
}

/* v2.0.003 unified page controls and store-scoped synchronization */
.topbar {
  z-index: 30;
}

.global-sync-scope {
  display: grid;
  min-width: 154px;
  gap: 3px;
}

.global-sync-scope[hidden] {
  display: none;
}

.global-sync-scope > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.global-sync-scope select {
  width: 100%;
  height: 36px;
  border: 1px solid #c8d7dd;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 30px 0 9px;
  font-size: 12px;
  font-weight: 750;
}

.global-sync-scope select:focus {
  border-color: rgba(15, 111, 159, 0.58);
  outline: 3px solid rgba(15, 111, 159, 0.11);
}

.page-control-sticky {
  position: sticky !important;
  z-index: 18;
  top: var(--topbar-sticky-offset, 72px);
  isolation: isolate;
  border-color: rgba(184, 198, 207, 0.86) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 12px 24px rgba(20, 33, 43, 0.09) !important;
  backdrop-filter: blur(12px);
}

.page-control-sticky.ops-control-band,
.page-control-sticky.profit-orders-controls,
.page-control-sticky.panel-header {
  border: 1px solid rgba(184, 198, 207, 0.86);
  border-radius: 8px;
  padding: 10px 12px;
}

.supply-toolbar.page-control-sticky {
  align-items: flex-end;
  justify-content: flex-start;
}

.supply-toolbar .field {
  min-width: 150px;
}

.supply-toolbar .segmented-control {
  align-self: flex-end;
}

.supply-toolbar .table-select {
  width: 100%;
}

@media (max-width: 760px) {
  .page-control-sticky {
    position: relative !important;
    top: auto;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .global-sync-scope {
    min-width: 0;
    flex: 1 1 190px;
  }

  .topbar-actions .global-search {
    flex: 1 1 100%;
    order: 2;
  }

  .ad-records-sticky-table th:nth-child(1),
  .ad-records-sticky-table td:nth-child(1) {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
  }

  .ad-records-sticky-table th:nth-child(2),
  .ad-records-sticky-table td:nth-child(2) {
    left: 92px;
    width: 64px;
    min-width: 64px;
    max-width: 64px;
  }

  .ad-records-sticky-table th:nth-child(3),
  .ad-records-sticky-table td:nth-child(3) {
    left: 156px;
    width: 98px !important;
    min-width: 98px !important;
    max-width: 98px !important;
  }

  .daily-sales-store-table th:nth-child(1),
  .daily-sales-store-table td:nth-child(1),
  .daily-sales-sku-table th:nth-child(1),
  .daily-sales-sku-table td:nth-child(1) {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
  }

  .daily-sales-store-table th:nth-child(2),
  .daily-sales-store-table td:nth-child(2),
  .daily-sales-sku-table th:nth-child(2),
  .daily-sales-sku-table td:nth-child(2) {
    left: 92px;
    width: 64px;
    min-width: 64px;
    max-width: 64px;
  }

  .daily-sales-sku-table th:nth-child(3),
  .daily-sales-sku-table td:nth-child(3) {
    left: 156px;
    width: 98px;
    min-width: 98px;
    max-width: 98px;
  }

  .sku-products-sticky-table th:nth-child(1),
  .sku-products-sticky-table td:nth-child(1) {
    width: 94px;
    min-width: 94px;
    max-width: 94px;
  }

  .sku-products-sticky-table th:nth-child(2),
  .sku-products-sticky-table td:nth-child(2) {
    left: 94px;
    width: 104px;
    min-width: 104px;
    max-width: 104px;
  }

  .inventory-overview-table th:first-child,
  .inventory-overview-table td:first-child,
  .inventory-capital-table th:first-child,
  .inventory-capital-table td:first-child {
    width: 174px;
    min-width: 174px;
    max-width: 174px;
  }

  .campaign-product-table th:first-child,
  .campaign-product-table td:first-child {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
  }
}

.finance-missing-cost-panel {
  overflow: hidden;
  border: 1px solid #e9c979;
  border-radius: 10px;
  background: #fffaf0;
}

.finance-missing-cost-panel > summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  color: #7f5b08;
  cursor: pointer;
  list-style: none;
}

.finance-missing-cost-panel > summary::-webkit-details-marker {
  display: none;
}

.finance-missing-cost-panel > summary > span {
  display: grid;
  gap: 4px;
}

.finance-missing-cost-panel > summary strong {
  font-size: 14px;
}

.finance-missing-cost-panel > summary small,
.finance-missing-cost-note {
  color: #856f38;
  font-size: 11px;
  line-height: 1.5;
}

.finance-missing-cost-panel > summary > b {
  flex: 0 0 auto;
  border: 1px solid #e2bf67;
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
  font-size: 11px;
}

.finance-missing-cost-note {
  border-top: 1px solid #f0dfb3;
  padding: 8px 14px;
}

.finance-missing-cost-list {
  display: grid;
  max-height: 280px;
  gap: 7px;
  overflow: auto;
  border-top: 1px solid #f0dfb3;
  background: #fff;
  padding: 10px;
}

.finance-missing-cost-item {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(150px, 1fr) minmax(230px, 1.4fr) minmax(120px, auto);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

button.finance-missing-cost-item {
  cursor: pointer;
}

button.finance-missing-cost-item:hover,
button.finance-missing-cost-item:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.finance-missing-cost-item.is-disabled {
  background: var(--surface-soft);
  color: var(--muted);
}

.finance-missing-cost-identity,
.finance-missing-cost-scope,
.finance-missing-cost-source {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.finance-missing-cost-identity strong,
.finance-missing-cost-scope strong,
.finance-missing-cost-source strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.finance-missing-cost-identity small,
.finance-missing-cost-scope small,
.finance-missing-cost-source small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.finance-missing-cost-source {
  justify-items: end;
  color: var(--accent);
  text-align: right;
}

@media (max-width: 760px) {
  .finance-missing-cost-panel > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .finance-missing-cost-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .finance-missing-cost-source {
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
    text-align: left;
  }
}
