:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-muted: #eef3f5;
  --border: #d8e0e5;
  --text: #182026;
  --muted: #667782;
  --accent: #167f64;
  --accent-2: #256f9c;
  --danger: #b93f3f;
  --warning: #a56b13;
  --shadow: 0 12px 28px rgba(35, 50, 60, 0.08);
  --sticky-topbar-height: 90px;
  --sticky-section-head-height: 70px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  height: 100vh;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-card h1 {
  margin: 6px 0 0;
  font-size: 24px;
}

.login-card p {
  margin: 0 0 4px;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.login-card input {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
}

.login-brand .brand-title {
  color: var(--text);
}

.login-brand .brand-subtitle {
  color: var(--muted);
}

.login-status {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
}

.sidebar {
  display: flex;
  position: sticky;
  top: 0;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  border-right: 1px solid var(--border);
  background: #17242c;
  color: #fff;
  padding: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: #245264;
  font-weight: 700;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
}

.brand-subtitle {
  color: #a9bac3;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c9d5dc;
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: #243843;
  color: #fff;
}

.connection {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: #d5e1e7;
  font-size: 12px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
}

.status-dot.ok {
  background: #4fbf8f;
}

.status-dot.error {
  background: #dd6b6b;
}

.main {
  height: 100vh;
  min-width: 0;
  overflow: auto;
  padding: 0 24px 24px;
}

.topbar {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--bg);
  margin-bottom: 18px;
  padding: 24px 0 18px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

h3 {
  margin-bottom: 10px;
  font-size: 15px;
}

p {
  color: var(--muted);
  margin-top: 5px;
}

.button {
  border: 1px solid #126b56;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  padding: 9px 14px;
}

.button:hover {
  background: #0f6f56;
}

.button.secondary {
  border-color: var(--border);
  background: #fff;
  color: var(--text);
}

.button.secondary:hover {
  background: #eef3f5;
}

.toolbar {
  display: flex;
  position: relative;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.auth-user {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  display: grid;
  position: relative;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  font-size: 17px;
}

.icon-button:hover {
  background: #eef3f5;
}

.notifications-widget {
  position: relative;
  align-self: end;
}

.notification-badge {
  display: grid;
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: #b93f3f;
  color: #fff;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: min(420px, 90vw);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-muted);
  padding: 10px;
}

.notification-head-actions {
  display: flex;
  gap: 6px;
}

.notification-list {
  display: grid;
  max-height: 285px;
  overflow: auto;
}

.notification-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: #f8fbfc;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
}

.notification-item {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--border);
  padding: 10px;
  font-size: 12px;
}

.notification-item.unread {
  background: #fffaf0;
}

.notification-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notification-title span,
.notification-empty {
  color: var(--muted);
}

.notification-volume {
  width: fit-content;
  border-radius: 999px;
  background: #e8f3f0;
  color: #126b56;
  padding: 3px 7px;
  font-weight: 700;
}

.notification-empty {
  padding: 14px;
  font-size: 12px;
}

.notification-more {
  min-height: 38px;
  border: 0;
  border-top: 1px solid var(--border);
  background: #f8fbfc;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.notification-more:hover {
  background: #eef6f8;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(14, 25, 32, 0.34);
  padding: 24px;
}

.modal-card {
  display: grid;
  width: min(920px, 96vw);
  max-height: min(760px, 92vh);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(18, 37, 48, 0.22);
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-muted);
  padding: 14px 16px;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.notification-modal-card {
  width: min(860px, 96vw);
}

.notification-modal-list {
  display: grid;
  overflow: auto;
  max-height: calc(min(760px, 92vh) - 86px);
}

.notification-modal-list .notification-item {
  grid-template-columns: minmax(190px, 0.45fr) minmax(260px, 1fr) max-content;
  align-items: center;
  gap: 10px;
}

.notification-modal-list .notification-title {
  display: grid;
  gap: 3px;
}

