:root {
  --bg: #f3ede2;
  --bg-deep: #e5d7bf;
  --paper: rgba(255, 251, 245, 0.9);
  --paper-strong: #fffdf9;
  --ink: #22313b;
  --muted: #5f6d77;
  --line: rgba(58, 72, 82, 0.14);
  --accent: #ab5a2a;
  --accent-strong: #8d461e;
  --accent-soft: rgba(171, 90, 42, 0.12);
  --sidebar-bg: rgba(31, 38, 44, 0.94);
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #f6efe5;
  --sidebar-muted: rgba(246, 239, 229, 0.7);
  --success: #1d7d56;
  --warning: #9b6a13;
  --danger: #b33d2f;
  --shadow: 0 28px 60px rgba(54, 42, 28, 0.14);
  --surface: var(--paper-strong);
  --text: var(--ink);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --sidebar-collapsed: 92px;
  --sidebar-expanded: 308px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Bahnschrift", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(171, 90, 42, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(110, 129, 142, 0.14), transparent 22%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.18) 0,
      rgba(255, 255, 255, 0.18) 1px,
      transparent 1px,
      transparent 22px
    ),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 44%, #f6f1e8 100%);
}

h1,
h2,
h3,
.brand-copy strong,
.stat-value,
.module-index {
  font-family: "Constantia", "Palatino Linotype", Georgia, serif;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-strong);
}

code {
  font-family: "Cascadia Code", Consolas, monospace;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: var(--sidebar-collapsed);
  height: 100vh;
  padding: 20px 16px;
  border-right: 1px solid var(--sidebar-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 30%),
    linear-gradient(180deg, rgba(15, 19, 23, 0.96), var(--sidebar-bg));
  box-shadow: 18px 0 42px rgba(17, 22, 26, 0.18);
  overflow: hidden;
  transition: width 220ms ease, box-shadow 220ms ease;
}

.sidebar:hover,
.sidebar:focus-within {
  width: var(--sidebar-expanded);
  box-shadow: 20px 0 50px rgba(17, 22, 26, 0.24);
}

.brand-link,
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-link {
  min-height: 64px;
}

.brand-mark,
.nav-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 14px;
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-mark {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  background: linear-gradient(135deg, rgba(171, 90, 42, 0.95), rgba(112, 61, 31, 0.95));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.sidebar-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.sidebar:hover .sidebar-copy,
.sidebar:focus-within .sidebar-copy {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.brand-copy strong,
.nav-copy strong {
  color: var(--sidebar-text);
  font-size: 1rem;
}

.brand-copy span,
.nav-copy span {
  color: var(--sidebar-muted);
  font-size: 0.88rem;
  line-height: 1.3;
}

.sidebar-nav,
.sidebar-footer {
  display: grid;
  gap: 12px;
}

.sidebar-nav {
  flex: 1 1 auto;
}

.primary-item {
  min-height: 60px;
}

.nav-item {
  min-height: 68px;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.nav-item:hover,
.nav-item:focus-visible {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  outline: none;
}

.nav-item.is-active {
  background: linear-gradient(135deg, rgba(171, 90, 42, 0.28), rgba(171, 90, 42, 0.12));
  border-color: rgba(215, 151, 112, 0.32);
}

.nav-item.is-active .nav-mark {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.nav-copy.is-single-line {
  gap: 0;
}

.primary-item .nav-copy strong {
  font-size: 0.96rem;
  white-space: nowrap;
}

.nav-mark-icon {
  padding: 6px;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.32);
}

.nav-icon-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.utility .nav-copy strong {
  white-space: nowrap;
}

.page-shell {
  margin-left: calc(var(--sidebar-collapsed) + 18px);
  padding: 30px 28px 36px;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px 30px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(171, 90, 42, 0.15);
  background:
    linear-gradient(135deg, rgba(255, 253, 249, 0.9), rgba(245, 235, 219, 0.84)),
    var(--paper-strong);
  box-shadow: var(--shadow);
  animation: rise-in 420ms ease both;
}

.hero-copy-block {
  max-width: 68ch;
}

.hero-branding-image {
  display: block;
  width: min(520px, 100%);
  margin: 0 auto 18px;
  object-fit: contain;
}

.page-hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(2rem, 3.2vw, 3.5rem);
  line-height: 0.98;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.hero-copy,
.muted {
  color: var(--muted);
}

.hero-copy {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.content,
.settings-layout,
.dashboard-grid,
.info-grid,
.status-grid,
.module-detail-grid {
  display: grid;
  gap: 22px;
}

.content {
  margin-top: 24px;
}

.info-grid,
.module-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 18px;
}

.card-grid,
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 250, 244, 0.92)),
    var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise-in 500ms ease both;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 40%);
  pointer-events: none;
}

