:root {
  color-scheme: dark;
  --bg: #050b14;
  --bg-deep: #030810;
  --panel: #0a1524;
  --panel-2: #0e1c2e;
  --panel-3: #12243a;
  --line: #203752;
  --line-strong: #315579;
  --text: #f4f9ff;
  --muted: #91a8c2;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --accent-soft: #7dd3fc;
  --green: #5ee0a0;
  --red: #ff7d89;
  --yellow: #ffd166;
  --shadow: 0 18px 55px rgba(0, 8, 20, .38);
  --focus: 0 0 0 3px rgba(56, 189, 248, .18);
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 18% -8%, #11375a 0, transparent 34%), linear-gradient(180deg, var(--bg), var(--bg-deep)); }
body.menu-open { overflow: hidden; }
a { color: var(--accent-soft); }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; border: 1px solid transparent; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-strong), #0284c7); color: #fff;
  padding: 9px 15px; font-weight: 760; text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 22px rgba(14, 165, 233, .18); transition: border-color .15s, background .15s, transform .15s, filter .15s;
}
button:hover, .button:hover { filter: brightness(1.08); }
button:active, .button:active { transform: translateY(1px); }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
button.secondary, .button.secondary { background: var(--panel-2); border-color: var(--line); box-shadow: none; color: var(--text); }
button.secondary:hover, .button.secondary:hover { background: var(--panel-3); border-color: var(--line-strong); }
.button.danger, button.danger { background: #501923; border-color: #8d3441; }
.button.ghost, button.ghost { background: transparent; border-color: var(--line); box-shadow: none; }
.button.small, button.small { min-height: 30px; padding: 5px 9px; font-size: 12px; }
button[disabled], .button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; filter: none; }
input, select, textarea {
  background: #071321; border: 1px solid #29445f; color: var(--text); border-radius: 7px;
  min-height: 38px; padding: 8px 10px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--focus); }