.account-switcher {
  display: grid;
  min-width: 220px;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.price-sync-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.view.active > .price-sync-panel {
  position: sticky;
  top: calc(var(--sticky-topbar-height) + var(--sticky-section-head-height) + 8px);
  z-index: 24;
  background: var(--bg);
  padding-bottom: 12px;
}

.price-sync-panel:empty {
  display: none;
}

.price-sync-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #f0b6b6;
  border-radius: 8px;
  background: #fff8f8;
  padding: 12px;
}

.price-sync-copy span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.pending-action-copy {
  border-color: #9fd7bd;
  background: #f0fbf5;
}

.selected-upload-copy {
  border-color: #9bc8f5;
  background: #f3f8ff;
}

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

.wb-discount-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wb-discount-input {
  width: 62px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
}

.wb-discount-control.compact {
  gap: 3px;
}

.wb-discount-input-compact {
  width: 48px;
  min-height: 24px;
  border-radius: 5px;
  padding: 2px 5px;
  font-size: 11px;
}

.section-head {
  display: flex;
  position: sticky;
  top: var(--sticky-topbar-height);
  z-index: 25;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(216, 224, 229, 0.85);
  background: var(--bg);
  margin-bottom: 12px;
  padding: 10px 0 12px;
}

.marketplace-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 3px;
}

.marketplace-switch .mini-button {
  border-color: transparent;
  background: transparent;
}

.marketplace-switch .mini-button.active {
  border-color: #7dbca9;
  background: #e5f8f0;
  color: #07614b;
}

.profit-ladder-panel {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.profit-ladder-panel label {
  display: grid;
  min-width: 108px;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.profit-ladder-panel input {
  width: 118px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 7px;
}

.profit-ladder-panel .button {
  min-height: 32px;
  padding: 5px 10px;
}

.profit-ladder-panel .muted {
  align-self: center;
  font-size: 12px;
}

.bulk-boost-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border-left: 1px solid var(--border);
  padding-left: 8px;
}

.bulk-boost-tools span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.workspace-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  padding-left: 8px;
  font-size: 12px;
  white-space: nowrap;
}

.workspace-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.calc-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
}

.settings-panel .calc-settings {
  max-width: 760px;
  margin-bottom: 0;
}