.card > * {
  position: relative;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

.spotlight {
  background:
    radial-gradient(circle at top right, rgba(171, 90, 42, 0.16), transparent 22%),
    linear-gradient(135deg, rgba(255, 250, 244, 0.96), rgba(247, 239, 228, 0.92));
}

.stat-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.stat-label,
.status-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-value {
  font-size: clamp(1.9rem, 2.6vw, 2.8rem);
  line-height: 1;
}

.module-card {
  display: grid;
  gap: 14px;
}

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

.module-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(171, 90, 42, 0.18), rgba(171, 90, 42, 0.08));
  color: var(--accent-strong);
  font-size: 1.25rem;
  font-weight: 700;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  line-height: 1.55;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
  box-shadow: 0 12px 24px rgba(141, 70, 30, 0.22);
}

.button:hover,
.button:focus-visible,
button.button:hover,
button.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 16px 28px rgba(141, 70, 30, 0.28);
}

.button.secondary,
.button.secondary:visited {
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  border-color: rgba(34, 49, 59, 0.12);
  box-shadow: none;
}

.hero-action {
  white-space: nowrap;
}

.section-dashboard .page-shell {
  min-height: 100vh;
}

.section-dashboard .page-hero {
  min-height: calc(100vh - 72px);
  align-items: center;
  justify-content: center;
  padding: 40px 56px;
  text-align: center;
}

.section-dashboard .hero-copy-block {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  justify-items: center;
}

.section-dashboard .page-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(3rem, 5vw, 4.8rem);
  line-height: 0.96;
}

.section-dashboard .hero-copy {
  max-width: 32ch;
  margin: 0 auto;
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
}

.section-dashboard .content {
  margin-top: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-ok {
  color: var(--success);
  background: rgba(29, 125, 86, 0.12);
}

.badge-warn {
  color: var(--warning);
  background: rgba(155, 106, 19, 0.14);
}

.badge-error {
  color: var(--danger);
  background: rgba(179, 61, 47, 0.13);
}

.badge-soft {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(34, 49, 59, 0.08);
}

.flash-stack {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.flash {
  padding: 15px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  box-shadow: var(--shadow);
}

.flash-success {
  background: rgba(29, 125, 86, 0.12);
  color: var(--success);
  border-color: rgba(29, 125, 86, 0.18);
}

.flash-error {
  background: rgba(179, 61, 47, 0.12);
  color: var(--danger);
  border-color: rgba(179, 61, 47, 0.18);
}

.section-head,
.session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.stack-form,
.cabinet-stack,
.auth-form,
.session-meta {
  display: grid;
  gap: 14px;
}

.cabinet-card,
.status-panel,
.session-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(34, 49, 59, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(252, 247, 240, 0.94));
}

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

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(34, 49, 59, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(171, 90, 42, 0.18);
  border-color: rgba(171, 90, 42, 0.36);
}

input::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(171, 90, 42, 0.12);
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.report-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  line-height: 1.55;
}

.scroll-panel {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 6px;
}

.scroll-panel::-webkit-scrollbar {
  width: 10px;
}

.scroll-panel::-webkit-scrollbar-thumb {
  background: rgba(95, 109, 119, 0.36);
  border-radius: 999px;
}

.inline-form {
  margin: 0;
}

.auth-body {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px;
  position: relative;
  overflow: hidden;
}

.auth-shell-ripple {
  isolation: isolate;
}