input::placeholder { color: #7187a1; }
code { border: 1px solid var(--line); border-radius: 5px; background: #07111e; padding: 1px 5px; color: #cceeff; }

table { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; z-index: 2; background: #102035; color: #b9cce0; font-size: 11px; text-transform: uppercase; letter-spacing: .055em; }
tbody tr:hover { background: #0e1d2f; }
tbody tr:last-child td { border-bottom: 0; }
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); scrollbar-color: #315579 #081321; }
.code { font-family: "SFMono-Regular", Consolas, monospace; white-space: nowrap; }
.money { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.danger-text, .danger { color: var(--red); }
.success { color: var(--green); }
.warning { color: var(--yellow); }
.nowrap { white-space: nowrap; }

.brand-main { color: #f7fbff; }
.brand-accent { color: var(--accent); text-shadow: 0 0 24px rgba(56, 189, 248, .28); }
.app-shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; z-index: 30; height: 100vh; display: flex; flex-direction: column;
  padding: 20px 13px; overflow-y: auto; background: rgba(5, 13, 24, .97); border-right: 1px solid var(--line);
  box-shadow: 12px 0 38px rgba(0, 5, 14, .15);
}
.office-brand, .public-brand { font-weight: 950; letter-spacing: .025em; text-decoration: none; }
.office-brand { display: block; padding: 5px 10px 20px; font-size: 23px; }
.nav-label { display: block; color: #647f9d; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; padding: 13px 10px 5px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a, .sidebar-foot a, .sidebar-foot button {
  display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: none; box-shadow: none;
  color: #c7d6e7; text-align: left; text-decoration: none; font-size: 13px; font-weight: 620;
}
.sidebar nav a:hover, .sidebar-foot a:hover, .sidebar-foot button:hover { background: #10243b; color: #fff; filter: none; }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(14,165,233,.24), rgba(14,165,233,.07)); color: #fff; border-left: 3px solid var(--accent); padding-left: 7px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.role-badge { margin: 5px 10px 8px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.office-main { min-width: 0; width: 100%; max-width: 1900px; margin: 0 auto; padding: 26px; }
.mobile-bar, .sidebar-backdrop { display: none; }
.message { padding: 11px 14px; background: #103524; border: 1px solid #2f7650; border-radius: 8px; margin-bottom: 13px; }
.message.error { background: #35151c; border-color: #7d3340; }
.message.warning { background: #3a2e11; border-color: #7a6428; color: #ffe8a3; }
.monthly-report-alert { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; margin-bottom: 16px; border: 1px solid #8a6e26; border-radius: 10px; background: #3a2e11; color: #fff3bd; }
.monthly-report-alert.is-overdue { background: #3b171d; border-color: #9b3949; color: #ffd8de; }
.monthly-report-alert div { display: grid; gap: 4px; }
.monthly-report-alert span { font-size: 13px; line-height: 1.45; }
.monthly-report-alert .button { flex: 0 0 auto; }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.title-row h1, h1 { margin: 0 0 5px; font-size: 26px; line-height: 1.2; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.notice { margin: 14px 0; padding: 13px 15px; border: 1px solid #285b7d; border-radius: 9px; background: #0b2135; color: #d5eaff; line-height: 1.5; }
.panel h2 { margin: 0 0 13px; font-size: 18px; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 0; }
.details-grid div { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(14, 28, 46, .65); }
.details-grid dt { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.details-grid dd { margin: 0; overflow-wrap: anywhere; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 14px 0; }
.metric { background: linear-gradient(180deg, var(--panel), #07111e); border: 1px solid var(--line); border-radius: 10px; padding: 15px; box-shadow: var(--shadow); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; margin: 6px 0 4px; font-size: 25px; }
.metric small { font-size: 11px; line-height: 1.4; }
.compact-list { margin: 0; padding-left: 20px; }
.compact-list li { margin: 7px 0; line-height: 1.45; }
.form-stack { display: grid; gap: 12px; margin-top: 14px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(7, 19, 33, .72); cursor: pointer; }
.checkbox-row input { width: auto; min-height: auto; margin-top: 3px; }
.checkbox-row span { display: grid; gap: 3px; }
.checkbox-row small { color: var(--muted); line-height: 1.4; }
.field-error { color: var(--red); font-size: 12px; }

.filter-panel, .search { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); padding: 12px; border-radius: 10px; margin: 14px 0; }
.filter-panel label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.filter-panel .grow { flex: 1; min-width: 220px; }
.filter-panel .grow input { width: 100%; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; margin: 14px 0; }
.card, section, .form-card, .panel { background: linear-gradient(180deg, var(--panel), #07111e); border: 1px solid var(--line); border-radius: 10px; padding: 17px; box-shadow: var(--shadow); }
.card span { color: var(--muted); font-size: 12px; }
.card b { display: block; font-size: 24px; margin-top: 6px; }
.card-link { color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-top: 16px; }
.form-card { max-width: 820px; margin: 0 auto; }
.form-card p { position: relative; display: grid; gap: 6px; margin: 0 0 15px; }
.form-card label { font-weight: 700; }
.form-card input, .form-card select, .form-card textarea { width: 100%; }
.form-card .helptext { color: var(--muted); font-size: 12px; line-height: 1.45; }
.form-card ul.errorlist { color: #ff9aa3; margin: 0; padding-left: 18px; }
.form-actions { display: flex; gap: 9px; margin-top: 20px; }

.pagination { display: grid; justify-items: center; gap: 9px; padding: 18px 6px 5px; }
.pagination-summary { color: var(--muted); font-size: 12px; }
.pagination-pages { display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; }
.page-link { min-width: 34px; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: #cfe2f6; text-decoration: none; font-weight: 680; }
.page-link:hover { border-color: var(--line-strong); background: var(--panel-3); color: #fff; }
.page-link.is-current { border-color: var(--accent); background: linear-gradient(135deg, #0c8fc8, #0874ad); color: #fff; box-shadow: 0 7px 18px rgba(14,165,233,.18); }
.page-prev, .page-next { padding-inline: 12px; }
.page-ellipsis { color: var(--muted); padding: 0 3px; }

.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; background: #153a25; color: #82e6a8; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-changed, .status-preview { background: #3d3013; color: #ffd86d; }
.status-error, .status-cancelled, .status-archive { background: #431a23; color: #ff9ca5; }
.status-draft { background: #123a62; color: #8bc9ff; }
.status-published { background: #123d29; color: #77e2a3; }
.status-muted { background: #202d3c; color: #b7c6d7; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }

.public-wrap { max-width: 1450px; margin: 0 auto; padding: 22px; }
.public-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 16px; }
.public-brand { display: inline-block; font-size: 30px; }
.public-meta { color: var(--muted); font-size: 12px; margin-top: 5px; }
.public-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.office-entry { border-color: #2b6587 !important; }
.public-panel { background: rgba(10, 21, 36, .94); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.public-tools { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.public-tools input { flex: 1; min-width: 240px; }
.result-line { margin: 6px 2px 10px; color: var(--muted); font-size: 12px; }
.result-line b { color: var(--text); }
.public-table td:nth-child(3), .public-table th:nth-child(3) { text-align: center; }
.public-table tbody tr:nth-child(even) { background: rgba(110, 190, 255, .018); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(460px, 100%); background: rgba(10,21,36,.97); border: 1px solid var(--line); padding: 28px; border-radius: 13px; box-shadow: var(--shadow); }
.login-brand { font-size: 27px; margin-bottom: 24px; }
.login-card h1 { font-size: 24px; }
.login-intro { color: var(--muted); margin: 0 0 22px; line-height: 1.5; }
.login-card p { display: grid; gap: 6px; }
.login-card input { width: 100%; }
.login-card > button { width: 100%; margin-top: 6px; }
.local-login-hint { display: grid; gap: 6px; margin-top: 18px; padding: 12px; border: 1px solid #28516f; border-radius: 8px; background: #0b2034; color: #bdd1e5; font-size: 12px; line-height: 1.45; }
.local-login-hint b { color: #fff; }
.back-link { display: block; text-align: center; margin-top: 18px; color: var(--muted); }

.inline-form { display: inline; }
.quick-input { width: 100%; min-width: 85px; padding: 6px 7px; min-height: 32px; }
.quick-name { min-width: 260px; }
.quick-category { min-width: 150px; }
.checkbox-cell { text-align: center; }
.diff-added { border-left: 3px solid var(--green); }
.diff-changed { border-left: 3px solid var(--yellow); }
.diff-removed { border-left: 3px solid var(--red); }
.audit-diff { display: grid; gap: 4px; min-width: 220px; }
.audit-line { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.audit-line span:first-child { color: var(--muted); }
.autocomplete-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 40; background: #0d1b2c; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); max-height: 270px; overflow: auto; }
.autocomplete-results button { display: block; width: 100%; text-align: left; background: none; box-shadow: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px; color: var(--text); }
.autocomplete-results button:hover, .autocomplete-results button.is-active { background: #17324e; filter: none; }
.metric-note { font-size: 11px; color: var(--muted); margin-top: 4px; }
.toolbar-note { padding: 10px 12px; border: 1px solid #36536d; background: #0f2032; border-radius: 8px; color: #c8d9ea; }
.error-box { background: #35171d; border: 1px solid #7a303c; padding: 13px; border-radius: 8px; }
.warning-box { background: #372d13; border: 1px solid #765e23; padding: 13px; border-radius: 8px; }
.problems { padding-left: 20px; }
.problems li { margin: 8px 0; }
.spaced-top { margin-top: 16px; }
.confirmation { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.confirmation input { width: auto; }

@media (max-width: 900px) {
  .app-shell { display: block; }
  .mobile-bar { display: flex; position: sticky; top: 0; z-index: 50; align-items: center; justify-content: space-between; background: rgba(5,13,24,.98); border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .mobile-bar .office-brand { padding: 3px 0; font-size: 20px; }
  .menu-button { min-height: 34px; padding: 6px 10px; }
  .sidebar { display: flex; position: fixed; inset: 0 auto 0 0; width: min(310px, 87vw); height: 100vh; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 55px rgba(0,0,0,.5); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0, 5, 12, .68); backdrop-filter: blur(2px); }
  .sidebar-backdrop[hidden] { display: none; }
  .office-main { padding: 13px; }
  .monthly-report-alert { align-items: stretch; flex-direction: column; }
  .monthly-report-alert .button { text-align: center; }
  .public-wrap { padding: 10px; }
  .public-head { align-items: flex-start; flex-direction: column; }
  .public-actions { width: 100%; }
  .public-actions .button { flex: 1; }
  .public-tools { align-items: stretch; }
  .public-tools > * { width: 100%; }
  .title-row { flex-direction: column; }
  .filter-panel { align-items: stretch; }
  .filter-panel > * { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .table-scroll { border-radius: 7px; }
  .public-table th:nth-child(1), .public-table td:nth-child(1) { width: 110px; }
  .quick-category { min-width: 130px; }
  .actions { width: 100%; }
  .actions .button, .actions button { flex: 1; }
  .card b { font-size: 20px; }
}

@media (max-width: 560px) {
  .public-table th, .public-table td { padding: 8px 6px; font-size: 12px; }
  .public-table th:nth-child(1), .public-table td:nth-child(1) { width: 90px; }
  .public-table th:nth-child(3), .public-table td:nth-child(3) { width: 90px; }
  .public-brand { font-size: 24px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 13px; }
  .card b { font-size: 18px; }
  .page-prev, .page-next { font-size: 0; }
  .page-prev::after { content: "←"; font-size: 14px; }
  .page-next::after { content: "→"; font-size: 14px; }
  .page-edge { display: none; }
  .login-card { padding: 22px 18px; }
}

.public-description { max-width: 760px; margin: 7px 0 0; color: #c6d7e8; line-height: 1.5; }
.public-footer { margin-top: 14px; padding: 14px 4px 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.public-footer p { margin: 0; }
.public-contacts { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 8px; color: #d9e7f5; }
.security-hint { margin-top: 16px; padding: 11px 12px; border-left: 3px solid var(--accent); background: #0d1d2e; color: #b9cde0; font-size: 12px; line-height: 1.5; }
.error-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.error-card { width: min(620px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 13px; background: rgba(10,21,36,.97); box-shadow: var(--shadow); text-align: center; }
.error-card .actions { justify-content: center; margin-top: 20px; }
.error-code { margin-top: 22px; font-size: clamp(54px, 10vw, 92px); line-height: 1; font-weight: 900; color: var(--accent); letter-spacing: -.05em; }
.office-error { margin: 8vh auto 0; }
.compact-actions { min-width: 170px; }
.compact-actions form { display: inline-flex; }

@media (max-width: 560px) {
  .public-description { font-size: 13px; }
  .public-contacts { display: grid; gap: 4px; }
  .error-card { padding: 24px 18px; }
  .compact-actions { min-width: 140px; }
}


.workflow-grid{display:grid;gap:12px}.workflow-step{display:flex;gap:16px;align-items:flex-start;padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:inherit;text-decoration:none;transition:.18s ease}.workflow-step:hover{transform:translateY(-1px);border-color:var(--accent)}.workflow-step>span{display:grid;place-items:center;flex:0 0 38px;height:38px;border-radius:12px;background:var(--accent);color:#03101f;font-weight:900}.workflow-step b{font-size:1.05rem}.workflow-step p{margin:6px 0 0;color:var(--muted);line-height:1.5}.help-list{margin:0;padding-left:20px;display:grid;gap:8px;line-height:1.5}

/* Director-oriented reporting and unified catalog */
.center, .percent-cell { text-align: center; }
.percent-input { width: 82px; min-width: 82px; text-align: center !important; font-variant-numeric: tabular-nums; }
.money-input { width: 112px; min-width: 112px; text-align: center !important; font-variant-numeric: tabular-nums; }
.period-presets { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.period-chip { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: #c8d9ea; text-decoration: none; font-size: 12px; font-weight: 720; }
.period-chip:hover { border-color: var(--line-strong); background: var(--panel-3); color: #fff; }
.period-chip.active { border-color: var(--accent); background: rgba(14,165,233,.2); color: #fff; box-shadow: var(--focus); }
.compact-filter { width: fit-content; max-width: 100%; }
.catalog-form { margin: 0; }
.catalog-toolbar { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0; padding: 12px 14px; border: 1px solid #2c5878; border-radius: 10px; background: rgba(8, 25, 42, .97); box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.catalog-toolbar-copy { display: grid; gap: 3px; }
.catalog-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.catalog-toolbar .muted { font-size: 11px; }
.catalog-scroll { max-height: calc(100vh - 245px); min-height: 360px; }
.catalog-table { min-width: 1600px; }
.catalog-table th { top: 0; }
.catalog-table td { vertical-align: middle; }
.catalog-table td:nth-child(2) { min-width: 270px; }
.catalog-table td:nth-child(3) { min-width: 390px; max-width: 540px; }
.catalog-table td:nth-child(4) { min-width: 180px; }
.marketplace-names { display: grid; gap: 6px; line-height: 1.35; }
.marketplace-names > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 7px; align-items: start; }
.channel-badge { display: inline-flex; justify-content: center; border: 1px solid #31506d; border-radius: 999px; padding: 2px 6px; background: #0d2033; color: #a9dfff; font-size: 9px; font-weight: 800; white-space: nowrap; }
.archived-row { opacity: .65; }
.status-rejected { background: #3d1a2c; color: #ff9abc; }
.reject-panel { margin: 16px 0; border-color: #71364a; background: linear-gradient(180deg, #26131d, #160b11); }
.reject-panel h2 { margin-top: 0; }
.inline-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.inline-actions input { min-width: min(440px, 100%); flex: 1; }
[data-requires-saved].is-disabled { opacity: .45; pointer-events: none; filter: grayscale(.4); }
.dirty-indicator { color: var(--yellow); font-size: 12px; font-weight: 700; }

@media (max-width: 900px) {
  .catalog-toolbar { top: 53px; align-items: stretch; flex-direction: column; }
  .catalog-toolbar-actions { width: 100%; }
  .catalog-toolbar-actions > * { flex: 1; }
  .catalog-scroll { max-height: none; }
  .compact-filter { width: 100%; }
}

.success-box { background: #123528; border: 1px solid #28694f; padding: 13px; border-radius: 8px; }

/* GEARBOX63 1.3 — упрощённый кабинет */
.nav-more { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 7px; }
.nav-more summary { list-style: none; cursor: pointer; padding: 9px 10px; border-radius: 7px; color: #91a8c2; font-size: 12px; font-weight: 720; user-select: none; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: "⌄"; float: right; transition: transform .15s ease; }
.nav-more[open] summary::after { transform: rotate(180deg); }
.nav-more summary:hover { background: #10243b; color: #fff; }
.nav-more-links { display: grid; gap: 2px; margin-top: 2px; padding-left: 7px; border-left: 1px solid #28435d; }
.nav-more-links a { font-size: 12px !important; padding-block: 8px !important; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.section-heading h2 { margin: 0 0 3px; font-size: 19px; }
.section-heading p { margin: 0; }
.work-queue { margin-bottom: 18px; }
.work-queue .section-heading { margin-bottom: 12px; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 10px; }
.task-card { display: grid; gap: 4px; min-height: 118px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #0b192a; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, background .15s; }
.task-card:hover { border-color: var(--accent); transform: translateY(-1px); background: #10233a; }
.task-card span { color: #bcd0e4; font-size: 12px; font-weight: 720; }
.task-card b { font-size: 27px; line-height: 1.1; }
.task-card small { margin-top: auto; color: var(--muted); }
.task-accent { border-color: #246b91; background: linear-gradient(180deg, #0d2a42, #0a192a); }
.task-warning { border-color: #655326; }
.task-danger { border-color: #71313c; }
.task-empty { grid-column: 1 / -1; display: grid; gap: 5px; padding: 18px; border: 1px solid #286446; border-radius: 9px; background: #0e2b20; }
.task-empty span { color: #a9d8bf; }
.quick-actions-list { display: grid; gap: 8px; }
.quick-actions-list a { display: grid; gap: 3px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(12, 30, 49, .7); color: var(--text); text-decoration: none; }
.quick-actions-list a:hover { border-color: var(--accent); background: #10263e; }
.quick-actions-list span { color: var(--muted); font-size: 12px; }

.catalog-summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.summary-chip { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: #c7d8e9; text-decoration: none; }
.summary-chip b { color: #fff; font-size: 15px; }
.summary-chip span { font-size: 12px; }
.summary-chip:hover, .summary-chip.active { border-color: var(--accent); background: #10263e; }
.catalog-table-simple { min-width: 1240px; }
.catalog-table-simple td:nth-child(2) { min-width: 300px; }
.catalog-table-simple td:nth-child(3) { min-width: 180px; }
.catalog-table-simple td:nth-child(7) { min-width: 175px; max-width: 250px; }
.catalog-price-cell { display: grid; justify-items: center; gap: 4px; }
.catalog-price-cell small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.catalog-margin-stack { display: grid; justify-items: center; gap: 5px; }
.catalog-margin-stack small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.catalog-margin-stack strong { color: #aee8c7; }
.channel-stack { display: flex; gap: 4px; flex-wrap: wrap; }
.channel-stack .channel-badge { width: auto; min-width: 0; padding: 3px 6px; font-size: 9px; }
.row-detail-link { display: inline-block; margin-top: 6px; color: var(--muted); font-size: 10px; text-decoration: none; }
.row-detail-link:hover { color: var(--accent-soft); }
.dirty-indicator { display: inline-flex; align-items: center; width: fit-content; margin-top: 3px; padding: 3px 7px; border-radius: 999px; background: #493812; color: #ffe28a; font-size: 10px; font-weight: 760; }
.category-order-actions { display: flex; gap: 6px; align-items: center; }
.category-order-actions form { margin: 0; }
.category-order-actions button[disabled] { opacity: .35; cursor: default; }
.price-state-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 14px 0; }
.price-state-card { display: grid; gap: 5px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(180deg, var(--panel), #07111e); }
.price-state-card span, .price-state-card small { color: var(--muted); }
.price-state-card b { font-size: 22px; }
.price-state-card.is-stale { border-color: #735623; background: #211a0d; }
.price-state-card.is-stale b, .price-state-card.is-stale small { color: #ffc27f; }

@media (max-width: 900px) {
  .section-heading { align-items: stretch; flex-direction: column; }
  .catalog-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-chip { justify-content: center; }
  .catalog-table-simple { min-width: 1100px; }
}


/* 1.4 — aligned numeric tables, disabled-card filter and A4 sales report */
.aligned-table { table-layout: fixed; }
.aligned-table th.center, .aligned-table td.center { text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; }
.checkbox-filter { display: flex !important; align-items: center; align-self: end; min-height: 38px; gap: 8px !important; padding: 0 4px; color: var(--text) !important; cursor: pointer; }
.checkbox-filter input { width: 18px; min-height: 18px; margin: 0; }
.checkbox-filter span { white-space: nowrap; font-size: 12px; }
.director-cards .card { text-align: center; }
.director-channel-report { margin-top: 16px; }
.director-channel-report h2 { margin-top: 0; }
.channel-report-table th:first-child, .channel-report-table td:first-child { width: 34%; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.sales-table { min-width: 1120px; }
.sales-table .sales-name { width: 34%; }
.sales-table .sales-store { width: 12%; }
.sales-table .sales-price { width: 10%; }
.sales-table .sales-margin { width: 9%; }
.sales-table .sales-quantity { width: 10%; }
.sales-table .sales-revenue { width: 14%; }
.sales-table .sales-profit { width: 11%; }
.sales-table td:first-child { overflow-wrap: anywhere; }
.listing-table { min-width: 1080px; }
.listing-table th:nth-child(1) { width: 10%; }
.listing-table th:nth-child(2) { width: 8%; }
.listing-table th:nth-child(3) { width: 12%; }
.listing-table th:nth-child(4) { width: 29%; }
.listing-table th:nth-child(5) { width: 25%; }
.listing-table th:nth-child(6) { width: 9%; }
.listing-table th:nth-child(7) { width: 7%; }
.print-report { display: none; }

@page { size: A4 landscape; margin: 10mm; }
@media print {
  :root { color-scheme: light; }
  html, body { width: 100%; min-height: 0; background: #fff !important; color: #000 !important; }
  .mobile-bar, .sidebar, .sidebar-backdrop, .screen-report, .message, .monthly-report-alert { display: none !important; }
  .app-shell { display: block !important; min-height: 0; }
  .office-main { width: 100%; max-width: none; margin: 0; padding: 0; }
  .print-report {
    display: block !important;
    position: static;
    width: 100%;
    padding: 0;
    color: #000;
    background: #fff;
    font-family: Arial, sans-serif;
  }
  .print-report-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18mm; margin-bottom: 6mm; }
  .print-report-header h1 { margin: 0 0 2mm; font-size: 17pt; }
  .print-report-header p { margin: 0; font-size: 10pt; }
  .print-warning { margin: 0 0 5mm; padding: 3mm; border: 0.3mm solid #9c5700; background: #fff2cc; font-size: 9pt; font-weight: 700; }
  .print-total { min-width: 52mm; text-align: right; }
  .print-total span { display: block; font-size: 9pt; }
  .print-total b { display: block; margin-top: 2mm; font-size: 14pt; white-space: nowrap; }
  .print-sales-table { width: 100%; table-layout: fixed; border-collapse: collapse; color: #000; background: #fff; font-size: 9pt; }
  .print-sales-table .print-name { width: 49%; }
  .print-sales-table .print-price { width: 12%; }
  .print-sales-table .print-margin { width: 10%; }
  .print-sales-table .print-quantity { width: 11%; }
  .print-sales-table .print-revenue { width: 18%; }
  .print-sales-table thead { display: table-header-group; }
  .print-sales-table tr { break-inside: avoid; page-break-inside: avoid; }
  .print-sales-table th, .print-sales-table td { padding: 2.4mm 2mm; border: 0.25mm solid #777; color: #000; background: #fff; vertical-align: top; }
  .print-sales-table th { position: static; text-align: center; font-size: 8.5pt; text-transform: none; letter-spacing: 0; background: #eee; }
  .print-sales-table td:nth-child(n+2) { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .print-sales-table td:first-child { overflow-wrap: anywhere; }
}

/* Dashboard overview widgets */
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.overview-panel { min-width: 0; }
.overview-panel--wide { grid-column: 1 / -1; }
.overview-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.overview-section-head h2 { margin: 0 0 6px; font-size: 18px; }
.overview-section-head p { margin: 0; }
.summary-table tfoot td { position: sticky; bottom: 0; background: #0d1a2c; border-top: 1px solid var(--line-strong); }
.sales-structure-layout { display: grid; grid-template-columns: minmax(220px, 260px) minmax(0, 1fr); gap: 18px; align-items: center; }
.sales-donut {
  width: min(100%, 240px); aspect-ratio: 1 / 1; margin: 0 auto;
  border-radius: 50%; padding: 18px; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 18px 38px rgba(0, 5, 16, .24);
}
.sales-donut-core {
  width: 100%; height: 100%; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  padding: 22px; background: radial-gradient(circle at 30% 20%, #12253a 0, #09121f 74%);
  border: 1px solid rgba(255,255,255,.06);
}
.sales-donut-core strong { display: block; font-size: 18px; line-height: 1.25; }
.sales-donut-core span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.structure-legend { display: grid; gap: 12px; }
.legend-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.legend-color { width: 14px; height: 14px; border-radius: 4px; margin-top: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.legend-copy { min-width: 0; }
.legend-copy strong, .legend-copy small { display: block; }
.legend-copy small { color: var(--muted); margin-top: 2px; }
.legend-share { font-weight: 780; white-space: nowrap; }
.structure-meter { margin-top: 8px; height: 10px; border-radius: 999px; overflow: hidden; background: #091525; border: 1px solid rgba(255,255,255,.06); }
.structure-meter span { display: block; height: 100%; border-radius: inherit; }
.top-products-table td:first-child a { color: inherit; text-decoration: none; }
.top-products-table td:first-child a:hover { color: var(--accent-soft); }
.empty-dashboard-note { padding: 16px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); background: rgba(7, 19, 33, .42); }

@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: 1fr; }
  .overview-panel--wide { grid-column: auto; }
}

@media (max-width: 780px) {
  .sales-structure-layout { grid-template-columns: 1fr; }
  .sales-donut { width: min(100%, 210px); }
}

/* 1.4.2 — CSP-safe overview charts */
.sales-donut-wrap {
  position: relative;
  width: min(100%, 240px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  display: grid;
  place-items: center;
}
.sales-donut-chart {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
  filter: drop-shadow(0 18px 38px rgba(0, 5, 16, .24));
}
.sales-donut-track,
.sales-donut-segment {
  fill: none;
  stroke-width: 16;
}
.sales-donut-track { stroke: #13243a; }
.sales-donut-segment { stroke-linecap: butt; }
.sales-donut-wrap .sales-donut-core {
  position: absolute;
  inset: 29%;
  width: auto;
  height: auto;
  z-index: 2;
}
.channel-stroke-1 { stroke: #38bdf8; }
.channel-stroke-2 { stroke: #60a5fa; }
.channel-stroke-3 { stroke: #7dd3fc; }
.channel-stroke-4 { stroke: #4ade80; }
.channel-stroke-5 { stroke: #fbbf24; }
.channel-bg-1 { background: #38bdf8; }
.channel-bg-2 { background: #60a5fa; }
.channel-bg-3 { background: #7dd3fc; }
.channel-bg-4 { background: #4ade80; }
.channel-bg-5 { background: #fbbf24; }
.structure-progress {
  display: block;
  width: 100%;
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #091525;
  appearance: none;
  -webkit-appearance: none;
}
.structure-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #091525;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.structure-progress::-webkit-progress-value { border-radius: 999px; }
.structure-progress::-moz-progress-bar { border-radius: 999px; }
.channel-progress-1::-webkit-progress-value { background: #38bdf8; }
.channel-progress-2::-webkit-progress-value { background: #60a5fa; }
.channel-progress-3::-webkit-progress-value { background: #7dd3fc; }
.channel-progress-4::-webkit-progress-value { background: #4ade80; }
.channel-progress-5::-webkit-progress-value { background: #fbbf24; }
.channel-progress-1::-moz-progress-bar { background: #38bdf8; }
.channel-progress-2::-moz-progress-bar { background: #60a5fa; }
.channel-progress-3::-moz-progress-bar { background: #7dd3fc; }
.channel-progress-4::-moz-progress-bar { background: #4ade80; }
.channel-progress-5::-moz-progress-bar { background: #fbbf24; }

/* 1.4.3 — precise alignment for sales structure */
.sales-structure-layout {
  grid-template-columns: 220px minmax(0, 1fr);
  column-gap: 32px;
  align-items: center;
}
.sales-donut-wrap {
  width: 210px;
  max-width: 100%;
  justify-self: center;
}
.sales-donut-wrap .sales-donut-core {
  inset: 25%;
  padding: 12px;
}
.sales-donut-core strong {
  display: block;
  max-width: 100%;
  font-size: 17px;
  line-height: 1.15;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sales-donut-core span {
  margin-top: 7px;
}
.structure-legend {
  width: 100%;
  gap: 18px;
}
.legend-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  column-gap: 11px;
  align-items: start;
  min-width: 0;
}
.legend-color {
  margin-top: 3px;
}
.legend-content {
  min-width: 0;
}
.legend-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  column-gap: 16px;
  align-items: start;
}
.legend-copy {
  min-width: 0;
}
.legend-copy strong {
  line-height: 1.25;
}
.legend-copy small {
  margin-top: 4px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.legend-share {
  text-align: right;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.structure-progress {
  width: 100%;
  margin-top: 9px;
}

@media (max-width: 780px) {
  .sales-structure-layout {
    grid-template-columns: 1fr;
    row-gap: 22px;
  }
  .sales-donut-wrap {
    width: 196px;
  }
  .legend-header {
    grid-template-columns: minmax(0, 1fr) 74px;
    column-gap: 10px;
  }
}

/* 1.4.4 — stable donut center and responsive structure layout */
.sales-structure-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
.sales-donut-wrap {
  width: min(100%, 240px);
  min-width: 0;
  justify-self: center;
}
.sales-donut-chart {
  width: 100%;
  height: auto;
}
.sales-donut-wrap .sales-donut-core {
  inset: 27%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
}
.sales-donut-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(8, 20, 34, .88);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 8px 24px rgba(0, 0, 0, .16);
  color: #fff;
  font-size: clamp(15px, 1.6vw, 21px);
  font-weight: 820;
  line-height: 1;
  letter-spacing: .01em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sales-donut-caption {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.15;
  text-align: center;
}
.structure-legend {
  gap: 14px;
}
.legend-row {
  align-items: center;
}
.legend-content {
  display: grid;
  gap: 8px;
}
.legend-header {
  align-items: center;
}
.legend-copy strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}
.legend-copy small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.legend-share {
  min-width: 88px;
  text-align: right;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.structure-progress {
  height: 12px;
  margin-top: 0;
}

@media (max-width: 900px) {
  .sales-structure-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .sales-donut-wrap {
    width: min(100%, 220px);
  }
  .structure-legend {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .overview-section-head p {
    font-size: 13px;
    line-height: 1.4;
  }
  .sales-donut-wrap {
    width: min(100%, 204px);
  }
  .sales-donut-wrap .sales-donut-core {
    inset: 26%;
    gap: 6px;
    padding: 8px 10px;
  }
  .sales-donut-value {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 16px;
  }
  .legend-row {
    grid-template-columns: 12px minmax(0, 1fr);
    column-gap: 10px;
    align-items: start;
  }
  .legend-color {
    width: 12px;
    height: 12px;
    margin-top: 4px;
  }
  .legend-header {
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: start;
  }
  .legend-copy strong {
    font-size: 14px;
  }
  .legend-copy small,
  .legend-share {
    font-size: 13px;
  }
  .legend-share {
    min-width: 72px;
  }
  .structure-progress {
    height: 10px;
  }
}

/* 1.4.5 — cleaner donut center, stronger colors, better mobile readability */
.overview-section-head {
  min-width: 0;
}
.overview-section-head > div {
  min-width: 0;
}
.overview-section-head p {
  overflow-wrap: anywhere;
}

/* More distinct channel colors */
.channel-stroke-1 { stroke: #22d3ee; }
.channel-stroke-2 { stroke: #f59e0b; }
.channel-stroke-3 { stroke: #a78bfa; }
.channel-stroke-4 { stroke: #34d399; }
.channel-stroke-5 { stroke: #f472b6; }
.channel-bg-1 { background: #22d3ee; }
.channel-bg-2 { background: #f59e0b; }
.channel-bg-3 { background: #a78bfa; }
.channel-bg-4 { background: #34d399; }
.channel-bg-5 { background: #f472b6; }
.channel-progress-1::-webkit-progress-value { background: #22d3ee; }
.channel-progress-2::-webkit-progress-value { background: #f59e0b; }
.channel-progress-3::-webkit-progress-value { background: #a78bfa; }
.channel-progress-4::-webkit-progress-value { background: #34d399; }
.channel-progress-5::-webkit-progress-value { background: #f472b6; }
.channel-progress-1::-moz-progress-bar { background: #22d3ee; }
.channel-progress-2::-moz-progress-bar { background: #f59e0b; }
.channel-progress-3::-moz-progress-bar { background: #a78bfa; }
.channel-progress-4::-moz-progress-bar { background: #34d399; }
.channel-progress-5::-moz-progress-bar { background: #f472b6; }

.sales-donut-wrap {
  width: min(100%, 236px);
}
.sales-donut-wrap .sales-donut-core {
  inset: 27%;
  gap: 6px;
  padding: 8px 10px;
}
.sales-donut-value {
  display: block;
  min-height: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #f8fbff;
  font-size: clamp(14px, 1.45vw, 19px);
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: .01em;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 2px 14px rgba(0,0,0,.28);
}
.sales-donut-caption {
  color: #9eb6d3;
  font-size: 12px;
  line-height: 1.15;
  letter-spacing: .01em;
}
.legend-color {
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 0 18px rgba(255,255,255,.06);
}

@media (max-width: 900px) {
  .sales-donut-wrap {
    width: min(100%, 212px);
  }
  .sales-donut-value {
    font-size: 17px;
  }
}

@media (max-width: 640px) {
  .sales-donut-wrap {
    width: min(100%, 196px);
  }
  .sales-donut-wrap .sales-donut-core {
    inset: 26%;
    gap: 5px;
    padding: 6px 8px;
  }
  .sales-donut-value {
    font-size: 15px;
    line-height: 1.1;
  }
  .sales-donut-caption {
    font-size: 11px;
  }
}

/* 1.4.7 — manual exclusion of invalid import rows */
.import-preview-table .import-row-error { background: rgba(120, 28, 42, .1); }
.import-preview-table .import-row-excluded { background: rgba(39, 67, 94, .16); opacity: .82; }
.import-preview-table .import-row-excluded:hover { opacity: 1; }
.import-error-reason { margin-top: 6px; font-size: 11px; line-height: 1.35; }
.import-row-action { min-width: 105px; text-align: center; vertical-align: middle; }
.import-row-action form { display: inline-flex; margin: 0; }
@media (max-width: 780px) {
  .import-row-action { min-width: 92px; }
}

/* 1.4.8 — move full total outside donut for clean responsive layout */
.sales-structure-layout {
  align-items: start;
}
.sales-donut-side {
  display: grid;
  justify-items: center;
  gap: 14px;
}
.sales-donut-wrap {
  width: min(100%, 232px);
}
.sales-donut-wrap .sales-donut-core {
  inset: 33%;
  padding: 0;
  gap: 0;
  border: none;
  background: radial-gradient(circle at 30% 20%, rgba(18,37,58,.92) 0, rgba(9,18,31,.95) 74%);
}
.sales-donut-caption {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  min-height: 24px;
  color: #d8e6f6;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
  text-align: center;
}
.sales-donut-total {
  width: min(100%, 232px);
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(14,31,49,.88), rgba(9,20,34,.92));
  box-shadow: 0 14px 28px rgba(0, 7, 19, .22), inset 0 1px 0 rgba(255,255,255,.04);
  text-align: center;
}
.sales-donut-total-label {
  color: #9eb6d3;
  font-size: 12px;
  line-height: 1.2;
}
.sales-donut-total-value {
  display: block;
  color: #ffffff;
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  text-wrap: balance;
}

@media (min-width: 901px) {
  .sales-structure-layout {
    grid-template-columns: 248px minmax(0, 1fr);
    column-gap: 28px;
  }
  .sales-structure-layout > .sales-donut-wrap,
  .sales-structure-layout > .sales-donut-total {
    grid-column: 1;
  }
  .sales-structure-layout > .structure-legend {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }
}

@media (max-width: 900px) {
  .sales-structure-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 14px;
  }
  .sales-donut-wrap {
    width: min(100%, 212px);
  }
  .sales-donut-total {
    width: min(100%, 320px);
  }
  .structure-legend {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .sales-donut-wrap {
    width: min(100%, 190px);
  }
  .sales-donut-wrap .sales-donut-core {
    inset: 34%;
  }
  .sales-donut-caption {
    min-height: 20px;
    font-size: 12px;
  }
  .sales-donut-total {
    width: min(100%, 100%);
    padding: 10px 12px;
    border-radius: 14px;
  }
  .sales-donut-total-label {
    font-size: 11px;
  }
  .sales-donut-total-value {
    font-size: 22px;
    line-height: 1.08;
  }
}

/* 1.4.9 — catalog row alignment and marketplace names in one workspace */
.catalog-table-simple {
  min-width: 1540px;
}
.catalog-table-simple td:nth-child(2) {
  min-width: 320px;
}
.catalog-table-simple td:nth-child(3) {
  min-width: 190px;
}
.catalog-table-simple td:nth-child(4) {
  min-width: 160px;
}
.catalog-table-simple td:nth-child(7) {
  min-width: 390px;
  max-width: 560px;
}
.catalog-price-cell {
  display: table-cell;
  text-align: center;
  vertical-align: middle;
}
.catalog-price-stack {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 48px;
}
.catalog-price-stack small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
}
.marketplace-names-cell {
  vertical-align: middle;
}
.marketplace-name-list {
  display: grid;
  gap: 0;
}
.marketplace-name-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 6px 0;
  border-bottom: 1px solid rgba(49, 85, 121, .48);
}
.marketplace-name-row:first-child {
  padding-top: 0;
}
.marketplace-name-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.marketplace-channel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 7px;
  border: 1px solid #315579;
  border-radius: 999px;
  background: #0c2940;
  color: #d8efff;
  font-size: 9px;
  font-weight: 820;
  line-height: 1;
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
}
a.marketplace-channel:hover {
  border-color: var(--accent);
  background: #103b59;
  color: #fff;
}
.marketplace-name-copy {
  min-width: 0;
}
.marketplace-name-copy span {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.marketplace-name-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.marketplace-names-cell .row-detail-link {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .catalog-table-simple {
    min-width: 1450px;
  }
  .catalog-table-simple td:nth-child(7) {
    min-width: 350px;
  }
}

/* 1.4.13 — product card as a daily workspace */
.product-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.product-detail-head h1 { margin: 5px 0; font-size: 26px; line-height: 1.2; }
.product-back-link { display: inline-flex; color: var(--muted); font-size: 12px; text-decoration: none; }
.product-back-link:hover { color: var(--accent-soft); }
.product-pricing-workspace { padding: 20px; border-color: #2a5777; background: linear-gradient(145deg, #0c2034, #07111e 68%); }
.product-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.product-section-head h2 { margin: 0 0 5px; font-size: 20px; }
.product-section-head p { margin: 0; line-height: 1.4; }
.product-status-stack { display: grid; justify-items: end; gap: 6px; text-align: right; }
.product-status-stack small { color: var(--muted); white-space: nowrap; }
.product-pricing-form {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) minmax(160px, .9fr) repeat(2, minmax(160px, 1fr)) minmax(180px, .85fr) minmax(180px, auto);
  gap: 12px;
  align-items: stretch;
}
.product-pricing-form > label {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 16, 29, .72);
}
.product-pricing-form > label > span { color: #c7d9ec; font-size: 12px; font-weight: 760; }
.product-pricing-form > label small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.product-pricing-form > label small strong { color: #dff5ff; font-size: 12px; }
.input-suffix { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; }
.input-suffix input { width: 100%; min-width: 0; border-radius: 8px 0 0 8px; font-size: 20px; font-weight: 820; font-variant-numeric: tabular-nums; }
.input-suffix > b { display: grid; place-items: center; min-height: 38px; border: 1px solid #29445f; border-left: 0; border-radius: 0 8px 8px 0; background: #10243a; color: #bfe9ff; }
.product-price-toggle { grid-template-columns: 22px minmax(0, 1fr); align-items: center; cursor: pointer; }
.product-price-toggle input { width: 19px; min-height: 19px; margin: 0; }
.product-price-toggle > span { display: grid; gap: 5px; }
.product-price-toggle > span b { color: var(--text); font-size: 14px; }
.product-pricing-submit { display: grid; align-content: center; gap: 8px; min-width: 0; }
.product-pricing-submit button { width: 100%; }
.product-pricing-submit small { max-width: 220px; text-align: center; line-height: 1.35; }
.product-readonly-values { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; }
.product-readonly-values > div { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: rgba(5, 16, 29, .72); }
.product-readonly-values span, .product-readonly-values small { display: block; color: var(--muted); font-size: 11px; }
.product-readonly-values b { display: block; margin: 5px 0; font-size: 21px; }
.product-work-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr); gap: 16px; margin-top: 16px; align-items: start; }
.product-work-grid > section { min-width: 0; }
.product-link-list { display: grid; gap: 8px; }
.product-link-row {
  display: grid;
  grid-template-columns: minmax(160px, 205px) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(9, 24, 40, .72);
}
.product-link-row.is-disabled { opacity: .68; }
.listing-lifecycle-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.listing-lifecycle-actions form { margin: 0; }
.product-link-row > .listing-lifecycle-actions { display: grid; justify-items: stretch; }
.product-link-row > .listing-lifecycle-actions button { width: 100%; }
.listing-lifecycle-panel { margin-top: 22px; border-top: 1px solid var(--line); }
.listing-lifecycle-panel h2 { font-size: 18px; }
.product-link-channel { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.product-link-channel code { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.product-link-copy { min-width: 0; }
.product-link-copy b { display: block; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.product-link-copy .status { display: inline-flex; margin-top: 5px; }
.product-empty-state { display: grid; gap: 5px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); text-align: center; }
.product-empty-state b { color: var(--text); }
.product-attach-form {
  display: grid;
  grid-template-columns: minmax(210px, .8fr) minmax(300px, 1.4fr) auto;
  gap: 11px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #286446;
  border-radius: 10px;
  background: rgba(10, 42, 31, .42);
}
.product-attach-copy { display: grid; gap: 4px; }
.product-attach-copy span { color: #a9c5b7; font-size: 11px; line-height: 1.35; }
.product-attach-control { position: relative; min-width: 0; }
.product-attach-control input[type="text"] { width: 100%; }
.product-history-panel h3 { margin: 0 0 9px; font-size: 14px; color: #d6e7f7; }
.product-history-panel .table-scroll { max-height: 235px; }
.product-history-panel table { font-size: 12px; }

@media (max-width: 1500px) {
  .product-pricing-form { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .product-price-toggle { grid-column: auto; }
  .product-pricing-submit { min-height: 82px; }
  .product-work-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .product-detail-head, .product-section-head { flex-direction: column; align-items: stretch; }
  .product-detail-head .actions { width: 100%; }
  .product-status-stack { justify-items: start; text-align: left; }
  .product-pricing-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-price-toggle { grid-column: auto; }
  .product-pricing-submit { grid-column: 1 / -1; min-height: 0; }
  .product-pricing-submit small { max-width: none; }
  .product-readonly-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-attach-form { grid-template-columns: 1fr; }
  .product-link-row { grid-template-columns: minmax(130px, 180px) minmax(0, 1fr); }
  .product-link-row > .button { grid-column: 1 / -1; width: 100%; }
  .product-link-row > .listing-lifecycle-actions { grid-column: 1 / -1; display: flex; }
}

@media (max-width: 560px) {
  .product-pricing-workspace { padding: 15px; }
  .product-pricing-form, .product-readonly-values { grid-template-columns: 1fr; }
  .product-link-row { grid-template-columns: 1fr; }
  .product-link-row > .button { grid-column: auto; }
}

/* 1.5.0 — daily work queue, safe linking and Excel catalogue updates */
.work-queue-panel { margin-bottom: 17px; padding: 16px; border-color: #28536f; }
.work-queue-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 9px; }
.work-queue-item { display: grid; gap: 5px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #091929; color: var(--text); text-decoration: none; }
.work-queue-item:hover { border-color: var(--accent); }
.work-queue-item span { color: #c6d8e9; font-size: 11px; }
.work-queue-item b { font-size: 24px; line-height: 1; }
.work-queue-item small { color: var(--muted); }
.work-queue-item.level-warn { border-color: #6c5320; background: #211b0d; }
.work-queue-item.level-info { border-color: #245987; background: #0b2135; }
.work-queue-item.level-ok b { color: #79dca1; }
.system-freshness { display: flex; justify-content: space-between; gap: 14px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.system-freshness b { color: #c7d9e8; }
.system-freshness .freshness-warning, .system-freshness .freshness-warning b { color: #ffbd76; }

.linking-summary { grid-template-columns: minmax(180px, 260px) minmax(280px, 1fr); }
.linking-rule b { font-size: 18px; }
.linking-rule small { display: block; margin-top: 5px; }
.linking-list { display: grid; gap: 10px; }
.linking-row { display: grid; grid-template-columns: 30px minmax(260px, .85fr) minmax(420px, 1.4fr) auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg, var(--panel), #07111e); }
.linking-select { display: grid; place-items: center; }
.linking-select input { width: 19px; min-height: 19px; }
.linking-source { display: grid; gap: 8px; min-width: 0; }
.linking-source > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.linking-source > b { font-size: 13px; line-height: 1.38; overflow-wrap: anywhere; }
.copy-button { min-height: 24px; padding: 3px 7px; border: 1px solid var(--line); background: transparent; box-shadow: none; color: var(--muted); font-size: 10px; }
.copy-button:hover, .copy-button.is-copied { border-color: var(--accent); background: #0c2940; color: #dff5ff; }
.linking-suggestions { display: grid; gap: 6px; }
.linking-suggestion { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: center; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(7, 19, 33, .75); cursor: pointer; }
.linking-suggestion:has(input:checked) { border-color: #3284b4; background: #0c2940; }
.linking-suggestion.recommended { border-left: 3px solid #63c6eb; }
.linking-suggestion input { width: 16px; min-height: 16px; }
.linking-suggestion span { min-width: 0; }
.linking-suggestion b, .linking-suggestion small { display: block; }
.linking-suggestion b { font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.linking-suggestion small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.linking-no-match { display: grid; gap: 4px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 8px; }
.linking-no-match b { font-size: 12px; }
.linking-no-match span { color: var(--muted); font-size: 11px; }
.linking-submit { position: sticky; z-index: 4; bottom: 10px; display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 12px; padding: 11px 13px; border: 1px solid #356b8d; border-radius: 10px; background: rgba(7, 24, 39, .96); box-shadow: var(--shadow); }
.linking-submit span { color: var(--muted); font-size: 11px; }

.catalog-update-table { min-width: 1050px; }
.catalog-update-table td:nth-child(2) { min-width: 250px; }
.catalog-update-table td:nth-child(3) { min-width: 480px; }
.catalog-update-table tr.has-error { background: rgba(91, 21, 31, .15); }
.catalog-change-list { display: grid; gap: 5px; }
.catalog-change-list > div { display: grid; grid-template-columns: 145px minmax(110px, 1fr) 18px minmax(110px, 1fr); gap: 7px; align-items: start; padding-bottom: 5px; border-bottom: 1px solid rgba(49, 85, 121, .35); font-size: 11px; }
.catalog-change-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.catalog-change-list b { color: #abc5dd; }
.catalog-change-list span { color: #e0b1b7; overflow-wrap: anywhere; }
.catalog-change-list i { color: var(--muted); font-style: normal; }
.catalog-change-list strong { color: #8ee0b0; overflow-wrap: anywhere; }
.validation-error { margin-bottom: 5px; color: #ffadb4; font-size: 11px; line-height: 1.35; }
.batch-status-text { font-size: 17px !important; }

.product-breadcrumbs { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.product-breadcrumbs > span { display: flex; gap: 12px; font-size: 11px; }
.product-breadcrumbs > span a { color: var(--muted); text-decoration: none; }
.product-breadcrumbs > span a:hover { color: var(--accent-soft); }
.product-detail-head h1 .copy-button { vertical-align: middle; margin-left: 7px; }
.product-30-cards { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 16px; }
.product-30-cards > div { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #091827; }
.product-30-cards span, .product-30-cards small { display: block; color: var(--muted); font-size: 10px; }
.product-30-cards b { display: block; margin: 4px 0; font-size: 20px; }
.product-link-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }

@media (max-width: 1250px) {
  .work-queue-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .linking-row { grid-template-columns: 30px minmax(240px, .8fr) minmax(360px, 1.2fr); }
  .linking-row > .button { grid-column: 2 / -1; justify-self: start; }
}
@media (max-width: 780px) {
  .work-queue-grid, .product-30-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-freshness { flex-direction: column; }
  .linking-row { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
  .linking-suggestions, .linking-row > .button { grid-column: 2; }
  .linking-submit { align-items: stretch; flex-direction: column; }
  .linking-submit button { width: 100%; }
  .catalog-change-list > div { grid-template-columns: 110px minmax(100px, 1fr) 16px minmax(100px, 1fr); }
}
@media (max-width: 480px) {
  .work-queue-grid, .product-30-cards, .linking-summary { grid-template-columns: 1fr; }
  .product-breadcrumbs { align-items: flex-start; flex-direction: column; }
}

.security-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.security-grid h2, .two-factor-setup h2, .recovery-panel h2 { margin-top: 0; }
.danger-zone { border-color: #6c2d37; }
.details-list { display: grid; grid-template-columns: minmax(150px, 1fr) auto; gap: 8px 14px; margin: 18px 0 0; }
.details-list dt { color: var(--muted); }
.details-list dd { margin: 0; font-weight: 750; text-align: right; }
.secret-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0; padding: 13px; border: 1px solid #2d6387; border-radius: 9px; background: #081a2a; }
.secret-box code { color: #bdeeff; font-size: 18px; letter-spacing: .08em; overflow-wrap: anywhere; }
.uri-code { display: block; margin-top: 8px; padding: 9px; color: var(--muted); overflow-wrap: anywhere; white-space: normal; }
.two-factor-confirm { max-width: 420px; }
.recovery-panel { margin-bottom: 16px; border-color: #887128; background: linear-gradient(145deg, #26200c, #0d151d); }
.recovery-codes { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 8px; margin: 14px 0; }
.recovery-codes code { padding: 10px; border: 1px solid #675b31; border-radius: 7px; background: #0c1720; color: #ffdf84; text-align: center; font-size: 15px; }
@media (max-width: 900px) {
  .security-grid { grid-template-columns: 1fr; }
  .recovery-codes { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
}

/* 1.5.1–1.5.4 — monthly freshness, categories, accessible 2FA and compact mobile tables */
.freshness-head { margin: 15px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.freshness-head h2, .freshness-head h3 { margin: 0 0 3px; font-size: 15px; }
.freshness-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 9px; }
.freshness-card { display: grid; gap: 5px; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #091929; color: var(--text); text-decoration: none; }
a.freshness-card:hover { border-color: var(--accent); }
.freshness-card span { color: #a9bfd4; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .03em; }
.freshness-card b { font-size: 13px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.freshness-card small { color: var(--muted); font-size: 10px; line-height: 1.3; }
.freshness-card.is-fresh { border-color: #285f48; }
.freshness-card.is-fresh b { color: #94e2b2; }
.freshness-card.is-waiting { border-color: #31506c; }
.freshness-card.is-waiting b { color: #c6dbed; }
.freshness-card.is-stale { border-color: #735623; background: #211a0d; }
.freshness-card.is-stale b, .freshness-card.is-stale small { color: #ffc27f; }
.catalog-attention-panel { margin-top: 14px; }
.import-freshness-panel { margin-bottom: 16px; padding: 0 1px 15px; border-bottom: 1px solid var(--line); }
.import-freshness-panel .freshness-head { margin-top: 0; padding-top: 0; border-top: 0; }
.import-freshness-panel .freshness-grid { grid-template-columns: repeat(3, minmax(190px, 1fr)); }

.category-summary { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
.category-summary .card a { margin-top: 7px; color: var(--accent-soft); font-size: 11px; text-decoration: none; }
.category-table { min-width: 760px; }
.problem-grid > section { min-width: 0; }
.problem-grid .pagination { margin-top: 12px; }
.problem-grid .pagination-summary { font-size: 10px; }
.undo-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid #2f7752; border-radius: 10px; background: #0b2a20; }
.undo-banner > div { display: grid; gap: 4px; }
.undo-banner span { color: #b5d5c5; font-size: 11px; }

.two-factor-setup-grid { display: grid; grid-template-columns: minmax(280px, 360px) minmax(320px, 1fr); gap: 24px; align-items: start; }
.two-factor-qr { display: inline-grid; place-items: center; margin-top: 12px; padding: 12px; border: 1px solid #356b8d; border-radius: 14px; background: #fff; }
.two-factor-qr img { display: block; width: min(260px, 100%); height: auto; }

@media (max-width: 1250px) {
  .freshness-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}
@media (max-width: 780px) {
  .freshness-grid, .import-freshness-panel .freshness-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-factor-setup-grid { grid-template-columns: 1fr; }
  .undo-banner { align-items: stretch; flex-direction: column; }
  .undo-banner button { width: 100%; }
}
@media (max-width: 640px) {
  .category-summary, .freshness-grid, .import-freshness-panel .freshness-grid { grid-template-columns: 1fr; }
  table.mobile-card-table { min-width: 0; width: 100%; }
  table.mobile-card-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.mobile-card-table tbody { display: grid; gap: 10px; }
  table.mobile-card-table tr { display: grid; gap: 0; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: #091929; }
  table.mobile-card-table td { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr); gap: 10px; width: auto; min-width: 0; padding: 8px 0; border: 0; border-bottom: 1px solid rgba(49, 85, 121, .42); text-align: right !important; }
  table.mobile-card-table td:last-child { border-bottom: 0; }
  table.mobile-card-table td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 700; text-align: left; text-transform: uppercase; }
  table.mobile-card-table td[colspan] { display: block; text-align: left !important; }
  table.mobile-card-table td[colspan]::before { display: none; }
  table.mobile-card-table td a, table.mobile-card-table td strong { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.motion-full) *, html:not(.motion-full) *::before, html:not(.motion-full) *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
/* 1.5.14 — optional packaging cost in catalogue and PRICE */
.product-packaging-field > span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.product-packaging-field > span input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 0;
}
.product-packaging-field input:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.public-packaging-note,
.public-packaging-total {
  display: block;
  margin-top: 4px;
  color: #91b8d9;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  white-space: normal;
}
.public-packaging-total {
  color: #8ee7bb;
  text-align: right;
}
.catalog-table-simple {
  min-width: 1660px;
}
.catalog-table-simple td:nth-child(5) {
  min-width: 145px;
}
.catalog-table-simple td:nth-child(6),
.catalog-table-simple td:nth-child(7) {
  min-width: 145px;
  max-width: none;
}
.catalog-table-simple td:nth-child(8) {
  min-width: 390px;
  max-width: 560px;
}
@media (max-width: 900px) {
  .catalog-table-simple { min-width: 1570px; }
  .catalog-table-simple td:nth-child(7) { min-width: 145px; max-width: none; }
  .catalog-table-simple td:nth-child(8) { min-width: 350px; }
}

/* 1.5.15 — compact product workspace, contextual packaging and switches */
.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}
.switch-control > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border: 1px solid #38536d;
  border-radius: 999px;
  background: #142336;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, .28);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #91a7bd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .38);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), background .2s ease;
}
.switch-control > input:checked + .switch-track {
  border-color: #2aaeea;
  background: linear-gradient(135deg, #087fbd, #16b8df);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .12), inset 0 1px 4px rgba(255, 255, 255, .2);
}
.switch-control > input:checked + .switch-track::after {
  transform: translateX(20px);
  background: #fff;
}
.switch-control > input:focus-visible + .switch-track {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
}
.switch-control > input:disabled + .switch-track { opacity: .55; cursor: not-allowed; }
.switch-copy { display: grid; gap: 3px; min-width: 0; }
.switch-copy b { color: var(--text); font-size: 13px; line-height: 1.2; }
.switch-copy small { color: var(--muted); font-size: 10px; line-height: 1.3; }
.switch-compact { justify-content: center; }
.switch-compact .switch-track { width: 40px; height: 22px; }
.switch-compact .switch-track::after { width: 16px; height: 16px; top: 2px; left: 2px; }
.switch-compact > input:checked + .switch-track::after { transform: translateX(18px); }
.switch-state { color: var(--muted); font-size: 11px; font-weight: 750; }
.switch-state.is-on { color: var(--green); }
input.switch-input[type="checkbox"] {
  appearance: none;
  position: relative;
  width: 46px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 1px solid #38536d;
  border-radius: 999px;
  background: #142336;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, .28);
  vertical-align: middle;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
input.switch-input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #91a7bd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .38);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), background .2s ease;
}
input.switch-input[type="checkbox"]:checked {
  border-color: #2aaeea;
  background: linear-gradient(135deg, #087fbd, #16b8df);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .12), inset 0 1px 4px rgba(255, 255, 255, .2);
}
input.switch-input[type="checkbox"]:checked::after { transform: translateX(20px); background: #fff; }
.form-card p:has(input.switch-input) {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 14px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(7, 19, 33, .7);
}
.form-card p:has(input.switch-input) > label { grid-column: 1; grid-row: 1; }
.form-card p:has(input.switch-input) > input.switch-input { grid-column: 2; grid-row: 1; }
.form-card p:has(input.switch-input) > .helptext,
.form-card p:has(input.switch-input) > .errorlist { grid-column: 1 / -1; }

.catalog-table-simple { min-width: 1510px; }
.catalog-table-simple td.catalog-price-cell { min-width: 190px; }
.catalog-table-simple td.catalog-margin-cell { min-width: 145px; max-width: none; }
.catalog-table-simple td.marketplace-names-cell { min-width: 390px; max-width: 560px; }
.catalog-table-simple td.catalog-status-cell { min-width: 96px; max-width: 120px; }
.catalog-base-price { font-size: 14px; }
.catalog-packaging-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 5px;
  padding-top: 7px;
  border-top: 1px solid rgba(49, 85, 121, .48);
  color: #b8cee2;
  font-size: 10px;
  font-weight: 750;
}
.catalog-packaging-input {
  display: grid;
  grid-template-columns: auto 64px auto;
  align-items: center;
  gap: 3px;
  color: #8ee7bb;
}
.catalog-packaging-input .quick-input {
  min-width: 0;
  width: 64px;
  min-height: 28px;
  padding: 4px 5px;
  text-align: center;
}
.catalog-cost-basis strong { color: #8ee7bb; }

.product-pricing-form { display: grid; grid-template-columns: 1fr; gap: 12px; }
.product-cost-composer {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 28px minmax(260px, 1.1fr) 28px minmax(190px, .8fr);
  gap: 10px;
  align-items: stretch;
}
.product-cost-composer > label,
.product-packaging-control,
.product-cost-result,
.product-margin-field,
.product-pricing-actions {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 16, 29, .72);
}
.product-cost-composer > label,
.product-margin-field { display: grid; align-content: start; gap: 7px; }
.product-cost-composer > label > span,
.product-margin-field > span { color: #c7d9ec; font-size: 12px; font-weight: 760; }
.product-cost-composer small,
.product-margin-field small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.product-cost-composer small strong,
.product-margin-field small strong { color: #dff5ff; font-size: 12px; }
.product-cost-operator {
  display: grid;
  place-items: center;
  color: #5d7893;
  font-size: 24px;
  font-weight: 500;
}
.product-packaging-control { display: grid; align-content: center; gap: 10px; }
.product-packaging-switch { width: 100%; }
.packaging-reveal {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-5px);
  pointer-events: none;
  transition: max-height .2s ease, opacity .18s ease, transform .2s ease;
}
.packaging-reveal.is-open {
  max-height: 64px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.product-packaging-control input:disabled { opacity: .55; cursor: not-allowed; }
.product-cost-result {
  display: grid;
  align-content: center;
  gap: 5px;
  background: linear-gradient(145deg, rgba(11, 44, 61, .88), rgba(5, 24, 39, .9));
  border-color: #286681;
}
.product-cost-result span { color: #9fc5dd; font-size: 11px; }
.product-cost-result strong { color: #8ee7bb; font-size: 24px; font-variant-numeric: tabular-nums; }
.product-cost-result small { color: var(--muted); font-size: 10px; }
.product-margin-workspace {
  display: grid;
  grid-template-columns: minmax(190px, .75fr) repeat(2, minmax(180px, .7fr)) minmax(245px, .9fr);
  gap: 10px;
  align-items: stretch;
}
.product-margin-intro { display: grid; align-content: center; gap: 5px; padding: 8px 12px; }
.product-margin-intro b { font-size: 15px; }
.product-margin-intro small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.product-pricing-actions { display: grid; gap: 9px; align-content: center; }
.product-pricing-actions > button { width: 100%; }
.product-pricing-actions > small { text-align: center; font-size: 10px; }
.product-readonly-values { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.product-work-grid { grid-template-columns: minmax(0, 1fr); }
.product-history-disclosure { overflow: hidden; }
.product-history-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}
.product-history-disclosure > summary::-webkit-details-marker { display: none; }
.product-history-disclosure > summary > span:first-child { display: grid; gap: 4px; }
.product-history-disclosure > summary b { font-size: 16px; }
.product-history-disclosure > summary small { color: var(--muted); font-size: 11px; }
.details-hint { color: var(--accent-soft); font-size: 11px; font-weight: 750; }
.details-hint::after { content: " ↓"; }
.product-history-disclosure[open] .details-hint::before { content: "Скрыть"; font-size: 0; }
.product-history-disclosure[open] .details-hint { font-size: 0; }
.product-history-disclosure[open] .details-hint::after { content: "Скрыть ↑"; font-size: 11px; }
.product-history-content { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.product-history-content > h3:first-child { margin-top: 14px; }

button.is-submitting,
input[type="submit"].is-submitting { position: relative; overflow: hidden; cursor: wait; }
button.is-submitting::after {
  content: "";
  position: absolute;
  left: -45%;
  bottom: 0;
  width: 45%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #dff8ff, transparent);
  animation: submit-progress 1s linear infinite;
}
@keyframes submit-progress { to { transform: translateX(330%); } }

@media (max-width: 1250px) {
  .product-cost-composer { grid-template-columns: minmax(200px, 1fr) 24px minmax(240px, 1fr) 24px minmax(180px, .8fr); }
  .product-margin-workspace { grid-template-columns: repeat(2, minmax(200px, 1fr)); }
}
@media (max-width: 900px) {
  .catalog-table-simple { min-width: 1420px; }
  .catalog-table-simple td.marketplace-names-cell { min-width: 350px; max-width: 520px; }
  .catalog-table-simple td.catalog-status-cell { min-width: 96px; max-width: 120px; }
  .product-cost-composer { grid-template-columns: 1fr; }
  .product-cost-operator { min-height: 18px; transform: rotate(90deg); font-size: 18px; }
  .product-margin-workspace { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .product-margin-workspace, .product-readonly-values { grid-template-columns: 1fr; }
  .product-history-disclosure > summary { align-items: flex-start; }
}

/* 1.5.18 — static page entry, exact feedback and a manual motion switch */
.page-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: 4px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.page-progress::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(56, 189, 248, .14);
}
.page-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, transparent, #38bdf8 45%, #d8f6ff 76%, transparent);
  box-shadow: 0 0 18px rgba(56, 189, 248, .75);
  transform: translateX(-110%);
}
.page-progress.is-active { opacity: 1; }
.page-progress.is-active span { animation: page-progress-run 1.05s cubic-bezier(.45, 0, .25, 1) infinite; }

.message {
  display: flex;
  align-items: center;
  gap: 10px;
}
.message-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(94, 224, 160, .15);
  border: 1px solid rgba(94, 224, 160, .52);
  color: #8ff0bc;
  font-size: 13px;
  font-weight: 900;
}
.message.error .message-icon { background: rgba(255, 125, 137, .13); border-color: rgba(255, 125, 137, .55); color: #ffabb3; }
.message.warning .message-icon { background: rgba(255, 209, 102, .13); border-color: rgba(255, 209, 102, .55); color: #ffe39c; }

.packaging-reveal {
  max-height: 0;
  transform: translateY(-8px);
  transition: max-height .28s cubic-bezier(.22, 1, .36, 1), opacity .22s ease, transform .28s cubic-bezier(.22, 1, .36, 1);
}
.packaging-reveal.is-open { max-height: 88px; }
.product-history-disclosure > summary { transition: background .18s ease, color .18s ease; }
.product-history-disclosure > summary:hover { background: rgba(18, 48, 74, .42); }
.product-history-disclosure[open] > summary { background: rgba(15, 39, 61, .34); }

[data-cost-basis].is-value-updated,
[data-final-price].is-value-updated { display: inline-block; }

button.is-submitting { padding-right: 40px; }
button.is-submitting::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  z-index: 2;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(255, 255, 255, .36);
  border-top-color: #fff;
  border-radius: 50%;
  animation: submit-spinner .68s linear infinite;
}
button.is-submitting::after { height: 4px; }
.filter-panel.is-submitting-form,
.public-tools.is-submitting-form { opacity: .72; pointer-events: none; transition: opacity .18s ease; }

@media (prefers-reduced-motion: no-preference) {
  .message.success { box-shadow: 0 0 0 1px rgba(94, 224, 160, .08), 0 10px 32px rgba(12, 72, 48, .2); }
  .switch-control.is-switching .switch-track { animation: switch-feedback .36s cubic-bezier(.22, 1, .36, 1); }
  .product-history-disclosure[open] .product-history-content { animation: history-content-open .3s cubic-bezier(.22, 1, .36, 1) both; }
  [data-cost-basis].is-value-updated,
  [data-final-price].is-value-updated { animation: value-updated .4s cubic-bezier(.22, 1, .36, 1); }
  tr.is-row-edited { animation: row-edited .52s ease-out; }
}

@media (hover: hover) and (pointer: fine) {
  .card-link,
  .summary-chip,
  .work-queue-item,
  .freshness-card,
  .workflow-step {
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
  }
  .card-link:hover,
  .summary-chip:hover,
  .work-queue-item:hover,
  .freshness-card:hover,
  .workflow-step:hover {
    transform: translateY(-2px);
    border-color: #3979a4;
    box-shadow: 0 15px 36px rgba(0, 9, 24, .42), 0 0 0 1px rgba(56, 189, 248, .08);
  }
  .product-cost-composer > label,
  .product-packaging-control,
  .product-cost-result,
  .product-margin-field,
  .product-pricing-actions { transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
  .product-cost-composer > label:hover,
  .product-packaging-control:hover,
  .product-cost-result:hover,
  .product-margin-field:hover,
  .product-pricing-actions:hover { border-color: #315d7d; box-shadow: 0 9px 28px rgba(0, 8, 20, .25); }
  .office-main button:hover,
  .office-main .button:hover,
  .public-wrap button:hover,
  .public-wrap .button:hover { transform: translateY(-1px); }
  .office-main button:active,
  .office-main .button:active,
  .public-wrap button:active,
  .public-wrap .button:active { transform: translateY(1px) scale(.98); }
}

@keyframes page-progress-run {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(110%); }
  100% { transform: translateX(260%); }
}
@keyframes submit-spinner { to { transform: rotate(360deg); } }
@keyframes switch-feedback {
  0% { transform: scale(1); }
  48% { transform: scale(1.08); box-shadow: 0 0 0 7px rgba(56, 189, 248, .13); }
  100% { transform: scale(1); }
}
@keyframes value-updated {
  0% { transform: scale(1); background: transparent; }
  42% { transform: scale(1.055); background: rgba(56, 189, 248, .16); color: #dff8ff; }
  100% { transform: scale(1); background: transparent; }
}
@keyframes row-edited {
  0% { background: rgba(56, 189, 248, .2); box-shadow: inset 4px 0 #38bdf8; }
  100% { background: transparent; box-shadow: inset 0 0 transparent; }
}
@keyframes history-content-open {
  from { opacity: 0; transform: translateY(-8px); clip-path: inset(0 0 14% 0); }
  to { opacity: 1; transform: translateY(0); clip-path: inset(0); }
}

/* The interface remains fully visible if JavaScript is unavailable. Motion classes
   only add temporary feedback after the page is already usable. */
html.motion-reduced *,
html.motion-reduced *::before,
html.motion-reduced *::after {
  scroll-behavior: auto !important;
  transition-duration: .01ms !important;
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
}
html.motion-full .switch-control.is-switching .switch-track { animation: switch-feedback-visible .5s cubic-bezier(.16, 1, .3, 1); }
html.motion-full .product-history-disclosure[open] .product-history-content { animation: history-content-open .42s cubic-bezier(.16, 1, .3, 1) both; }
html.motion-full [data-cost-basis].is-value-updated,
html.motion-full [data-final-price].is-value-updated { animation: value-updated-visible .6s cubic-bezier(.16, 1, .3, 1); }
html.motion-full tr.is-row-edited { animation: row-edited-visible .66s ease-out; }

.page-progress { height: 6px; }
.page-progress span { width: 48%; box-shadow: 0 0 22px rgba(56, 189, 248, .92); }
.page-progress.is-active span { animation-duration: .88s; }
.motion-reduced .page-progress.is-active span {
  width: 100%;
  transform: none;
  animation: none !important;
  background: #38bdf8;
}
body.is-navigating { cursor: progress; }

button, .button { position: relative; overflow: hidden; isolation: isolate; }
.motion-ripple {
  position: absolute;
  z-index: 0;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 255, 255, .5);
  transform: scale(0);
  animation: motion-ripple-visible .7s ease-out forwards;
}
.sidebar-foot .motion-preference {
  color: #8fcaea;
  font-size: 11px;
}
.sidebar-foot .motion-preference[aria-pressed="false"] { color: var(--muted); }

@media (hover: hover) and (pointer: fine) {
  html.motion-full .card-link:hover,
  html.motion-full .summary-chip:hover,
  html.motion-full .work-queue-item:hover,
  html.motion-full .freshness-card:hover,
  html.motion-full .workflow-step:hover {
    transform: translateY(-3px);
    border-color: #4690bd;
    box-shadow: 0 18px 42px rgba(0, 9, 24, .5), 0 0 0 1px rgba(56, 189, 248, .12), 0 0 24px rgba(14, 165, 233, .08);
  }
}

@keyframes switch-feedback-visible {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); box-shadow: 0 0 0 9px rgba(56, 189, 248, .17), 0 0 24px rgba(56, 189, 248, .24); }
  100% { transform: scale(1); }
}
@keyframes value-updated-visible {
  0% { transform: scale(1); background: transparent; }
  38% { transform: scale(1.09); background: rgba(56, 189, 248, .22); color: #fff; text-shadow: 0 0 15px rgba(56, 189, 248, .52); }
  100% { transform: scale(1); background: transparent; text-shadow: none; }
}
@keyframes row-edited-visible {
  0% { background: rgba(56, 189, 248, .28); box-shadow: inset 5px 0 #38bdf8, 0 0 22px rgba(56, 189, 248, .08); }
  100% { background: transparent; box-shadow: inset 0 0 transparent; }
}
@keyframes motion-ripple-visible {
  0% { opacity: .52; transform: scale(0); }
  100% { opacity: 0; transform: scale(18); }
}