.accounts-panel {
  display: grid;
  max-width: 980px;
  gap: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.server-settings-panel {
  display: grid;
  max-width: 980px;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.server-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.server-status-grid div,
.one-c-file {
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  padding: 8px;
}

.server-status-grid span,
.one-c-file span {
  color: var(--muted);
  font-size: 12px;
}

.server-settings-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.server-settings-form label {
  display: grid;
  min-width: 180px;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.server-settings-form input[type='text'] {
  min-width: min(420px, 80vw);
}

.server-settings-form input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}

.server-settings-form .toggle-label {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-width: 240px;
  color: var(--text);
}

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

.one-c-status,
.one-c-files {
  display: grid;
  gap: 8px;
}

.one-c-badge {
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  padding: 6px 10px;
  font-weight: 700;
}

.one-c-badge.ok {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.one-c-badge.warning {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.one-c-badge.error {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.accounts-list {
  display: grid;
  gap: 8px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px 160px max-content;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbfc;
  padding: 10px;
}

.account-row.active {
  border-color: #83c5b3;
  background: #effaf6;
}

.account-row strong,
.account-row span {
  min-width: 0;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 10px;
}

.account-form .button {
  min-height: 36px;
}

.account-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.account-form input {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

.competitor-form {
  display: grid;
  position: sticky;
  top: calc(var(--sticky-topbar-height) + var(--sticky-section-head-height) + 8px);
  z-index: 24;
  grid-template-columns: minmax(140px, 0.8fr) minmax(160px, 1fr) minmax(280px, 2fr) max-content max-content;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
}

.competitor-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.competitor-form input {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

.calc-settings label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.calc-settings input[type='number'] {
  width: 112px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
}

.toggle-line {
  display: flex !important;
  min-height: 36px;
  align-items: center;
  grid-auto-flow: column;
  grid-template-columns: auto 1fr;
}

.search-box {
  display: grid;
  min-width: 260px;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.search-box.compact {
  min-width: 220px;
}

.search-box input,
select {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.table-wrap.small {
  max-height: 520px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.cost-table {
  min-width: 1720px;
}

.workspace-table {
  min-width: 1680px;
}

.workspace-table th,
.workspace-table td {
  padding: 8px 10px;
}

.competitor-table {
  min-width: 1120px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-muted);
  color: #465763;
  font-size: 12px;
  font-weight: 700;
}

.column-filter {
  display: grid;
  min-width: 120px;
  gap: 5px;
}

.column-filter input,
.column-filter select {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 400;
}

.column-filter small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
}

tbody tr:hover {
  background: #f9fbfc;
}

tbody tr.pending-upload-row {
  background: #effaf3;
}

tbody tr.pending-upload-row:hover {
  background: #e4f6ec;
}

tbody tr.selected-upload-row {
  outline: 2px solid #89c4ff;
  outline-offset: -2px;
  background: #eef7ff;
}

tbody tr.selected-upload-row:hover {
  background: #e3f1ff;
}

tbody tr.pending-upload-row.selected-upload-row {
  background: #e8f8ee;
}

tbody tr.workspace-cost-incomplete-row:not(.pending-upload-row):not(.selected-upload-row) {
  background: #fffaf0;
}

tbody tr.workspace-cost-incomplete-row:not(.pending-upload-row):not(.selected-upload-row):hover {
  background: #fff4dc;
}

.workspace-hide-fbo .profit-model-fbo {
  display: none;
}

.workspace-cost-cell {
  min-width: 96px;
}

.workspace-cost-warning {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.workspace-cost-warning strong {
  color: #8a5200;
}

.workspace-cost-warning span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid #f0c46c;
  border-radius: 6px;
  background: #fff2cf;
  color: #7a4a00;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.workspace-offer-cell {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
}

.workspace-row-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 1px;
}

.workspace-row-select input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.price-upload-log {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.price-upload-log-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fbfc;
}

.price-upload-log-head > div:first-child {
  display: grid;
  gap: 2px;
}

.price-upload-log-head span,
.price-upload-log-head small {
  color: var(--muted);
  font-size: 12px;
}

.upload-log-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.upload-log-pill {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.upload-log-pill.updated {
  background: #dff5e8;
  color: #14633f;
}

.upload-log-pill.pending {
  background: #fff3c4;
  color: #7a5600;
}

.upload-log-pill.error {
  background: #fde2e2;
  color: #a12c2c;
}

.upload-log-pill.skipped {
  background: #edf1f4;
  color: #59656d;
}

.price-upload-log-details {
  padding: 8px 12px 12px;
}

.price-upload-log-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.upload-log-table-wrap {
  max-height: 280px;
  margin-top: 8px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.upload-log-table {
  min-width: 980px;
  font-size: 12px;
}

.upload-log-table th,
.upload-log-table td {
  padding: 6px 8px;
}

.upload-log-row.upload-log-error {
  background: #fff5f5;
}

.upload-log-row.upload-log-pending {
  background: #fffbeb;
}

.upload-log-row.upload-log-updated {
  background: #f4fbf7;
}

.upload-log-more {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.pending-upload-badge {
  width: fit-content;
  margin-top: 4px;
  border-radius: 999px;
  background: #d9f2e4;
  color: #126b56;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
}

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

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.regular-price-cell {
  min-width: 190px;
  white-space: normal;
}

.regular-price-editor {
  display: grid;
  gap: 6px;
  width: 180px;
}

.regular-price-editor.dirty {
  border-radius: 6px;
  background: #f0fbf5;
  padding: 6px;
}

.regular-price-main {
  display: grid;
  gap: 2px;
}

.regular-price-main strong {
  font-size: 13px;
}

.regular-price-main span,
.regular-price-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.regular-price-warning {
  border-radius: 5px;
  background: #fff3d7;
  color: #8a5a00;
  padding: 3px 5px;
  font-size: 11px;
  line-height: 1.25;
}

.regular-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.regular-price-grid label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
}

.regular-price-grid input {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
}

.regular-price-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.regular-target-row {
  display: grid;
  gap: 5px;
  border-top: 1px solid #edf2f5;
  padding-top: 5px;
}

.regular-target-row label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
}

.regular-target-row .custom-price-input {
  width: 96px;
  min-height: 28px;
}

.regular-target-result {
  display: grid;
  gap: 4px;
}

.regular-target-line {
  display: grid;
  grid-template-columns: 30px 62px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.regular-target-line > span {
  color: var(--muted);
  font-weight: 700;
}

.regular-target-line .mini-button {
  width: fit-content;
}

.pending-price-copy {
  border-color: #8ac7b3;
  background: #eefbf6;
}

.stock-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.stock-pair span {
  border-radius: 6px;
  background: #eef3f5;
  color: #53616b;
  padding: 3px 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stock-pair .stock-ok {
  background: #e4f7e9;
  color: #1d7037;
}

.stock-pair .stock-empty {
  background: #ffe7e7;
  color: #a82424;
  font-weight: 700;
}

.base-price {
  display: inline-grid;
  align-items: start;
  gap: 6px;
  margin-top: 6px;
  border: 1px solid #f0b6b6;
  border-radius: 6px;
  background: #fff4f4;
  color: #8d2727;
  padding: 4px 6px;
  font-size: 12px;
  white-space: nowrap;
}

.base-price-main {
  display: inline-grid;
  grid-template-columns: auto auto auto auto;
  align-items: center;
  gap: 5px;
}

.base-price-profit {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.base-price-profit span {
  font-size: 11px;
}

.price-sync-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.price-sync-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
}

.base-price span {
  color: #9d5656;
}

.base-price strong {
  color: #7b1f1f;
}

.base-price.missing {
  display: block;
  color: #9d5656;
}

.price-higher {
  color: #a82424 !important;
}

.price-lower {
  color: #167f64 !important;
}

.base-account-badge {
  display: inline-flex;
  margin-left: 6px;
  border-radius: 6px;
  background: #e6f3ef;
  color: #0c644f;
  padding: 2px 5px;
  font-size: 11px;
  font-weight: 700;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 360px;
}

.pill {
  border-radius: 999px;
  background: #e6f3ef;
  color: #0c644f;
  padding: 3px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.pill.warning {
  background: #fff0d8;
  color: var(--warning);
}

.index-badge {
  display: inline-flex;
  min-width: 108px;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.index-red {
  border-color: #df8a8a;
  background: #ffe7e7;
  color: #a82424;
}

.index-yellow {
  border-color: #e7ca68;
  background: #fff6c7;
  color: #806000;
}

.index-green {
  border-color: #82c99a;
  background: #e4f7e9;
  color: #1d7037;
}

.index-super {
  border-color: #6cc9c1;
  background: #dff8f5;
  color: #0d6f68;
}

.index-none {
  border-color: var(--border);
  background: #fff;
  color: #53616b;
}

.profit-block {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.profit-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.profit-pair span {
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.profit-pair.compact span {
  font-size: 11px;
}

.profit-percent {
  opacity: 0.72;
  font-size: 0.92em;
  font-weight: 700;
}

.profit-positive {
  background: #e4f7e9;
  color: #1d7037;
}

.profit-negative {
  background: #ffe7e7;
  color: #a82424;
}

.profit-zero {
  background: #eef3f5;
  color: #53616b;
}

.competitor-list {
  display: grid;
  min-width: 460px;
  gap: 8px;
}

.competitor-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.competitor-card.error {
  border-color: #f0b6b6;
  background: #fff8f8;
}

.competitor-card-head,
.competitor-price,
.competitor-actions,
.competitor-manual-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.competitor-card-head {
  justify-content: space-between;
}

.competitor-card a {
  color: var(--accent-2);
  font-weight: 700;
  text-decoration: none;
}

.competitor-card a:hover {
  text-decoration: underline;
}

.competitor-price strong {
  font-size: 17px;
}

.competitor-manual-price input {
  width: 126px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
}

.workspace-competitors {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  max-width: 560px;
}

.workspace-buyer-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.workspace-buyer-price strong {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.workspace-competitor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid #dbe6eb;
  border-radius: 6px;
  background: #f8fbfc;
  padding: 5px 6px;
}

.workspace-competitor a {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.workspace-competitor a:hover {
  text-decoration: underline;
}

.workspace-competitor strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.workspace-competitor .comparison-badge {
  padding: 2px 5px;
  font-size: 11px;
}

.own-buyer-price {
  display: grid;
  min-width: 220px;
  gap: 6px;
}

.own-buyer-price.price-source-error {
  border-left: 3px solid #df8a8a;
  padding-left: 8px;
}

.own-buyer-price label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.own-buyer-price input {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
}

.own-url-warning {
  border-radius: 6px;
  background: #fff4df;
  color: var(--warning);
  font-size: 11px;
  line-height: 1.35;
  padding: 5px 7px;
}

.own-buyer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.comparison-badge {
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.comparison-badge.better {
  background: #e4f7e9;
  color: #1d7037;
}

.comparison-badge.worse {
  background: #ffe7e7;
  color: #a82424;
}

.comparison-badge.equal {
  background: #eef3f5;
  color: #53616b;
}

.promo-list {
  display: grid;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

.promo-list.promo-count-1 {
  grid-template-columns: minmax(280px, 380px);
}

.promo-list.promo-count-2 {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  min-width: 565px;
}

.promo-list.promo-count-3 {
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  min-width: 760px;
}

.promo-option {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  padding: 5px;
  min-width: 0;
  width: 100%;
}

.promo-shared-tools {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--border);
  margin-top: 5px;
  padding-top: 6px;
}

.promo-shared-tools:empty {
  display: none;
}

.shared-tool-row {
  display: grid;
  grid-template-columns: 70px minmax(150px, 1fr) max-content max-content;
  align-items: center;
  gap: 6px;
}

.shared-tool-row.target {
  grid-template-columns: 70px minmax(230px, 1fr);
}

.shared-tool-row > span {
  color: var(--muted);
  font-size: 12px;
}

.action-custom-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: end;
  gap: 6px;
  border-top: 1px solid #edf2f5;
  padding-top: 5px;
}

.action-custom-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.action-custom-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.action-custom-result {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(70px, 0.75fr) 76px;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  min-width: 0;
}

.action-custom-calc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.action-custom-calc > span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

.action-custom-buttons {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: flex-end;
  width: 76px;
  min-width: 0;
}

.action-custom-buttons .mini-button {
  width: 100%;
  padding-inline: 4px;
  white-space: nowrap;
}

.action-target-result {
  display: grid;
  gap: 4px;
  min-height: 30px;
}

.target-profit-goal {
  width: fit-content;
  border-radius: 999px;
  background: #e8f3f0;
  color: #126b56;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
}

.action-target-profit-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.action-target-profit-line > span {
  min-width: 32px;
  color: var(--muted);
  font-weight: 700;
}

.action-target-profit-line strong {
  min-width: 64px;
  font-size: 12px;
}

.action-target-profit-line em {
  color: var(--accent-2);
  font-style: normal;
  font-weight: 700;
}

.compatible-actions {
  display: inline-flex;
  max-width: 100%;
  border-radius: 999px;
  background: #eef3f5;
  color: #53616b;
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.compatible-actions.warning {
  background: #fff0d8;
  color: var(--warning);
}

.boost-card {
  gap: 4px;
}

.simple-action-card {
  gap: 4px;
}

.promo-option.active {
  border-color: #167f64;
  background: #effaf6;
}

.boost-card-summary,
.boost-card-control,
.simple-action-summary,
.simple-action-tools {
  display: grid;
  align-content: start;
  gap: 6px;
}

.promo-card-head {
  display: grid;
  grid-template-columns: minmax(50px, max-content) max-content max-content 70px;
  align-items: center;
  gap: 4px 6px;
}

.simple-action-card .promo-card-head {
  grid-template-columns: minmax(50px, max-content) max-content 70px;
}

.promo-price {
  font-size: 12px;
}

.promo-card-actions {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  grid-column: -2 / -1;
  grid-row: 1 / span 2;
  align-items: stretch;
  gap: 3px;
  justify-content: center;
  width: 70px;
  min-width: 0;
}

.promo-card-actions .mini-button {
  width: 100%;
  padding-inline: 4px;
  white-space: nowrap;
}

.boost-chip {
  border-radius: 999px;
  background: #e8f3f0;
  color: #126b56;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.boost-meter {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 1px solid #182026;
  border-radius: 999px;
  background: #fff;
}

.boost-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #12df26;
}

.boost-percent {
  color: var(--accent-2);
  font-size: 12px;
  line-height: 1;
  text-align: center;
}

.boost-price-grid {
  display: grid;
  gap: 2px;
  font-size: 12px;
}

.boost-price-row {
  display: grid;
  grid-template-columns: 34px 62px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 4px;
  border-top: 1px solid #edf2f5;
  padding-top: 4px;
}

.promo-card-head > .profit-pair,
.boost-price-row > .profit-pair {
  min-width: 0;
}

.promo-card-head > .profit-pair {
  grid-column: 1 / -2;
  grid-row: 2;
}

.boost-price-grid strong {
  font-weight: 500;
}

.promo-option .profit-pair.compact {
  gap: 3px;
}

.promo-option .profit-pair.compact span {
  padding: 2px 4px;
  font-size: 10.5px;
}

.wb-discount-card .promo-card-head {
  grid-template-columns: minmax(50px, max-content) max-content max-content;
}

.wb-discount-card .promo-card-head > .profit-pair {
  grid-column: 1 / -1;
}

.wb-discount-card.empty .promo-card-head {
  grid-template-columns: minmax(50px, max-content) minmax(0, 1fr);
}

.wb-discount-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  border-top: 1px solid #edf2f5;
  padding-top: 5px;
  font-size: 12px;
}

.wb-discount-details span {
  border-radius: 999px;
  background: #f3f8fa;
  color: #53616b;
  padding: 3px 7px;
}

.promo-list.promo-count-3 .action-custom-row {
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 4px;
}

.promo-list.promo-count-3 .action-custom-result {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.promo-list.promo-count-3 .action-custom-buttons {
  flex-direction: row;
  flex-wrap: wrap;
  width: auto;
  gap: 4px;
}

.promo-list.promo-count-3 .action-custom-buttons .mini-button {
  width: auto;
}

.promo-list.promo-count-3 .target-profit-row {
  grid-template-columns: 30px 60px 42px minmax(64px, max-content);
  gap: 4px;
}

.promo-list.promo-count-3 .target-profit-row .send-price-button {
  grid-column: 4;
}

.custom-boost,
.target-profit {
  display: grid;
  grid-template-columns: 96px minmax(120px, 1fr) max-content;
  align-items: end;
  gap: 6px;
  padding-top: 2px;
}

.target-profit {
  grid-template-columns: 96px minmax(180px, 1fr);
}

.custom-boost label,
.target-profit label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.custom-price-input {
  width: 96px;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 7px;
}

.custom-boost-result,
.target-profit-result {
  display: grid;
  gap: 5px;
  min-height: 34px;
}

.target-profit-row {
  display: grid;
  grid-template-columns: 34px 76px 48px max-content max-content;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.target-profit-row.no-boost {
  grid-template-columns: 34px 76px max-content;
}

.target-profit-row.no-boost:has(.send-price-button) {
  grid-template-columns: 34px 76px max-content;
}

.target-profit-row strong {
  font-size: 13px;
  font-weight: 700;
}

.target-profit-row em {
  color: var(--accent-2);
  font-style: normal;
}

.promo-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  min-width: 0;
}

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

.promo-details {
  border-top: 1px solid #edf2f5;
  padding-top: 2px;
}

.promo-details summary {
  width: fit-content;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1.2;
  list-style: none;
}

.promo-details summary::-webkit-details-marker {
  display: none;
}

.promo-details summary::after {
  content: ' +';
  color: var(--accent-2);
  font-weight: 700;
}

.promo-details[open] summary::after {
  content: ' −';
}

.mini-button {
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #f8fbfc;
  color: var(--text);
  cursor: pointer;
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1.25;
}

.mini-button:hover {
  background: #e8f3f0;
  border-color: #9acabc;
}

.mini-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.send-price-button {
  border-color: #126b56;
  background: #e8f3f0;
  color: #126b56;
  font-weight: 700;
}

.send-price-button:hover {
  background: #d5ebe4;
}

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

.cost-consumables {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.cost-consumables label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.cost-consumables input {
  width: 86px;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 7px;
}

.cost-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.cost-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-button input {
  display: none;
}

.cost-input {
  width: 104px;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
}

.cost-percent {
  width: 76px;
}

.cost-quantity {
  width: 76px;
}

.cost-components {
  width: 220px;
}

.cost-kit {
  width: 170px;
  margin-top: 6px;
}

.kit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #53616b;
  font-size: 12px;
  font-weight: 700;
}

.kit-toggle input {
  width: 15px;
  height: 15px;
}

.cost-input:disabled {
  background: #f4f7f8;
  color: #71808b;
}

.cost-extras {
  width: 240px;
}

.dirty-row {
  background: #fffaf0;
}

.cost-complete-row {
  background: #effaf3;
}

.cost-complete-row:hover {
  background: #e4f6ec;
}

.cost-complete-row.dirty-row {
  background: #eef8db;
}

.cost-complete-row.dirty-row:hover {
  background: #e2f1cc;
}

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

.wb-auto-tools {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.wb-auto-tools .muted {
  font-size: 12px;
}

.wb-auto-files {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}

.wb-auto-file-link {
  display: inline-flex;
  align-items: center;
  max-width: 360px;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-2);
  overflow: hidden;
  padding: 5px 8px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-auto-file-link:hover {
  border-color: #b7ccd8;
  background: #f8fbfc;
}

.rules-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.rule-list {
  display: grid;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.rule-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
}

.rule-row + .rule-row {
  border-top: 1px solid var(--border);
}

.rule-row span {
  color: var(--muted);
}

@media (max-width: 980px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .main {
    height: auto;
    overflow: visible;
    padding: 24px;
  }

  .topbar {
    position: static;
    padding: 0;
  }

  .metrics-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .section-head,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head,
  .view.active > .price-sync-panel,
  .competitor-form {
    position: static;
    top: auto;
    z-index: auto;
  }

  .section-head {
    border-bottom: 0;
    padding: 0;
  }

  .view.active > .price-sync-panel {
    padding-bottom: 0;
  }

  .price-sync-copy {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    justify-content: stretch;
  }

  .search-box {
    min-width: 0;
  }

  .account-row,
  .account-form,
  .competitor-form {
    grid-template-columns: 1fr;
  }

  .profit-ladder-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .bulk-boost-tools,
  .workspace-toggle {
    flex-wrap: wrap;
    border-left: 0;
    padding-left: 0;
  }

  .profit-ladder-panel input {
    width: 100%;
  }

  .boost-card,
  .simple-action-card,
  .promo-card-head,
  .simple-action-card .promo-card-head,
  .boost-price-row,
  .custom-boost,
  .target-profit,
  .action-custom-tools,
  .action-custom-row,
  .action-custom-result,
  .shared-tool-row,
  .shared-tool-row.target {
    grid-template-columns: 1fr;
  }

  .promo-card-actions {
    grid-column: auto;
    justify-content: flex-start;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-head {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-actions {
    justify-content: space-between;
  }

  .notification-modal-list .notification-item {
    grid-template-columns: 1fr;
  }

  .target-profit-row {
    grid-template-columns: 42px 88px 54px max-content max-content;
  }

  .target-profit-row.no-boost,
  .target-profit-row.no-boost:has(.send-price-button) {
    grid-template-columns: 42px 88px max-content;
  }
}