.auth-ripple-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.auth-card {
  width: min(100%, 540px);
  padding: 30px;
  border-radius: 32px;
  border: 1px solid rgba(171, 90, 42, 0.16);
  background:
    radial-gradient(circle at top right, rgba(171, 90, 42, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(255, 253, 249, 0.97), rgba(243, 232, 215, 0.95));
  box-shadow: var(--shadow);
  display: grid;
  gap: 22px;
  position: relative;
  z-index: 1;
}

.auth-branding-image {
  display: block;
  width: min(360px, 100%);
  margin: 0 auto 12px;
  object-fit: contain;
}

.auth-copy h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.02;
  text-align: center;
}

.auth-copy p {
  margin: 0;
}

.auth-copy .eyebrow,
.auth-copy .hero-copy {
  text-align: center;
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.instruction-box {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(34, 49, 59, 0.18);
  background: rgba(255, 252, 246, 0.82);
}

.instruction-box ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

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

.calc-path {
  word-break: break-word;
}

.settings-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  color: var(--muted);
}

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

.account-access-block {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.settings-client-toolbar {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-stack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.account-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(34, 49, 59, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(252, 247, 240, 0.96));
}

.account-card h3 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

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

.permission-option,
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(58, 72, 82, 0.12);
  background: rgba(255, 255, 255, 0.78);
  font-weight: 600;
}

.checkbox-field-inline {
  width: fit-content;
  max-width: 100%;
}

.ozon-scope-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ozon-scope-fieldset legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--ink);
  font-weight: 700;
}

.ozon-scope-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ozon-scope-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(58, 72, 82, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-weight: 650;
}

.stack-form .ozon-scope-option input[type="radio"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 18px;
}

.ozon-scope-option span {
  min-width: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.permission-option input,
.checkbox-field input {
  width: auto;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}

.permission-option span,
.checkbox-field span {
  line-height: 1.35;
}

.settings-meta-line {
  margin: 0;
  font-size: 0.88rem;
}

.calc-toolbar-grid {
  grid-template-columns: minmax(0, 1fr);
}

.calc-table-head {
  align-items: end;
  gap: 16px;
}

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

.field-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.source-actions {
  margin-top: 14px;
}

.stack-form textarea,
.stack-form input,
.stack-form select,
.calc-filter-form textarea,
.calc-filter-form input,
.calc-filter-form select,
.calc-page-form textarea,
.calc-page-form input,
.calc-page-form select,
.row-editor textarea,
.row-editor input,
.row-editor select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(58, 72, 82, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
}

.stack-form .permission-option input[type="checkbox"],
.stack-form .checkbox-field input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 18px;
}

.compact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  align-content: start;
}

.row-editor {
  display: grid;
  gap: 8px;
  align-content: start;
}

.compact-form-grid label,
.calc-filter-form label,
.row-editor label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.row-editor-static {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}

.row-editor-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
}

.wide-field {
  display: grid;
}

.readonly-field {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(58, 72, 82, 0.12);
  border-radius: 14px;
  background: rgba(245, 239, 230, 0.7);
  color: var(--muted);
  font-size: 0.82rem;
}

.readonly-field strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.calc-table-card {
  overflow: hidden;
}

.calc-filter-toolbar {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(58, 72, 82, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.calc-filter-form {
  display: grid;
  gap: 12px;
}

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

.calc-page-form {
  display: grid;
  gap: 6px;
  min-width: 160px;
}

.calc-page-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.identifier-list-panel {
  display: grid;
  gap: 12px;
  padding-top: 6px;
}

.identifier-list-panel textarea {
  min-height: 112px;
  resize: vertical;
}

.calc-empty-state {
  display: grid;
  gap: 12px;
  padding: 16px 0 4px;
}

.calc-table-scroll {
  max-height: 76vh;
  overflow: auto;
  padding-right: 6px;
}

.calc-table {
  width: 100%;
  min-width: 1480px;
  border-collapse: separate;
  border-spacing: 0 14px;
}

.calc-table > thead > tr > th {
  padding: 0 10px 10px;
  text-align: left;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(243, 237, 226, 0.96);
}

.calc-table > tbody > tr > td {
  vertical-align: top;
  padding: 0 10px;
}

.calc-table > tbody > tr > td {
  background: rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(58, 72, 82, 0.08);
  border-bottom: 1px solid rgba(58, 72, 82, 0.08);
}

.calc-table > tbody > tr > td:first-child {
  border-left: 1px solid rgba(58, 72, 82, 0.08);
  border-radius: 18px 0 0 18px;
}

.calc-table > tbody > tr > td:last-child {
  border-right: 1px solid rgba(58, 72, 82, 0.08);
  border-radius: 0 18px 18px 0;
}

.repricer-toolbar-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(160px, 0.72fr)) minmax(110px, 0.42fr);
}

.multi-filter {
  min-width: 0;
  align-self: end;
  border: 1px solid rgba(95, 111, 120, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  position: relative;
}

.multi-filter summary {
  cursor: pointer;
  padding: 11px 13px;
  font-weight: 700;
  color: var(--ink, #25333b);
  list-style-position: inside;
}

.multi-filter-options {
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 7px;
  padding: 0 12px 12px;
}

.multi-filter-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-weight: 500;
}

.multi-filter-options input {
  width: auto;
  margin-top: 3px;
}

.repricer-price-visibility {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(58, 72, 82, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
}

.repricer-price-visibility legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.repricer-price-visibility .checkbox-field-inline {
  margin: 0;
}

.repricer-pagination {
  align-items: center;
}

.repricer-dialog {
  width: min(680px, calc(100vw - 32px));
  border: 0;
  border-radius: 20px;
  padding: 24px;
  color: var(--text);
  background: #fffdf9;
  box-shadow: 0 24px 70px rgba(31, 42, 48, 0.28);
}

.repricer-import-preview-dialog {
  width: min(1040px, calc(100vw - 32px));
}

.repricer-import-warning {
  padding: 14px 16px;
  border: 1px solid rgba(177, 116, 18, 0.28);
  border-radius: 14px;
  color: #704a0a;
  background: #fff5d9;
}

.repricer-import-warning ul {
  max-height: 180px;
  overflow: auto;
  margin: 10px 0;
  padding-left: 22px;
}

.repricer-import-preview-list {
  max-height: min(52vh, 520px);
  overflow: auto;
  border: 1px solid rgba(58, 72, 82, 0.1);
  border-radius: 14px;
}

.repricer-dialog::backdrop {
  background: rgba(25, 34, 39, 0.48);
  backdrop-filter: blur(3px);
}

.repricer-dialog textarea {
  width: 100%;
  resize: vertical;
  min-height: 180px;
}

.repricer-table {
  min-width: 1120px;
  table-layout: fixed;
}

.repricer-col-index {
  width: 56px;
}

.repricer-col-product {
  width: 320px;
}

.repricer-col-article1c {
  width: 150px;
}

.repricer-col-cabinet {
  width: 180px;
}

.repricer-col-article {
  width: 132px;
}

.repricer-col-seller {
  width: 150px;
}

.repricer-col-barcode {
  width: 146px;
}

.repricer-col-price {
  width: 118px;
}

.repricer-col-target-price {
  width: 112px;
}

.repricer-col-strategy {
  width: 164px;
}

.repricer-control-badge {
  margin-top: 4px;
  font-size: 10px;
}

.repricer-table input[type="number"],
.repricer-table select {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  font-size: 12px;
}

.repricer-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.repricer-table small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repricer-table > tbody > tr > td {
  padding: 10px 12px;
  border-radius: 0;
}

.repricer-table > tbody > tr > td:first-child,
.repricer-table > tbody > tr > td:last-child {
  border-radius: 0;
}

.repricer-table > tbody > tr.repricer-product-start > td {
  border-top: 1px solid rgba(58, 72, 82, 0.08);
}

.repricer-table > tbody > tr.repricer-side-row-wb > td:not(.repricer-shared-cell) {
  border-bottom: 1px dashed rgba(58, 72, 82, 0.08);
}

.repricer-table > tbody > tr.repricer-side-row-ozon > td:not(.repricer-shared-cell),
.repricer-table > tbody > tr.repricer-side-row-single > td:not(.repricer-shared-cell) {
  border-bottom: 1px solid rgba(58, 72, 82, 0.08);
}

.repricer-table > tbody > tr.repricer-row-controlled > td:not(.repricer-shared-cell) {
  background: rgba(47, 143, 105, 0.08);
}

.repricer-table > tbody > tr.repricer-row-controlled > td:first-child:not(.repricer-shared-cell) {
  box-shadow: inset 3px 0 0 rgba(47, 143, 105, 0.58);
}

.repricer-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle !important;
}

.repricer-name-cell {
  white-space: normal;
}

.repricer-shared-cell {
  background: rgba(255, 255, 255, 0.82) !important;
  vertical-align: top !important;
}

.repricer-name-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.26;
  min-height: 2.52em;
  font-weight: 600;
  color: var(--text);
}

.repricer-text-cell {
  color: var(--text);
  font-weight: 600;
}

.repricer-number-cell {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.repricer-inline-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.repricer-market-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.repricer-market-badge {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.repricer-market-badge.is-wb {
  background: rgba(92, 133, 184, 0.16);
  color: #355b8b;
}

.repricer-market-badge.is-ozon {
  background: rgba(61, 112, 194, 0.14);
  color: #1f5db6;
}

.repricer-status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(58, 72, 82, 0.12);
}

.repricer-status-dot.is-ok {
  background: #74b286;
}

.repricer-status-dot.is-missing {
  background: #d39a57;
}

.calc-index {
  width: 56px;
  font-weight: 700;
  text-align: center;
  color: var(--accent-strong);
}

.select-col {
  width: 52px;
  text-align: center;
}

.select-cell {
  padding-top: 18px;
}

.product-cell,
.inputs-cell,
.scenarios-cell {
  padding-top: 16px;
  padding-bottom: 16px;
}

.product-cell {
  min-width: 290px;
  display: grid;
  gap: 5px;
}

.product-cell span {
  color: var(--muted);
  line-height: 1.28;
}

.warning-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.inputs-cell {
  min-width: 320px;
}

.row-editor textarea,
.row-editor input,
.row-editor select {
  padding: 6px 10px;
  min-height: 34px;
  line-height: 1.15;
}

.row-editor textarea {
  min-height: 34px;
  max-height: 34px;
  overflow-y: auto;
  resize: none;
}

.row-editor-submit {
  justify-self: start;
  padding-inline: 20px;
}

.calc-bulk-card {
  min-width: 0;
  width: 100%;
}

.scenarios-cell {
  min-width: 860px;
}

.scenario-compare {
  overflow: hidden;
  border: 1px solid rgba(171, 90, 42, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.94), rgba(245, 237, 226, 0.72));
}

.scenario-compare-table {
  width: 100%;
  border-collapse: collapse;
}

.scenario-compare-table th,
.scenario-compare-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(58, 72, 82, 0.08);
}

.scenario-compare-table thead th {
  position: static;
  top: auto;
  z-index: auto;
  background: rgba(239, 232, 220, 0.76);
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.scenario-compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.scenario-name-cell {
  min-width: 152px;
}

.scenario-name-cell strong {
  display: block;
  font-size: 0.94rem;
}

.scenario-number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.repricer-process-panel {
  padding-block: 18px;
}

.repricer-process-summary,
.repricer-process-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.repricer-process-summary {
  margin-bottom: 14px;
}

.repricer-process-dashboard {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(520px, 1.55fr);
  gap: 14px;
  align-items: stretch;
}

.repricer-process-queue,
.repricer-process-detail {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(58, 72, 82, 0.12);
  border-radius: 18px;
  background: rgba(255, 253, 250, 0.78);
}

.repricer-process-column-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.repricer-process-column-head h3,
.repricer-process-detail h3 {
  margin: 0;
}

.repricer-process-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 3px;
}

.repricer-process-item {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(58, 72, 82, 0.12);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.84);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.repricer-process-item:hover,
.repricer-process-item.is-selected {
  border-color: rgba(171, 90, 42, 0.42);
  background: rgba(249, 239, 228, 0.9);
}

.repricer-process-item.is-selected {
  transform: translateX(2px);
  box-shadow: inset 3px 0 0 var(--accent);
}

.repricer-process-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.repricer-process-item progress,
.repricer-process-detail progress {
  width: 100%;
  height: 10px;
}

.repricer-process-detail > progress {
  margin-bottom: 16px;
}

.repricer-process-counts {
  margin-top: 10px;
}

.repricer-process-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(125px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.repricer-process-metric {
  display: grid;
  gap: 3px;
  min-height: 98px;
  padding: 12px;
  border: 1px solid rgba(58, 72, 82, 0.1);
  border-radius: 14px;
  background: rgba(247, 243, 236, 0.68);
}

.repricer-process-metric span,
.repricer-process-metric small {
  color: var(--muted);
}

.repricer-process-metric strong {
  font-size: 1.55rem;
  line-height: 1;
}

.repricer-process-metric.is-success {
  background: rgba(224, 239, 228, 0.72);
}

.repricer-process-metric.is-active,
.repricer-process-metric.is-recalc {
  background: rgba(245, 232, 207, 0.74);
}

.repricer-process-metric.is-error {
  background: rgba(247, 222, 218, 0.7);
}

.repricer-process-empty {
  display: grid;
  place-content: center;
  min-height: 260px;
  text-align: center;
}

@media (max-width: 1120px) {
  .repricer-process-dashboard {
    grid-template-columns: 1fr;
  }

  .repricer-process-list {
    max-height: 360px;
  }
}

@media (max-width: 1180px) {
  .primary-item .nav-copy strong {
    white-space: normal;
  }
}

@media (max-width: 880px) {
  .calc-summary-grid,
  .calc-toolbar-grid {
    grid-template-columns: 1fr;
  }

  .calc-filter-grid {
    grid-template-columns: 1fr;
  }

  .compact-form-grid,
  .row-editor-static {
    grid-template-columns: 1fr;
  }

  .row-editor-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scenarios-cell {
    min-width: 760px;
  }

  .sidebar {
    position: sticky;
    width: auto;
    height: auto;
    margin: 0 14px;
    border-radius: 0 0 24px 24px;
    padding: 14px;
  }

  .sidebar:hover,
  .sidebar:focus-within {
    width: auto;
  }

  .sidebar-copy {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .sidebar-nav,
  .sidebar-footer {
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .page-shell {
    margin-left: 0;
    padding: 18px 14px 30px;
  }

  .page-hero {
    flex-direction: column;
    padding: 24px 22px;
  }

  .section-dashboard .page-hero {
    min-height: auto;
    padding: 28px 24px;
  }

  .hero-meta {
    justify-content: flex-start;
  }
}

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

  .repricer-process-dashboard {
    grid-template-columns: minmax(0, 1fr);
  }

  .repricer-process-queue,
  .repricer-process-detail {
    padding: 12px;
  }

  .ozon-scope-options {
    grid-template-columns: 1fr;
  }

  .settings-inline-grid {
    grid-template-columns: 1fr;
  }

  .row-editor-fields {
    grid-template-columns: 1fr;
  }

  .page-hero h1 {
    font-size: 2.1rem;
  }

  .section-dashboard .page-hero h1 {
    font-size: 2.5rem;
  }

  .card,
  .auth-card {
    padding: 20px;
  }

  .section-head,
  .session-header {
    flex-direction: column;
  }

  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .repricer-toolbar-grid {
    grid-template-columns: 1fr;
  }

  .button,
  button.button {
    width: 100%;
  }

  .sidebar-nav,
  .sidebar-footer {
    grid-auto-columns: minmax(180px, 1fr);
  }
}

.price-calc-toolbar,
.price-calc-product-card,
.price-calc-market-card {
  display: grid;
  gap: 8px;
}

.price-calc-mode-switch,
.price-calc-actions,
.price-calc-product-head > div,
.price-calc-market-title,
.price-calc-price-grid {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.price-calc-scenario-form {
  max-width: 420px;
}

.price-calc-scenario-form label,
.price-calc-market-card label {
  display: grid;
  gap: 6px;
}

.price-calc-settings {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}

.price-calc-settings summary {
  cursor: pointer;
  font-weight: 700;
}

.price-calc-settings[open] summary {
  margin-bottom: 14px;
}

.price-calc-catalog {
  display: grid;
  gap: 8px;
}

.price-calc-product-card {
  padding: 10px 12px;
}

.price-calc-product-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.price-calc-product-head > div {
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}

.price-calc-product-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.price-calc-market-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  align-content: start;
}

.price-calc-market-card.is-wb {
  background: rgba(123, 44, 255, 0.035);
}

.price-calc-market-card.is-ozon {
  background: rgba(23, 105, 255, 0.035);
}

.price-calc-price-grid > span {
  display: grid;
  gap: 2px;
  min-width: 72px;
  color: var(--muted);
  font-size: 11px;
}

.price-calc-price-grid strong {
  color: var(--ink);
}

.price-calc-row-form {
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.price-calc-row-form .compact-form-grid,
.price-calc-bulk-panel .compact-form-grid {
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  align-items: end;
  gap: 6px;
}

.price-calc-row-form input,
.price-calc-bulk-panel input {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.price-calc-row-form label,
.price-calc-bulk-panel label {
  gap: 2px;
  font-size: 11px;
}

.price-calc-row-status,
.price-calc-bulk-status {
  min-height: 14px;
  color: var(--muted);
  font-size: 10px;
}

.price-calc-identifier-filter,
.price-calc-bulk-panel {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.price-calc-identifier-filter summary,
.price-calc-bulk-panel summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.price-calc-identifier-filter[open] summary,
.price-calc-bulk-panel[open] summary {
  margin-bottom: 8px;
}

.price-calc-identifier-filter label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.price-calc-identifier-filter textarea {
  width: 100%;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
}

.repricer-economics-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.repricer-economics-trigger {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid rgba(171, 90, 42, 0.28);
  border-radius: 50%;
  background: rgba(171, 90, 42, 0.1);
  color: var(--accent);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.repricer-economics-trigger:hover,
.repricer-economics-trigger:focus-visible {
  background: var(--accent);
  color: white;
  outline: none;
}

.repricer-economics-popover {
  position: fixed;
  z-index: 1000;
  min-width: 220px;
  max-width: 320px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 14px 36px rgba(58, 72, 82, 0.18);
  text-align: left;
  white-space: normal;
}

.price-calc-result-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(74px, 1fr));
  gap: 4px;
  margin-top: 6px;
}

.price-calc-result-grid > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(58, 72, 82, 0.08);
  border-radius: 9px;
  background: rgba(245, 239, 230, 0.62);
}

.price-calc-result-grid small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-calc-result-grid strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.repricer-economics-popover:not([hidden]) {
  display: grid;
  gap: 6px;
}

@media (max-width: 900px) {
  .price-calc-market-grid {
    grid-template-columns: 1fr;
  }

  .price-calc-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .price-calc-row-form .compact-form-grid,
  .price-calc-bulk-panel .compact-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.data-quality-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  width: min(360px, calc(100vw - 36px));
  padding: 16px 42px 16px 16px;
  border: 1px solid rgba(169, 79, 29, 0.28);
  border-radius: 16px;
  background: #fff8ed;
  box-shadow: 0 14px 36px rgba(48, 36, 27, 0.2);
  color: var(--text);
  animation: data-quality-pulse 1.4s ease-in-out infinite;
}

.data-quality-notice[hidden] {
  display: none;
}

.data-quality-notice p {
  margin: 7px 0;
  color: var(--muted);
}

.data-quality-notice a {
  color: #a94f1d;
  font-weight: 700;
}

.data-quality-notice-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}

@keyframes data-quality-pulse {
  0%, 100% { box-shadow: 0 14px 36px rgba(48, 36, 27, 0.18); }
  50% { box-shadow: 0 14px 42px rgba(169, 79, 29, 0.38); }
}

@media (prefers-reduced-motion: reduce) {
  .data-quality-notice {
    animation: none;
  }
}
