:root {
      color-scheme: light;
      --bg: #eef3ff;
      --bg-shift-x: 0px;
      --bg-shift-y: 0px;
      --bg-glow-x: 50%;
      --bg-glow-y: 6%;
      --panel: rgba(255, 255, 255, .62);
      --panel-2: rgba(255, 255, 255, .78);
      --ink: #1d2a4d;
      --muted: #7a86a6;
      --soft: #a3adc8;
      --line: rgba(120, 135, 190, .22);
      --accent: #4c7cf3;
      --accent-2: #8b6cf0;
      --green: #2fc48d;
      --danger: #e4667e;
      --shadow: rgba(90, 110, 180, .16);
      --field-bg: rgba(255, 255, 255, .78);
      --field-bg-strong: rgba(255, 255, 255, .95);
      --soft-panel: rgba(255, 255, 255, .5);
      --hover-panel: linear-gradient(90deg, rgba(76, 124, 243, .14), rgba(255, 255, 255, .8));
      --table-head-bg: rgba(238, 243, 255, .98);
      --table-cell-bg: rgba(255, 255, 255, .7);
      --table-row-alt: rgba(76, 124, 243, .04);
      --table-frozen-bg: rgba(243, 246, 255, .98);
      --table-frozen-alt: rgba(236, 241, 255, .98);
      --table-frozen-hover: linear-gradient(90deg, rgba(214, 226, 255, .98), rgba(244, 247, 255, .98));
      --column-line: rgba(120, 135, 190, .14);
      --menu-bg: rgba(255, 255, 255, .98);
      --status-bg: #f4f7ff;
      --status-ink: #1d2a4d;
      --gtin-ink: #2f4fb8;
      --control-scheme: light;
      --b2b-flag-bg: rgba(255, 193, 7, .22);
      --b2b-flag-ink: #7a5b00;
      --age-orange: #b36b00;
      --age-red: #c62828;
      --side-grad: linear-gradient(180deg, #5a86f5, #6b6ff0 70%, #8a6cf0);
      --hero-grad: linear-gradient(120deg, #5b8cff, #7d8cf6 55%, #a99bf7);
      --radius: 16px;
      --glass-shadow: 0 8px 24px rgba(90, 110, 180, .13);
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      min-height: 100vh;
      font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
      color: var(--ink);
      background:
        radial-gradient(900px 500px at 8% 0%, #dfe9ff 0, transparent 60%),
        radial-gradient(700px 500px at 100% 18%, #eadcff 0, transparent 60%),
        linear-gradient(160deg, #eef3ff, #f3eeff 60%, #e9f6ff);
      background-attachment: fixed;
    }
    main {
      position: relative;
      width: min(1220px, calc(100% - 28px));
      margin: 0 auto;
      padding: 18px 0 46px;
    }
    header.hero {
      min-height: 280px;
      display: grid;
      align-content: center;
      justify-items: center;
      text-align: center;
      padding: 24px 0 18px;
    }
    .topbar {
      width: 100%;
      display: grid;
      grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
      align-items: center;
      gap: 14px;
      margin-bottom: 22px;
    }
    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 800;
      letter-spacing: 0;
    }
    .service-brand {
      position: relative;
      width: max-content;
      max-width: 100%;
      cursor: pointer;
      outline: none;
    }
    .service-brand::after {
      content: "";
      position: absolute;
      left: 0;
      top: 100%;
      width: min(340px, calc(100vw - 32px));
      height: 16px;
    }
    .service-menu {
      position: absolute;
      z-index: 70;
      top: calc(100% + 8px);
      left: 0;
      display: grid;
      min-width: 240px;
      max-width: min(340px, calc(100vw - 32px));
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--panel);
      box-shadow: 0 20px 60px rgba(60, 80, 160, .22);
      backdrop-filter: blur(16px);
    }
    .service-brand:hover .service-menu,
    .service-brand:focus-within .service-menu {
      display: grid !important;
    }
    .service-menu > a,
    .service-menu > button,
    .service-menu > span {
      display: flex;
      flex-direction: column;
      gap: 3px;
      width: 100%;
      padding: 10px 11px;
      border: 0;
      border-radius: 10px;
      background: transparent;
      color: var(--ink);
      text-decoration: none;
      font-weight: 850;
      font: inherit;
      text-align: left;
      cursor: pointer;
    }
    .service-menu > a:hover,
    .service-menu > button:hover {
      background: rgba(76, 124, 243, .16);
      transform: translateX(2px);
    }
    .service-menu small {
      color: var(--muted);
      font-weight: 700;
    }
    .brand-mark {
      width: 28px;
      height: 28px;
      border-radius: 9px;
      display: grid;
      place-items: center;
      background: var(--accent);
      color: white;
      font-weight: 900;
      box-shadow: 0 0 28px rgba(76, 124, 243, .6);
    }
    .pill {
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 8px 13px;
      color: var(--muted);
      background: rgba(255, 255, 255, .05);
      backdrop-filter: blur(10px);
    }
    .theme-switcher {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      padding: 4px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--soft-panel);
      box-shadow: 0 12px 34px rgba(76, 124, 243, .10);
      backdrop-filter: blur(14px);
    }
    .theme-switcher button {
      min-width: 88px;
      padding: 8px 12px;
      border-radius: 999px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--muted);
      box-shadow: none;
      font-weight: 800;
      transition: transform .16s ease, background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
    }
    .theme-switcher button:hover {
      transform: translateY(-1px);
      color: var(--ink);
      border-color: rgba(76, 124, 243, .34);
      background: rgba(76, 124, 243, .08);
    }
    .theme-switcher button.active {
      color: var(--gtin-ink);
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      box-shadow: 0 10px 24px rgba(76, 124, 243, .20);
    }
    .top-action {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      min-width: 96px;
    }
    .top-exit-button {
      min-width: 96px;
    }
    h1 {
      max-width: 760px;
      margin: 0 0 12px;
      font-size: clamp(36px, 7vw, 68px);
      line-height: .94;
      letter-spacing: 0;
    }
    h2, h3 {
      margin-top: 0;
      letter-spacing: 0;
    }
    p {
      color: var(--muted);
      line-height: 1.55;
    }
    .hero p {
      max-width: 620px;
      margin: 0 auto 22px;
      font-size: 15px;
    }
    .hero-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: center;
    }
    .stocks-nav-button.active {
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      color: #fff;
      border-color: rgba(255, 255, 255, .18);
      box-shadow: 0 14px 34px rgba(76, 124, 243, .24);
    }
    section {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 22px;
      margin-bottom: 16px;
      box-shadow: 0 22px 70px var(--shadow);
      backdrop-filter: blur(18px);
    }
    .section-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 18px;
      flex-wrap: wrap;
      margin-bottom: 16px;
    }
    .section-head h2 {
      margin-bottom: 4px;
    }
    .section-head p {
      margin: 0;
    }
    .row, .toolbar, .summary {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
    }
    .cabinets-admin-toolbar {
      display: flex;
      gap: 8px;
      margin-bottom: 14px;
    }
    .cabinets-admin-layout {
      display: flex;
      gap: 20px;
      align-items: flex-start;
    }
    .cabinets-admin-list-col {
      width: 260px;
      flex-shrink: 0;
    }
    .cabinets-admin-list {
      display: flex;
      flex-direction: column;
      gap: 4px;
      max-height: 520px;
      overflow-y: auto;
      border: 1px solid var(--border-color, rgba(128,128,128,0.3));
      border-radius: 8px;
      padding: 6px;
    }
    .cabinets-admin-list-item {
      padding: 8px 10px;
      border-radius: 6px;
      cursor: pointer;
      text-align: left;
    }
    .cabinets-admin-list-item.active {
      background: rgba(120, 120, 255, 0.18);
      font-weight: 600;
    }
    .cabinets-admin-list-group-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      padding: 8px 10px 2px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      opacity: 0.6;
    }
    .cabinets-admin-list-group-heading:first-child {
      padding-top: 2px;
    }
    .cabinets-admin-list-group-heading-delete {
      opacity: 0.7;
      cursor: pointer;
      text-transform: none;
      letter-spacing: normal;
      font-weight: 400;
      background: none;
      border: none;
      padding: 0 2px;
      font-size: 13px;
      color: inherit;
    }
    .cabinets-admin-list-group-heading-delete:hover {
      opacity: 1;
      color: #d33;
    }
    .cabinets-admin-list-buttons {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 8px;
    }
    .cabinets-admin-form-col {
      flex: 1;
      min-width: 320px;
    }
    .cabinets-admin-field-row {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 8px 0;
    }
    .cabinets-admin-field-row label,
    .cabinets-admin-field-row > span.field-label {
      width: 220px;
      flex-shrink: 0;
    }
    .cabinets-admin-field-row input[type="text"],
    .cabinets-admin-field-row input[type="password"],
    .cabinets-admin-field-row select {
      flex: 1;
    }
    .cabinets-admin-checkbox-row {
      gap: 8px;
    }
    .cabinets-admin-formula {
      margin-top: 18px;
      padding-top: 14px;
      border-top: 1px solid var(--border-color, rgba(128,128,128,0.3));
    }
    .cabinets-admin-formula-row {
      display: flex;
      gap: 8px;
      align-items: center;
      margin: 6px 0;
    }
    .cabinets-admin-formula-row .formula-from {
      width: 90px;
      opacity: 0.7;
    }
    .cabinets-admin-formula-row input[type="number"] {
      width: 100px;
    }
    .cabinets-admin-formula-row select {
      width: 140px;
    }
    .cabinets-admin-actions {
      display: flex;
      gap: 10px;
      margin-top: 18px;
    }
    .search-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .search-grid input {
      width: 100%;
    }
    #pairingSection {
      max-width: none;
    }
    .auth-device-row {
      display: block;
      margin-top: 18px;
      margin-bottom: 10px;
    }
    #deviceName {
      width: min(100%, 430px);
    }
    .auth-pin-row {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }
    #pinCode {
      width: 206px;
    }
    #authSubmit {
      min-width: 140px;
      white-space: nowrap;
    }
    .clearable-field {
      position: relative;
    }
    .clearable-field input {
      padding-right: 40px;
    }
    .clear-input-btn {
      position: absolute;
      top: 50%;
      right: 10px;
      transform: none;
      margin-top: -11px;
      width: 22px;
      height: 22px;
      border-radius: 999px;
      border: 1px solid rgba(255, 255, 255, .12);
      background: rgba(255, 255, 255, .08);
      color: var(--muted);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 18px;
      line-height: 20px;
      padding: 0;
      box-shadow: none;
      transition: background .16s ease, color .16s ease, border-color .16s ease;
    }
    .clear-input-btn:hover {
      color: var(--ink);
      background: rgba(255, 255, 255, .14);
      transform: none;
    }
    .clear-input-btn.hidden {
      display: none !important;
    }
    .table-wrap {
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--soft-panel);
    }
    .identifier-controls {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      margin-top: 14px;
      margin-bottom: 14px;
    }
    .page-size-control {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      color: var(--muted);
      font-size: 13px;
    }
    .page-size-picker {
      position: relative;
    }
    .page-size-button,
    .page-number-button,
    .sort-header {
      box-shadow: none;
    }
    .page-size-button {
      min-width: 76px;
      padding: 10px 36px 10px 14px;
      border: 1px solid rgba(76, 124, 243, .42);
      background: var(--field-bg);
      color: var(--ink);
      text-align: left;
      position: relative;
      transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
    }
    .page-size-button:hover {
      transform: translateY(-1px);
      border-color: rgba(76, 124, 243, .72);
      background: rgba(76, 124, 243, .16);
      box-shadow: 0 12px 26px rgba(76, 124, 243, .15);
    }
    .page-size-button::after {
      content: "";
      position: absolute;
      right: 14px;
      top: 50%;
      width: 7px;
      height: 7px;
      border-right: 2px solid currentColor;
      border-bottom: 2px solid currentColor;
      transform: translateY(-65%) rotate(45deg);
    }
    .page-size-menu {
      position: absolute;
      left: 0;
      top: calc(100% + 8px);
      min-width: 100%;
      padding: 6px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--menu-bg);
      box-shadow: 0 18px 42px rgba(0, 0, 0, .36);
      z-index: 30;
    }
    .page-size-menu.hidden {
      display: none;
    }
    .page-size-menu button {
      display: block;
      width: 100%;
      padding: 8px 10px;
      border-radius: 9px;
      background: transparent;
      color: var(--ink);
      text-align: left;
      box-shadow: none;
    }
    .page-size-menu button:hover,
    .page-size-menu button.active {
      background: rgba(76, 124, 243, .20);
    }
    .freeze-button {
      min-width: 166px;
    }
    .identifier-pagination {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      margin: 14px 0 14px;
    }
    .page-buttons {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .page-number-button {
      min-width: 40px;
      padding: 9px 12px;
      border: 1px solid var(--line);
      background: var(--field-bg);
      color: var(--ink);
      transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
    }
    .page-number-button:not(:disabled):hover {
      transform: translateY(-1px);
      border-color: rgba(76, 124, 243, .58);
      background: rgba(76, 124, 243, .16);
    }
    .page-number-button.active {
      border-color: rgba(76, 124, 243, .78);
      background: rgba(76, 124, 243, .24);
      box-shadow: 0 10px 24px rgba(76, 124, 243, .14);
    }
    .page-number-button:disabled {
      opacity: .46;
      cursor: default;
    }
    .sort-header {
      width: 100%;
      min-height: 28px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 0;
      border: none;
      border-radius: 0;
      background: transparent;
      color: inherit;
      font: inherit;
      font-weight: 800;
      cursor: pointer;
      transition: color .16s ease, background .16s ease, transform .16s ease;
    }
    .sort-header:hover {
      color: var(--accent);
      transform: translateY(-1px);
    }
    .sort-header::after {
      content: "↕";
      color: var(--muted);
      font-size: 12px;
      line-height: 1;
    }
    .sort-header.sort-asc::after {
      content: "▲";
      color: var(--accent);
    }
    .sort-header.sort-desc::after {
      content: "▼";
      color: var(--accent);
    }
    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 860px;
    }
    .identifier-table {
      width: max-content;
      min-width: 2570px;
      table-layout: fixed;
      border-collapse: separate;
      border-spacing: 0;
    }
    th, td {
      text-align: left;
      vertical-align: top;
      padding: 12px 14px;
      border-bottom: 1px solid var(--line);
      font-size: 14px;
      transition: background .14s ease, color .14s ease, box-shadow .14s ease, border-color .14s ease;
    }
    th {
      text-align: center;
      color: var(--muted);
      font-weight: 700;
      position: sticky;
      top: 0;
      background: var(--table-head-bg);
      z-index: 1;
    }
    .identifier-table th {
      user-select: none;
    }
    .identifier-table th,
    .identifier-table td {
      position: relative;
      background-clip: padding-box;
    }
    .identifier-photo-cell {
      text-align: center;
      vertical-align: middle;
    }
    .identifier-photo {
      width: 72px;
      height: 92px;
      object-fit: contain;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: var(--field-bg);
      display: block;
      margin: 0 auto;
    }
    .identifier-photo-preview {
      position: fixed;
      width: 288px;
      height: 368px;
      max-width: calc(100vw - 24px);
      max-height: calc(100vh - 24px);
      object-fit: contain;
      border-radius: 10px;
      border: 1px solid var(--line);
      background: var(--field-bg-strong);
      box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
      pointer-events: none;
      opacity: 0;
      transform: scale(.98);
      transition: opacity .12s ease, transform .12s ease;
      z-index: 2000;
    }
    .identifier-photo-preview.visible {
      opacity: 1;
      transform: scale(1);
    }
    .identifier-photo-placeholder {
      width: 72px;
      height: 92px;
      border-radius: 8px;
      border: 1px dashed var(--line);
      color: var(--muted);
      background: var(--field-bg);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 800;
    }
    .identifier-stock-cell {
      text-align: right;
      white-space: nowrap;
      font-weight: 800;
      font-variant-numeric: tabular-nums;
    }
    .identifier-table .frozen-cell {
      position: sticky;
      z-index: 3;
    }
    .identifier-table th.frozen-cell {
      z-index: 5;
      background: var(--table-head-bg);
    }
    .identifier-table td.frozen-cell {
      background: var(--table-frozen-bg);
    }
    .identifier-table tbody tr:nth-child(odd) td.frozen-cell {
      background: var(--table-frozen-alt);
    }
    .identifier-table tbody tr:hover td.frozen-cell {
      background: var(--table-frozen-hover);
    }
    th[data-col-index] {
      position: relative;
      background-clip: padding-box;
    }
    .column-resize-handle {
      position: absolute;
      top: 0;
      right: -4px;
      width: 9px;
      height: 100%;
      cursor: col-resize;
      z-index: 8;
      touch-action: none;
    }
    .column-resize-handle::after {
      content: "";
      position: absolute;
      top: 18%;
      bottom: 18%;
      left: 4px;
      width: 1px;
      border-radius: 999px;
      background: var(--column-line);
      transition: background .16s ease, box-shadow .16s ease;
    }
    .column-resize-handle:hover::after,
    .column-resize-handle.resizing::after {
      background: rgba(76, 124, 243, .85);
      box-shadow: 0 0 12px rgba(76, 124, 243, .35);
    }
    th:not(:last-child),
    td:not(:last-child) {
      border-right: 1px solid var(--column-line);
    }
    tbody tr:nth-child(odd) td {
      background: var(--table-row-alt);
    }
    tbody tr {
      cursor: default;
    }
    tbody tr:hover td {
      background: var(--hover-panel);
      border-bottom-color: rgba(76, 124, 243, .32);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), inset 0 -1px 0 rgba(76, 124, 243, .10);
    }
    tbody tr:hover td:first-child {
      box-shadow: inset 3px 0 0 var(--accent), inset 0 1px 0 rgba(255, 255, 255, .05), inset 0 -1px 0 rgba(76, 124, 243, .10);
    }
    td {
      color: var(--ink);
    }
    .barcode-stack {
      display: grid;
      gap: 5px;
      min-width: 150px;
    }
    .barcode-line {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 2px 0;
      line-height: 1.28;
    }
    .barcode-line.gtin-line {
      margin-bottom: 2px;
      padding: 5px 8px;
      border: 1px solid rgba(76, 124, 243, .45);
      border-radius: 9px;
      background: rgba(76, 124, 243, .14);
      color: #fff;
      font-weight: 800;
      box-shadow: inset 3px 0 0 var(--accent);
    }
    .code-type {
      flex: 0 0 auto;
      padding: 2px 6px;
      border-radius: 999px;
      background: rgba(76, 124, 243, .22);
      color: #fff;
      font-size: 10px;
      font-weight: 900;
      letter-spacing: 0;
    }
    .article-stack {
      display: grid;
      gap: 7px;
      min-width: 190px;
    }
    .article-link {
      display: flex;
      align-items: flex-start;
      gap: 7px;
      width: 100%;
      padding: 6px 8px;
      border: 1px solid rgba(255, 255, 255, .08);
      border-radius: 10px;
      background: rgba(255, 255, 255, .045);
      color: var(--ink);
      text-decoration: none;
      line-height: 1.28;
      white-space: nowrap;
      transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
    }
    .article-link:hover {
      transform: translateY(-1px);
      border-color: rgba(76, 124, 243, .46);
      background: rgba(76, 124, 243, .13);
      box-shadow: 0 10px 24px rgba(76, 124, 243, .12);
    }
    .article-link.no-url {
      cursor: default;
    }
    .article-link.no-url:hover {
      transform: none;
      border-color: rgba(255, 255, 255, .08);
      background: rgba(255, 255, 255, .045);
      box-shadow: none;
    }
    .article-cabinet {
      flex: 0 0 auto;
      max-width: 92px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      padding: 2px 6px;
      border-radius: 999px;
      background: rgba(255, 255, 255, .09);
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
    }
    .article-text {
      min-width: 0;
      white-space: nowrap;
      overflow-wrap: normal;
    }
    tr:last-child td {
      border-bottom: none;
    }
    .filter-row {
      margin-top: 12px;
      padding: 12px 14px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--soft-panel);
    }
    .filter-title {
      font-size: 13px;
      color: var(--muted);
      margin-bottom: 8px;
    }
    .checkbox-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }
    .checkbox-pill,
    .chip-checkbox {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--soft-panel);
      color: var(--ink);
      user-select: none;
    }
    .collision-toolbar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
      margin: 14px 0;
    }
    .collision-tabs {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin: 8px 0 14px;
    }
    .collision-tab-button.active {
      background: rgba(76, 124, 243, .22);
      border-color: rgba(76, 124, 243, .65);
      color: var(--gtin-ink);
      box-shadow: 0 12px 26px rgba(76, 124, 243, .16);
    }
    .collision-summary {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin: 10px 0 14px;
    }
    .collision-stat {
      padding: 8px 12px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--soft-panel);
      color: var(--muted);
      font-size: 13px;
    }
    .collision-table {
      min-width: 1960px;
      width: max-content;
      table-layout: fixed;
    }
    .collision-table td {
      vertical-align: top;
      overflow-wrap: anywhere;
    }
    .collision-table .status-resolved {
      color: #86efac;
      font-weight: 800;
    }
    .collision-table .status-error {
      color: #ff8b8b;
      font-weight: 800;
    }
    .collision-candidate {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      gap: 8px;
      align-items: start;
      min-width: 360px;
    }
    .collision-candidate input {
      margin-top: 3px;
      transform: scale(1.1);
      accent-color: var(--accent);
    }
    .collision-candidate-title {
      font-weight: 800;
      line-height: 1.35;
    }
    .collision-candidate-sub {
      color: var(--muted);
      font-size: 12px;
      margin-top: 4px;
      overflow-wrap: anywhere;
    }
    .collision-extra {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
      min-width: 320px;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    .collision-item-cell {
      min-width: 380px;
      white-space: normal !important;
      overflow-wrap: anywhere;
    }
    .collision-cabinet-cell {
      min-width: 170px;
    }
    .collision-barcode-cell {
      min-width: 150px;
      font-variant-numeric: tabular-nums;
    }
    .exclusion-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      margin: 12px 0 16px;
    }
    .exclusion-toolbar input {
      min-width: min(520px, 100%);
      flex: 1 1 360px;
    }
    .exclusion-layout {
      display: grid;
      grid-template-columns: minmax(0, 1.55fr) minmax(340px, .75fr);
      gap: 14px;
      align-items: start;
    }
    .exclusion-table {
      min-width: 980px;
      table-layout: fixed;
    }
    .exclusion-table tbody tr {
      cursor: pointer;
    }
    .exclusion-table tbody tr.selected-row td {
      background: rgba(76, 124, 243, .20);
      border-bottom-color: rgba(76, 124, 243, .38);
    }
    .exclusion-product-cell {
      min-width: 380px;
      white-space: normal !important;
      overflow-wrap: anywhere;
    }
    .exclusion-detail {
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--soft-panel);
      padding: 16px;
      min-height: 240px;
      position: sticky;
      top: 12px;
    }
    .exclusion-selected-title {
      margin: 0 0 12px;
      color: var(--ink);
      font-weight: 800;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }
    .exclusion-cabinet-list {
      display: grid;
      gap: 8px;
      max-height: 54vh;
      overflow: auto;
      padding-right: 4px;
    }
    .table-pager {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 12px 0;
    }
    .report-history-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin: 12px 0;
      max-height: 30vh;
      overflow: auto;
    }
    .report-history-list button {
      white-space: nowrap;
    }
    /* A batch covering many cabinets makes cabinets_label a long comma-joined string
       (500+ chars for ~20 cabinets) -- inheriting nowrap forced this single button to
       thousands of pixels wide, which broke the modal's grid centering and sent the
       whole dialog flying off past the edge of the screen instead of appearing
       centered (found live 2026-09-05). Each run gets its own full-width, wrapping row. */
    #latestReportHistoryRuns button {
      white-space: normal;
      overflow-wrap: break-word;
      text-align: left;
      flex: 1 1 100%;
      max-width: 100%;
    }
    .exclusion-cabinet-check {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 9px 10px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--soft-panel);
      cursor: pointer;
      transition: background .16s ease, border-color .16s ease, transform .16s ease;
    }
    .exclusion-cabinet-check:hover {
      transform: translateY(-1px);
      border-color: rgba(76, 124, 243, .5);
      background: rgba(76, 124, 243, .12);
    }
    .exclusion-cabinet-check input {
      margin-top: 2px;
      accent-color: var(--accent);
    }
    .cabinet-selector {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      margin: 12px 0;
    }
    .cabinet-selector .chip-checkbox {
      border-radius: 8px;
    }
    .send-cabinet-global-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      width: 100%;
      margin-bottom: 10px;
    }
    .send-platform-group {
      width: 100%;
      margin-bottom: 10px;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--panel-2);
    }
    .send-platform-group .cabinet-selector {
      margin: 6px 0 4px;
    }
    .send-platform-head {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .send-platform-head strong {
      min-width: 40px;
    }
    .modal-cabinet-list {
      display: grid;
      gap: 8px;
      max-height: 52vh;
      overflow: auto;
      margin-top: 12px;
    }
    .report-pager {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      margin-top: 12px;
    }
    .stock-overview-table {
      min-width: 1320px;
      table-layout: fixed;
    }
    .stock-overview-table th {
      vertical-align: middle;
      text-align: center;
    }
    .stock-overview-table td {
      vertical-align: top;
      overflow-wrap: anywhere;
    }
    .stock-overview-ea {
      font-weight: 800;
      font-variant-numeric: tabular-nums;
    }
    .stock-overview-metrics {
      display: grid;
      gap: 5px;
      min-width: 210px;
    }
    .stock-overview-metric {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      padding-bottom: 4px;
      border-bottom: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
    }
    .stock-overview-metric:last-child {
      padding-bottom: 0;
      border-bottom: 0;
    }
    .stock-overview-metric small {
      color: var(--muted);
      overflow-wrap: anywhere;
    }
    .stock-overview-metric strong {
      min-width: 34px;
      text-align: right;
      color: var(--ink);
      font-variant-numeric: tabular-nums;
    }
    .stock-overview-export-options {
      display: grid;
      grid-template-columns: repeat(2, minmax(190px, 1fr));
      gap: 8px;
      margin: 14px 0;
    }
    .stock-overview-export-options label {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--soft-panel);
    }
    .stock-overview-export-options input {
      width: auto;
      min-width: 0;
      margin: 0;
    }
    .latest-report-table {
      min-width: 1820px;
      table-layout: fixed;
    }
    .latest-report-table th,
    .latest-report-table td {
      vertical-align: top;
      overflow-wrap: anywhere;
    }
    .identifier-row-clickable {
      cursor: pointer;
    }
    .identifier-row-clickable:hover {
      background: var(--soft-panel);
    }
    .item-rule-cabinet-row {
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: 9px 10px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--soft-panel);
    }
    .item-rule-cabinet-name {
      font-weight: 600;
    }
    .socks-form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(220px, 1fr));
      gap: 10px;
      margin: 14px 0;
    }
    .socks-form-grid input {
      width: 100%;
    }
    .socks-upload-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      margin: 12px 0;
    }
    .socks-upload-row input[type="file"] {
      flex: 1 1 360px;
      min-width: min(100%, 320px);
    }
    .socks-option-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin: 12px 0;
    }
    .socks-mode-tabs {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin: 10px 0;
    }
    .socks-mode-tabs button.active {
      background: rgba(76, 124, 243, .22);
      border-color: rgba(76, 124, 243, .65);
      box-shadow: 0 12px 26px rgba(76, 124, 243, .16);
    }
    .socks-table {
      min-width: 1160px;
      width: 100%;
    }
    .socks-table td,
    .socks-table th {
      vertical-align: top;
    }
    .socks-table .wide-cell {
      min-width: 320px;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    .socks-preview-section {
      margin-top: 16px;
    }
    .socks-preview-section h3 {
      margin: 0 0 8px;
    }
    .socks-preview-table {
      min-width: 980px;
      width: 100%;
    }
    .socks-preview-table .name-cell {
      min-width: 360px;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    .socks-preview-table td:first-child {
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }
    .b2b-upload-row {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      margin: 14px 0;
    }
    .b2b-upload-row input[type="file"] {
      min-width: min(100%, 420px);
      color: var(--muted);
    }
    .fbs-history-days-control {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
    }
    .fbs-history-days-control input[type="number"] {
      width: 76px;
    }
    .b2b-upload-row input[type="file"]::file-selector-button {
      margin-right: 10px;
      padding: 9px 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--field-bg);
      color: var(--ink);
      font: inherit;
      cursor: pointer;
    }
    .b2b-prices-grid,
    .b2b-website-common {
      display: grid;
      grid-template-columns: repeat(4, minmax(150px, 1fr));
      gap: 10px;
      margin: 12px 0;
    }
    .b2b-prices-grid {
      grid-template-columns: minmax(260px, 1.3fr) minmax(280px, 2fr) auto auto;
      align-items: center;
    }
    .b2b-prices-grid select,
    .b2b-prices-grid input,
    .b2b-website-common input {
      width: 100%;
      min-width: 0;
    }
    .b2b-website-wide {
      grid-column: span 2;
    }
    .b2b-website-table-wrap {
      max-height: 62vh;
      overflow: auto;
    }
    .b2b-website-table {
      min-width: 2200px;
    }
    .b2b-website-table td {
      vertical-align: top;
    }
    .b2b-website-table .b2b-web-long {
      min-width: 280px;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    .b2b-website-table .b2b-web-short {
      min-width: 120px;
    }
    .b2b-website-table .b2b-photo-url-cell {
      min-width: 300px;
      width: 320px;
    }
    .b2b-website-table .b2b-photo-preview-cell {
      min-width: 118px;
      width: 132px;
      text-align: center;
    }
    .b2b-photo-select {
      min-width: 280px;
      max-width: 320px;
      width: 100%;
    }
    .b2b-photo-select option {
      color: #1d1614;
      background: #fff8f3;
    }
    .b2b-photo-preview {
      min-height: 82px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .b2b-photo-preview img {
      display: block;
      width: auto;
      height: 82px;
      max-width: 132px;
      max-height: 160px;
      object-fit: contain;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: var(--field-bg);
    }
    .b2b-photo-preview.is-broken img {
      display: none;
    }
    .b2b-table {
      min-width: 1460px;
    }
    .b2b-manual-search-wrap {
      max-height: 380px;
      overflow: auto;
    }
    .b2b-manual-search-wrap .b2b-table {
      min-width: 1180px;
    }
    .b2b-manual-search-wrap thead th {
      position: sticky;
      top: 0;
      z-index: 2;
      background: var(--table-head-bg);
    }
    .b2b-manual-search-wrap tbody tr {
      height: 52px;
    }
    .b2b-table th,
    .b2b-table td {
      vertical-align: middle;
    }
    .fbs-table th.fbs-sortable {
      cursor: pointer;
      user-select: none;
      white-space: nowrap;
    }
    .fbs-table th.fbs-sortable:hover {
      color: var(--accent);
    }
    .fbs-filter-input {
      width: 100%;
      box-sizing: border-box;
      font-size: 12px;
      padding: 3px 6px;
    }
    #fbsOrdersStatus:empty,
    #fbsSuppliesStatus:empty {
      display: none;
    }
    .fbs-orders-toolbar {
      align-items: center;
      gap: 18px;
    }
    .fbs-add-to-supply-action {
      margin-left: 36px;
    }
    .fbs-orders-summary {
      display: inline-flex;
      align-items: baseline;
      gap: 9px;
      min-width: 155px;
    }
    .fbs-orders-summary strong {
      color: var(--ink);
      font-size: 25px;
      font-weight: 800;
      line-height: 1;
    }
    .fbs-orders-summary span {
      color: var(--muted);
      font-size: 14px;
      font-weight: 600;
    }
    .fbs-master-check-cell,
    .fbs-selection-count-cell {
      width: 40px;
      min-width: 40px;
      text-align: center;
    }
    #fbsSuppliesHeaderRow th {
      white-space: pre-line;
    }
    .fbs-money-cell {
      text-align: right;
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }
    #fbsOrdersRows tr.fbs-order-b2b td {
      background: var(--b2b-flag-bg);
    }
    [data-fbs-order-age].fbs-age-green {
      color: var(--green);
      font-weight: 600;
    }
    [data-fbs-order-age].fbs-age-orange {
      color: var(--age-orange);
      font-weight: 600;
    }
    [data-fbs-order-age].fbs-age-red {
      color: var(--age-red);
      font-weight: 700;
    }
    .cert-days-green {
      color: var(--green);
      font-weight: 600;
    }
    .cert-days-orange {
      color: var(--age-orange);
      font-weight: 600;
    }
    .cert-days-red {
      color: var(--age-red);
      font-weight: 700;
    }
    .fbs-b2b-tag {
      font-weight: 800;
      color: var(--b2b-flag-ink);
    }
    .fbs-b2b-warning {
      background: var(--b2b-flag-bg);
      color: var(--b2b-flag-ink);
      font-weight: 600;
      padding: 8px 10px;
      border-radius: 8px;
    }
    .fbs-master-check-cell input[type="checkbox"] {
      width: 18px;
      height: 18px;
      cursor: pointer;
    }
    .fbs-selection-count-cell span {
      display: inline-block;
      min-width: 48px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }
    .fbs-stock-cell {
      min-width: 112px;
      text-align: center;
      font-variant-numeric: tabular-nums;
      font-weight: 700;
    }
    .fbs-filter-button {
      width: 100%;
      min-width: 78px;
      padding: 5px 8px;
      font-size: 12px;
      white-space: nowrap;
    }
    .fbs-filter-button.active {
      border-color: var(--accent);
      color: var(--accent);
    }
    .b2b-qty-modal-panel.fbs-column-filter-panel {
      width: min(560px, calc(100vw - 36px));
      max-height: calc(100vh - 36px);
      overflow: hidden;
    }
    .fbs-column-filter-panel > input {
      width: 100%;
      box-sizing: border-box;
    }
    .fbs-column-filter-actions {
      margin: 10px 0;
    }
    .fbs-column-filter-options {
      display: grid;
      gap: 3px;
      max-height: min(420px, calc(100vh - 300px));
      padding: 6px;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--field-bg);
    }
    .fbs-filter-option {
      display: grid;
      grid-template-columns: 22px minmax(0, 1fr);
      align-items: center;
      gap: 7px;
      min-height: 30px;
      padding: 3px 7px;
      border-radius: 6px;
      cursor: pointer;
    }
    /* display: grid выше перебивает встроенное [hidden]{display:none} -- строка
       оставалась видимой при поиске в модалке фильтра, даже когда JS уже
       проставлял ей hidden. */
    .fbs-filter-option[hidden] {
      display: none;
    }
    .fbs-filter-option:hover {
      background: var(--soft-panel);
    }
    .fbs-filter-option span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .fbs-button-group {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .fbs-supply-row {
      cursor: pointer;
    }
    .fbs-stage-has-tip {
      cursor: help;
      text-decoration: underline dotted;
      text-underline-offset: 3px;
    }
    .fbs-stage-meta {
      display: block;
      margin-top: 2px;
      white-space: nowrap;
    }
    .b2b-qty-modal-panel.fbs-supply-detail-panel {
      width: min(1180px, calc(100vw - 36px));
      max-width: none;
      max-height: calc(100vh - 36px);
      overflow: auto;
    }
    .fbs-supply-detail-table-wrap {
      max-height: calc(100vh - 250px);
      overflow: auto;
    }
    .fbs-supply-detail-table-wrap .fbs-table {
      min-width: 900px;
      width: 100%;
    }
    .fbs-supply-detail-panel .fbs-filter-input {
      width: 100%;
      margin-top: 0;
    }
    .fbs-supply-detail-table-wrap thead th {
      position: sticky;
      background: var(--table-head-bg);
      z-index: 2;
    }
    .fbs-supply-detail-table-wrap thead tr:first-child th {
      top: 0;
    }
    .fbs-supply-detail-table-wrap thead tr:nth-child(2) th {
      top: 33px;
    }
    .b2b-qty-modal-panel.fbs-move-panel {
      width: min(720px, 100%);
      max-height: calc(100vh - 36px);
      overflow: auto;
    }
    .b2b-qty-modal-panel.fbs-supply-panel {
      width: min(600px, 100%);
    }
    /* Заказ/Статус — прогресс отправки поставки и переноса заказов. Раньше
       наследовали .b2b-table's min-width: 1460px (рассчитан на большие таблицы
       заказов/поставок с кучей колонок) внутри узкой модалки -- это растягивало
       колонку "Заказ" (обычные 6-10-значные ID) и вызывало горизонтальную
       прокрутку. Здесь колонок всего 2-3 и они должны укладываться в ширину
       панели без прокрутки. */
    .fbs-progress-table {
      min-width: 0;
      width: 100%;
      table-layout: fixed;
    }
    .fbs-progress-table th,
    .fbs-progress-table td {
      word-break: break-word;
      vertical-align: top;
    }
    .fbs-progress-table .fbs-progress-order {
      width: 92px;
    }
    .fbs-progress-table .fbs-progress-action {
      width: 46px;
      text-align: center;
    }
    .fbs-progress-table .fbs-progress-action button {
      padding: 3px 6px;
    }
    .fbs-move-target-list {
      display: grid;
      gap: 8px;
      max-height: 360px;
      overflow: auto;
      margin-top: 12px;
    }
    .fbs-move-target-row {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 9px;
      cursor: pointer;
    }
    .b2b-qty-modal-panel .fbs-move-target-row input {
      width: auto;
      margin: 3px 0 0;
    }
    .b2b-table .b2b-code-kind {
      font-weight: 800;
      white-space: nowrap;
    }
    .b2b-table .b2b-code-gtin {
      color: #8ef0b7;
      font-weight: 800;
    }
    .b2b-table .b2b-code-barcode {
      color: #7bc9ff;
      font-weight: 800;
    }
    .b2b-table tr.b2b-missing td {
      background: rgba(76, 124, 243, .13);
    }
    .b2b-table .b2b-editable {
      cursor: text;
      min-width: 120px;
    }
    .b2b-table .b2b-editable:hover {
      background: rgba(76, 124, 243, .08);
    }
    .b2b-table .b2b-edit-input {
      width: 100%;
      min-width: 130px;
      box-sizing: border-box;
      padding: 7px 8px;
      border-radius: 6px;
    }
    .b2b-table .b2b-qty-input {
      width: 82px;
      min-width: 82px;
      padding: 7px 8px;
      border-radius: 6px;
      text-align: center;
    }
    .b2b-table .b2b-action-cell {
      white-space: nowrap;
    }
    .b2b-table .b2b-action-cell button {
      padding: 8px 11px;
      min-height: 34px;
      border-radius: 8px;
    }
    .b2b-table .b2b-manual-source {
      min-width: 300px;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    .b2b-table tr.b2b-search-row:hover td {
      background: var(--hover-panel);
    }
    .b2b-qty-modal {
      position: fixed;
      inset: 0;
      z-index: 80;
      display: grid;
      place-items: center;
      padding: 18px;
      background: rgba(0, 0, 0, .58);
      backdrop-filter: blur(8px);
    }
    .b2b-qty-modal-panel {
      width: min(520px, 100%);
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--panel-2);
      box-shadow: 0 24px 80px var(--shadow);
      padding: 20px;
    }
    .b2b-qty-modal-panel h3 {
      margin: 0 0 8px;
      font-size: 22px;
    }
    .b2b-qty-modal-panel .b2b-note {
      margin: 5px 0;
    }
    .b2b-qty-modal-panel input {
      width: 160px;
      margin-top: 14px;
    }
    .b2b-qty-modal-panel.staff-payment-modal-panel {
      width: min(560px, calc(100vw - 36px));
      max-height: calc(100vh - 36px);
      overflow: auto;
    }
    .b2b-qty-modal-panel.staff-payment-modal-panel.staff-payment-wide {
      width: min(980px, calc(100vw - 36px));
    }
    .staff-payment-modal-panel #staffPaymentContent {
      min-width: 0;
    }
    .staff-payment-modal-panel #staffPaymentContent table {
      width: 100%;
      min-width: 760px;
    }
    .staff-payment-header {
      display: flex;
      align-items: flex-start;
      gap: 16px;
      margin-bottom: 20px;
    }
    .staff-payment-header h3 {
      flex: 1;
      min-width: 0;
      margin: 0;
      overflow-wrap: anywhere;
    }
    .staff-payment-header button {
      flex: 0 0 40px;
      min-height: 40px;
    }
    .staff-correction-form {
      display: grid;
      gap: 20px;
      min-width: 0;
      margin-top: 16px;
    }
    .staff-correction-form .staff-form-field {
      display: grid;
      gap: 8px;
      min-width: 0;
      margin: 0;
    }
    .staff-form-field > span {
      font-weight: 600;
    }
    .staff-correction-form input,
    .staff-correction-form select,
    .staff-correction-form textarea {
      box-sizing: border-box;
      width: 100%;
      min-width: 0;
      max-width: 100%;
      min-height: 44px;
      margin: 0;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 13px;
      background: var(--field-bg);
      color: var(--ink);
      font: inherit;
      line-height: 1.5;
    }
    .staff-correction-form textarea {
      min-height: 112px;
      resize: vertical;
    }
    .staff-correction-form textarea:focus {
      outline: none;
      border-color: rgba(76, 124, 243, .76);
      box-shadow: 0 0 0 3px rgba(76, 124, 243, .14);
    }
    .staff-correction-form small {
      color: var(--muted);
      line-height: 1.5;
    }
    .staff-form-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
    }
    .staff-form-actions button {
      max-width: 100%;
      white-space: normal;
    }
    .staff-correction-form [role="alert"] {
      margin: 0;
      color: var(--accent);
      overflow-wrap: anywhere;
    }
    .staff-correction-form [role="alert"]:empty {
      display: none;
    }
    .b2b-qty-modal-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 16px;
    }
    .fbs-print-orientation-options {
      display: flex;
      gap: 18px;
      margin-top: 12px;
      flex-wrap: wrap;
    }
    .fbs-print-orientation-option {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 10px;
      cursor: pointer;
      background: var(--panel);
    }
    .fbs-print-orientation-option:has(input:checked) {
      border-color: var(--accent, #4d8dff);
      background: var(--soft-panel);
    }
    .fbs-print-orientation-option input {
      margin: 0;
    }
    .fbs-print-orientation-thumb svg rect:first-child {
      fill: var(--panel-2);
      stroke: var(--line);
      stroke-width: 2;
    }
    .fbs-print-orientation-thumb-block {
      fill: var(--line);
    }
    .fbs-print-orientation-thumb-line {
      fill: var(--muted);
    }
    .b2b-note {
      margin: 0;
      color: var(--muted);
    }
    .b2b-unavailable {
      max-width: 760px;
      padding: 18px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--soft-panel);
    }
    .public-price-nav {
      display: grid;
      gap: 14px;
      margin-bottom: 16px;
    }
    .public-price-auth-card {
      max-width: 760px;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--panel-2);
      padding: 18px;
      box-shadow: 0 18px 60px var(--shadow);
    }
    .public-price-auth-card h3 {
      margin: 0 0 12px;
      font-size: 24px;
    }
    .public-price-register-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(180px, 1fr));
      gap: 10px;
      margin-top: 12px;
    }
    .public-price-search-row input {
      min-width: min(100%, 360px);
    }
    .public-price-nav-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
    }
    .public-price-nav-row .mini {
      min-width: 92px;
    }
    .public-price-chip {
      position: relative;
      display: inline-flex;
    }
    .public-price-chip.is-hidden {
      order: 50;
    }
    .public-price-button {
      position: relative;
      padding-right: 34px;
      transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
    }
    .public-price-button:hover {
      transform: translateY(-1px);
      border-color: rgba(239, 68, 68, .42);
    }
    .public-price-button.active {
      background: linear-gradient(135deg, var(--accent), #ff6d55);
      color: #fff;
      border-color: rgba(255, 255, 255, 0.24);
      box-shadow: 0 18px 44px rgba(239, 68, 68, 0.24);
    }
    .public-price-button.is-hidden {
      order: 50;
      opacity: .48;
      filter: grayscale(.3);
    }
    .public-price-hide {
      position: absolute;
      top: -7px;
      right: -7px;
      width: 22px;
      height: 22px;
      min-height: 22px;
      padding: 0;
      border-radius: 50%;
      display: inline-grid;
      place-items: center;
      font-size: 15px;
      line-height: 1;
      color: var(--ink);
      background: var(--panel-2);
      border: 1px solid var(--line);
      box-shadow: 0 8px 20px var(--shadow);
    }
    .public-price-hide:hover {
      transform: translateY(-1px) scale(1.04);
      border-color: rgba(239, 68, 68, .55);
    }
    .public-price-summary {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin: 12px 0;
    }
    .public-price-table-wrap {
      max-height: 72vh;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--soft-panel);
    }
    .public-price-table {
      min-width: 1520px;
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
    }
    .public-price-table th,
    .public-price-table td {
      border-right: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
      padding: 10px 12px;
      vertical-align: middle;
      background: var(--table-cell-bg);
    }
    .public-price-table th {
      position: sticky;
      top: 0;
      z-index: 2;
      background: var(--table-head-bg);
      color: var(--muted);
      text-align: center;
      font-weight: 900;
    }
    .public-price-table .public-price-group-row td {
      position: sticky;
      left: 0;
      z-index: 1;
      background: var(--panel-2);
      font-size: 16px;
      font-weight: 900;
      color: var(--ink);
    }
    .public-price-table tr.public-price-target td {
      background: rgba(239, 68, 68, .22);
      box-shadow: inset 3px 0 0 var(--accent);
    }
    .public-price-photo {
      width: 86px;
      height: 104px;
      object-fit: contain;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: var(--field-bg);
    }
    .public-price-text {
      min-width: 260px;
      white-space: normal;
      line-height: 1.35;
    }
    .public-price-size-cell {
      width: 92px;
      min-width: 92px;
      text-align: center;
    }
    .public-price-size-cell.available {
      background: var(--table-cell-bg);
    }
    .public-price-size-cell.unavailable {
      background: rgba(239, 68, 68, 0.36);
      color: var(--ink);
      font-weight: 900;
    }
    .public-stock-label {
      display: block;
      margin-bottom: 5px;
      font-size: 11px;
      color: var(--muted);
      white-space: nowrap;
    }
    .public-stock-label.low {
      color: #d97706;
    }
    .public-stock-label.enough {
      color: #16806b;
    }
    .public-stock-label.many {
      color: #15803d;
    }
    .public-order-input {
      width: 74px;
      min-width: 74px;
      padding: 7px 8px;
      text-align: center;
      border-radius: 8px;
    }
    .public-order-total {
      align-self: center;
      color: var(--ink);
      font-weight: 900;
      padding: 10px 14px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--soft-panel);
    }
    .public-order-manager-list {
      display: grid;
      gap: 10px;
      margin: 16px 0 8px;
    }
    .public-order-modal-panel {
      max-width: 560px;
    }
    .public-price-search-result {
      display: inline-flex;
      gap: 8px;
      align-items: center;
      margin-left: 8px;
    }
    .admin-layout {
      display: grid;
      grid-template-columns: minmax(320px, .8fr) minmax(520px, 1.2fr);
      gap: 16px;
      align-items: start;
    }
    .admin-panel {
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--soft-panel);
      padding: 16px;
    }
    .admin-yandex-controls {
      display: grid;
      grid-template-columns: minmax(260px, 1fr);
      gap: 10px;
    }
    .admin-yandex-controls select,
    .admin-yandex-controls input,
    .admin-edit-grid input,
    .admin-edit-grid select {
      width: 100%;
    }
    .admin-user-table-wrap {
      max-height: 520px;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--panel-2);
    }
    #fbsEmployeesSection .admin-user-table-wrap {
      /* Владелец 2026-09-14: список сотрудников (много строк и колонок) --
         520px общей высоты вынуждали листать слишком часто, здесь высота
         подстраивается под окно вместо фиксированного низкого потолка. */
      max-height: calc(100vh - 320px);
    }
    .admin-user-table {
      min-width: 760px;
    }
    /* Владелец 2026-09-20: в шапке списка сотрудников заголовок и кнопка фильтра
       прижаты к нижней границе ячейки, чтобы кнопки «Все» были на одном уровне
       независимо от числа строк в названии колонки. */
    #fbsEmployeesSection .admin-user-table thead th {
      vertical-align: bottom;
    }
    .admin-user-table tr {
      cursor: pointer;
    }
    .admin-google-section {
      display: grid;
      grid-template-columns: minmax(360px, .9fr) minmax(620px, 1.4fr);
      gap: 16px;
      align-items: start;
    }
    .admin-subtabs {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin: 0 0 14px;
    }
    .admin-subtabs button {
      padding: 9px 13px;
      border-radius: 12px;
    }
    .admin-google-view-hidden {
      display: none !important;
    }
    .service-access-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 8px;
      margin: 12px 0;
    }
    .service-access-item {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 10px 11px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--field-bg);
      font-weight: 800;
    }
    .service-access-item input {
      width: auto;
      min-height: auto;
    }
    .service-chip-list {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
    }
    .service-chip {
      display: inline-flex;
      align-items: center;
      padding: 4px 8px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--field-bg);
      color: var(--ink);
      font-size: 12px;
      font-weight: 850;
      white-space: nowrap;
    }
    .admin-google-section.hidden {
      display: none;
    }
    .admin-google-wide {
      grid-column: 1 / -1;
    }
    .admin-google-controls {
      display: grid;
      gap: 10px;
    }
    .admin-google-inline {
      display: grid;
      grid-template-columns: minmax(220px, 1fr) minmax(120px, 170px) auto;
      gap: 10px;
      align-items: center;
    }
    .admin-google-table-wrap {
      width: 100%;
      max-width: 100%;
      max-height: min(610px, calc(100vh - 320px));
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--panel-2);
      margin-top: 12px;
    }
    .admin-google-table {
      width: 100%;
      min-width: 0;
      table-layout: fixed;
    }
    #adminGoogleTablesPanel,
    #adminGoogleUsersPanel {
      grid-column: 1 / -1;
      min-width: 0;
    }
    #adminGoogleTablesPanel .admin-google-table-wrap,
    #adminGoogleUsersPanel .admin-google-table-wrap {
      max-height: min(610px, calc(100vh - 300px));
    }
    .admin-google-table tr {
      cursor: pointer;
    }
    .admin-google-table td,
    .admin-google-table th {
      vertical-align: top;
      overflow-wrap: anywhere;
      word-break: break-word;
    }
    #adminGoogleTablesPanel .admin-google-table th:first-child,
    #adminGoogleTablesPanel .admin-google-table td:first-child,
    #adminGoogleUsersPanel .admin-google-table th:first-child,
    #adminGoogleUsersPanel .admin-google-table td:first-child {
      width: 46px;
      text-align: center;
    }
    #adminServiceAccessSection .admin-google-table th:nth-child(1),
    #adminServiceAccessSection .admin-google-table td:nth-child(1) {
      width: 28%;
      min-width: 220px;
    }
    #adminServiceAccessSection .admin-google-table th:nth-child(2),
    #adminServiceAccessSection .admin-google-table td:nth-child(2) {
      width: 100px;
      text-align: center;
    }
    #adminServiceAccessSection .admin-google-table th:nth-child(3),
    #adminServiceAccessSection .admin-google-table td:nth-child(3) {
      width: 34%;
    }
    #adminServiceAccessSection .admin-google-table th:nth-child(4),
    #adminServiceAccessSection .admin-google-table td:nth-child(4) {
      width: 110px;
      text-align: center;
    }
    #adminServiceAccessSection .admin-google-table th:nth-child(5),
    #adminServiceAccessSection .admin-google-table td:nth-child(5) {
      width: 160px;
      text-align: center;
    }
    .admin-google-table a {
      overflow-wrap: anywhere;
    }
    .admin-google-check {
      width: auto;
      min-height: auto;
    }
    .admin-google-log {
      white-space: pre-wrap;
      min-height: 108px;
    }
    .admin-edit-grid {
      display: grid;
      grid-template-columns: auto minmax(120px, 180px) minmax(240px, 1fr);
      gap: 10px 12px;
      align-items: center;
    }
    .admin-edit-grid label {
      color: var(--muted);
      font-weight: 700;
    }
    .admin-edit-grid input[type="checkbox"] {
      width: auto;
      min-height: auto;
    }
    .admin-edit-modal-panel {
      width: min(920px, calc(100vw - 32px));
      max-height: min(86vh, 760px);
      overflow: auto;
    }
    .admin-disabled-message {
      margin-top: 12px;
    }
    .status a.report-link {
      color: var(--ink);
      display: inline-block;
      margin-top: 10px;
      padding: 8px 12px;
      border-radius: 12px;
      background: rgba(76, 124, 243, .22);
      border: 1px solid rgba(76, 124, 243, .5);
      text-decoration: none;
      font-family: Inter, "Segoe UI", Arial, sans-serif;
      font-weight: 800;
    }
    @media (max-width: 980px) {
      .admin-layout {
        grid-template-columns: 1fr;
      }
      .exclusion-layout {
        grid-template-columns: 1fr;
      }
      .exclusion-detail {
        position: static;
      }
    }
    body.mode-oper #sendSection,
    body.mode-oper #scheduleSection,
    body.mode-oper #feedbackSection,
    body.mode-oper #collisionSection,
    body.mode-oper #exclusionsSection,
    body.mode-oper #itemRulesSection,
    body.mode-oper #latestReportSection,
    body.mode-oper #stockOverviewSection,
    body.mode-oper #socksChzSection,
    body.mode-oper #socksPromoSection,
    body.mode-oper #socksStockSection,
    body.mode-oper #socksBundlesSection,
    body.mode-oper #socksOrderSection {
      display: none;
    }
    body.mode-oper main {
      width: min(1780px, calc(100% - 28px));
    }
    body.mode-stocks main {
      width: min(1760px, calc(100% - 28px));
    }
    body:not(.mode-stocks) #cabinetsAdminSection,
    body:not(.mode-stocks) #kizEmployeesAdminSection,
    body:not(.mode-fbs) #productCategoriesSection {
      display: none;
    }
    body.mode-stocks #sendSection,
    body.mode-stocks #collisionSection,
    body.mode-stocks #exclusionsSection,
    body.mode-stocks #itemRulesSection,
    body.mode-stocks #latestReportSection,
    body.mode-stocks #stockOverviewSection,
    body.mode-stocks #scheduleSection,
    body.mode-stocks #cabinetsAdminSection,
    body.mode-stocks #kizEmployeesAdminSection {
      display: none;
    }
    body.mode-stocks #sendSection.stocks-view-active,
    body.mode-stocks #collisionSection.stocks-view-active,
    body.mode-stocks #exclusionsSection.stocks-view-active,
    body.mode-stocks #itemRulesSection.stocks-view-active,
    body.mode-stocks #latestReportSection.stocks-view-active,
    body.mode-stocks #stockOverviewSection.stocks-view-active,
    body.mode-stocks #scheduleSection.stocks-view-active,
    body.mode-stocks #cabinetsAdminSection.stocks-view-active,
    body.mode-stocks #kizEmployeesAdminSection.stocks-view-active {
      display: block;
    }
    body.mode-stocks #identifiersSection,
    body.mode-stocks #feedbackSection,
    body.mode-stocks #socksChzSection,
    body.mode-stocks #socksPromoSection,
    body.mode-stocks #socksStockSection,
    body.mode-stocks #socksBundlesSection,
    body.mode-stocks #socksOrderSection {
      display: none;
    }
    body.mode-feedback #sendSection,
    body.mode-feedback #scheduleSection,
    body.mode-feedback #identifiersSection,
    body.mode-feedback #collisionSection,
    body.mode-feedback #exclusionsSection,
    body.mode-feedback #itemRulesSection,
    body.mode-feedback #latestReportSection,
    body.mode-feedback #stockOverviewSection,
    body.mode-feedback #socksChzSection,
    body.mode-feedback #socksPromoSection,
    body.mode-feedback #socksStockSection,
    body.mode-feedback #socksBundlesSection,
    body.mode-feedback #socksOrderSection {
      display: none;
    }
    body.mode-feedback main {
      width: min(100% - 20px, 1780px);
    }
    body.mode-socks main {
      width: min(1760px, calc(100% - 28px));
    }
    body.mode-socks #sendSection,
    body.mode-socks #scheduleSection,
    body.mode-socks #identifiersSection,
    body.mode-socks #collisionSection,
    body.mode-socks #exclusionsSection,
    body.mode-socks #itemRulesSection,
    body.mode-socks #latestReportSection,
    body.mode-socks #stockOverviewSection,
    body.mode-socks #feedbackSection {
      display: none;
    }
    body.mode-socks #socksChzSection,
    body.mode-socks #socksPromoSection,
    body.mode-socks #socksStockSection,
    body.mode-socks #socksBundlesSection,
    body.mode-socks #socksOrderSection {
      display: none;
    }
    body.mode-socks #socksChzSection.socks-view-active,
    body.mode-socks #socksPromoSection.socks-view-active,
    body.mode-socks #socksStockSection.socks-view-active,
    body.mode-socks #socksBundlesSection.socks-view-active,
    body.mode-socks #socksOrderSection.socks-view-active {
      display: block;
    }
    body:not(.mode-b2b) #b2bSiteSection,
    body:not(.mode-b2b) #b2bPricesSection,
    body:not(.mode-b2b) #b2bManualSection {
      display: none;
    }
    body:not(.mode-prices) #publicPricesSection {
      display: none;
    }
    body:not(.mode-test-table):not(.mode-orders) #testTableSection {
      display: none;
    }
    body:not(.mode-orders) #analyticsSection {
      display: none;
    }
    body:not(.mode-fbs) #fbsSelectionSection,
    body:not(.mode-fbs) #fbsOrdersSection,
    body:not(.mode-fbs) #fbsSuppliesSection,
    body:not(.mode-fbs) #productCategoriesSection,
    body:not(.mode-fbs) #fbsCancellationsSection,
    body:not(.mode-fbs) #fbsStatsSection,
    body:not(.mode-fbs) #fbsEmployeesSection,
    body:not(.mode-fbs) #fbsServerAdminSection,
    body:not(.mode-fbs) #algorithmSettingsSection {
      display: none;
    }
    body:not(.mode-logistic) #logisticsMpSection,
    body:not(.mode-logistic) #logisticsRetailSection,
    body:not(.mode-logistic) #logisticsDriversSection {
      display: none;
    }
    body.mode-logistic main {
      width: min(1560px, calc(100% - 28px));
    }
    body.mode-logistic #appShell > section {
      display: none;
    }
    body.mode-logistic #appShell > section.logistics-view-active {
      display: block;
    }
    .logistics-calculator-card {
      border: 1px solid var(--border);
      border-radius: 18px;
      padding: 22px;
      margin-bottom: 22px;
      background: color-mix(in srgb, var(--panel) 94%, transparent);
    }
    .logistics-summary-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(190px, 1fr));
      gap: 14px;
      margin-top: 14px;
    }
    .logistics-metric,
    .logistics-field {
      min-height: 82px;
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 13px 15px;
      background: var(--panel-2, rgba(127, 127, 127, .06));
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 7px;
    }
    .logistics-metric span,
    .logistics-field { font-weight: 600; }
    .logistics-metric strong { font-size: 1.45rem; }
    .fbs-staff-dashboard {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 14px;
      margin: 14px 0;
      font-family: inherit;
    }
    .fbs-staff-dashboard .logistics-metric {
      min-height: 108px;
      border-color: var(--line);
      border-style: solid;
      border-width: 1px;
    }
    .fbs-staff-dashboard .logistics-metric span { font-weight: 800; }
    .fbs-staff-dashboard .logistics-metric strong {
      font-weight: 900;
      font-size: 2rem;
      font-variant-numeric: tabular-nums;
      overflow-wrap: anywhere;
    }
    @media (max-width: 1100px) {
      .fbs-staff-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    @media (max-width: 700px) {
      .fbs-staff-dashboard { grid-template-columns: 1fr; }
    }
    .logistics-percent strong { color: var(--accent); }
    .logistics-field input,
    .logistics-field select { width: 100%; }
    .logistics-cargo-choice {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 18px;
      margin: 16px 0 4px;
      font-weight: 600;
    }
    .logistics-cargo-choice label { cursor: pointer; }
    .logistics-cargo-choice input { width: 18px; height: 18px; vertical-align: middle; }
    .logistics-supplies-head { margin-top: 18px; }
    .logistics-check-all { display: flex; align-items: center; gap: 8px; font-weight: 600; }
    .logistics-check-all input,
    .logistics-supplies-table input[type="checkbox"] { width: 19px; height: 19px; }
    .logistics-supplies-table .number-cell { text-align: right; white-space: nowrap; }
    .logistics-driver-layout {
      display: grid;
      grid-template-columns: minmax(300px, 420px) 1fr;
      gap: 20px;
      align-items: start;
    }
    .logistics-driver-form {
      display: grid;
      gap: 12px;
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 18px;
    }
    @media (max-width: 980px) {
      .logistics-summary-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
      .logistics-driver-layout { grid-template-columns: 1fr; }
    }
    @media (max-width: 560px) {
      .logistics-summary-grid { grid-template-columns: 1fr; }
      .logistics-calculator-card { padding: 14px; }
    }
    body.mode-fbs main {
      width: min(1780px, calc(100% - 28px));
    }
    body.mode-fbs #sendSection,
    body.mode-fbs #scheduleSection,
    body.mode-fbs #identifiersSection,
    body.mode-fbs #collisionSection,
    body.mode-fbs #exclusionsSection,
    body.mode-fbs #itemRulesSection,
    body.mode-fbs #latestReportSection,
    body.mode-fbs #stockOverviewSection,
    body.mode-fbs #feedbackSection,
    body.mode-fbs #socksChzSection,
    body.mode-fbs #socksPromoSection,
    body.mode-fbs #socksStockSection,
    body.mode-fbs #socksBundlesSection,
    body.mode-fbs #socksOrderSection,
    body.mode-fbs #fbsOrdersSection,
    body.mode-fbs #fbsSuppliesSection,
    body.mode-fbs #productCategoriesSection,
    body.mode-fbs #fbsCancellationsSection,
    body.mode-fbs #fbsStatsSection,
    body.mode-fbs #fbsEmployeesSection,
    body.mode-fbs #fbsServerAdminSection,
    body.mode-fbs #algorithmSettingsSection {
      display: none;
    }
    body.mode-fbs #fbsOrdersSection.fbs-view-active,
    body.mode-fbs #fbsSuppliesSection.fbs-view-active,
    body.mode-fbs #productCategoriesSection.fbs-view-active,
    body.mode-fbs #fbsCancellationsSection.fbs-view-active,
    body.mode-fbs #fbsStatsSection.fbs-view-active,
    body.mode-fbs #fbsEmployeesSection.fbs-view-active,
    body.mode-fbs #fbsServerAdminSection.fbs-view-active,
    body.mode-fbs #algorithmSettingsSection.fbs-view-active {
      display: block;
    }
    #productCategoriesStatus:empty { display: none; }
    .fbs-second-floor-toolbar input { min-width: min(560px, 70vw); }
    .fbs-second-floor-table th:nth-child(3),
    .fbs-second-floor-table td:nth-child(3),
    .fbs-second-floor-table th:nth-child(4),
    .fbs-second-floor-table td:nth-child(4),
    .fbs-second-floor-check-cell,
    .fbs-second-floor-indicator { text-align: center; }
    .fbs-second-floor-check-cell input { width: 20px; height: 20px; cursor: pointer; }
    .fbs-second-floor-pagination { justify-content: center; margin-top: 14px; }
    .fbs-stats-tabs {
      margin-bottom: 18px;
    }
    .fbs-stats-panel {
      display: none;
    }
    .fbs-stats-panel.active {
      display: block;
    }
    .fbs-employee-stats-period {
      align-items: center;
      flex-wrap: wrap;
    }
    .fbs-employee-stats-table th:not(:first-child),
    .fbs-employee-stats-table td:not(:first-child) {
      text-align: center;
    }
    .fbs-server-restart-control {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 6px;
    }
    .fbs-server-restart-control .mini {
      white-space: nowrap;
    }
    body:not(.mode-admin) #adminSection {
      display: none;
    }
    body.mode-b2b main {
      width: min(1780px, calc(100% - 28px));
    }
    body.mode-b2b #sendSection,
    body.mode-b2b #scheduleSection,
    body.mode-b2b #identifiersSection,
    body.mode-b2b #collisionSection,
    body.mode-b2b #exclusionsSection,
    body.mode-b2b #itemRulesSection,
    body.mode-b2b #latestReportSection,
    body.mode-b2b #stockOverviewSection,
    body.mode-b2b #feedbackSection,
    body.mode-b2b #socksChzSection,
    body.mode-b2b #socksPromoSection,
    body.mode-b2b #socksStockSection,
    body.mode-b2b #socksBundlesSection,
    body.mode-b2b #socksOrderSection,
    body.mode-b2b #b2bSiteSection,
    body.mode-b2b #b2bPricesSection,
    body.mode-b2b #b2bManualSection {
      display: none;
    }
    body.mode-b2b #b2bSiteSection.b2b-view-active,
    body.mode-b2b #b2bPricesSection.b2b-view-active,
    body.mode-b2b #b2bManualSection.b2b-view-active {
      display: block;
    }
    body.mode-prices main {
      width: min(1780px, calc(100% - 28px));
    }
    body.mode-prices #sendSection,
    body.mode-prices #scheduleSection,
    body.mode-prices #identifiersSection,
    body.mode-prices #collisionSection,
    body.mode-prices #exclusionsSection,
    body.mode-prices #itemRulesSection,
    body.mode-prices #latestReportSection,
    body.mode-prices #stockOverviewSection,
    body.mode-prices #feedbackSection,
    body.mode-prices #socksChzSection,
    body.mode-prices #socksPromoSection,
    body.mode-prices #socksStockSection,
    body.mode-prices #socksBundlesSection,
    body.mode-prices #socksOrderSection,
    body.mode-prices #b2bSiteSection,
    body.mode-prices #b2bPricesSection,
    body.mode-prices #b2bManualSection {
      display: none;
    }
    body.mode-prices #publicPricesSection {
      display: block;
    }
    body.mode-test-table main {
      width: min(1900px, calc(100% - 28px));
    }
    body.mode-test-table #sendSection,
    body.mode-test-table #scheduleSection,
    body.mode-test-table #identifiersSection,
    body.mode-test-table #collisionSection,
    body.mode-test-table #exclusionsSection,
    body.mode-test-table #itemRulesSection,
    body.mode-test-table #latestReportSection,
    body.mode-test-table #stockOverviewSection,
    body.mode-test-table #feedbackSection,
    body.mode-test-table #socksChzSection,
    body.mode-test-table #socksPromoSection,
    body.mode-test-table #socksStockSection,
    body.mode-test-table #socksBundlesSection,
    body.mode-test-table #socksOrderSection,
    body.mode-test-table #b2bSiteSection,
    body.mode-test-table #b2bPricesSection,
    body.mode-test-table #b2bManualSection,
    body.mode-test-table #publicPricesSection,
    body.mode-test-table #adminSection {
      display: none;
    }
    body.mode-test-table #testTableSection {
      display: block;
    }
    body.mode-orders main {
      width: min(1900px, calc(100% - 28px));
    }
    body.mode-orders #sendSection,
    body.mode-orders #scheduleSection,
    body.mode-orders #identifiersSection,
    body.mode-orders #collisionSection,
    body.mode-orders #exclusionsSection,
    body.mode-orders #itemRulesSection,
    body.mode-orders #latestReportSection,
    body.mode-orders #stockOverviewSection,
    body.mode-orders #feedbackSection,
    body.mode-orders #socksChzSection,
    body.mode-orders #socksPromoSection,
    body.mode-orders #socksStockSection,
    body.mode-orders #socksBundlesSection,
    body.mode-orders #socksOrderSection,
    body.mode-orders #b2bSiteSection,
    body.mode-orders #b2bPricesSection,
    body.mode-orders #b2bManualSection,
    body.mode-orders #publicPricesSection,
    body.mode-orders #adminSection {
      display: none;
    }
    body.mode-orders #testTableSection,
    body.mode-orders #analyticsSection {
      display: none;
    }
    body.mode-orders #testTableSection.orders-view-active,
    body.mode-orders #analyticsSection.orders-view-active {
      display: block;
    }
    body.mode-orders #testTableSectionHead,
    body.mode-orders #testTableOpenButton {
      display: none;
    }
    body.mode-admin main {
      width: min(1640px, calc(100% - 28px));
    }
    body.mode-admin #sendSection,
    body.mode-admin #scheduleSection,
    body.mode-admin #identifiersSection,
    body.mode-admin #collisionSection,
    body.mode-admin #exclusionsSection,
    body.mode-admin #itemRulesSection,
    body.mode-admin #latestReportSection,
    body.mode-admin #stockOverviewSection,
    body.mode-admin #feedbackSection,
    body.mode-admin #socksChzSection,
    body.mode-admin #socksPromoSection,
    body.mode-admin #socksStockSection,
    body.mode-admin #socksBundlesSection,
    body.mode-admin #socksOrderSection,
    body.mode-admin #b2bSiteSection,
    body.mode-admin #b2bPricesSection,
    body.mode-admin #b2bManualSection,
    body.mode-admin #publicPricesSection {
      display: none;
    }
    body.mode-admin #adminSection {
      display: block;
    }
    .feedback-tabs {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }
    .feedback-tabs button.active {
      background: #ffffff;
      color: #151515;
      border-color: #ffffff;
    }
    .feedback-table-wrap {
      overflow: auto;
      max-height: 72vh;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--soft-panel);
    }
    .feedback-table {
      min-width: 1880px;
      border-collapse: separate;
      border-spacing: 0;
    }
    .feedback-table th {
      position: sticky;
      top: 0;
      z-index: 2;
      background: var(--table-head-bg);
    }
    .feedback-table td,
    .feedback-table th {
      vertical-align: top;
    }
    .feedback-table .sticky-col {
      position: sticky;
      left: 0;
      z-index: 3;
      background: var(--table-head-bg);
    }
    .feedback-table td.sticky-col {
      background: var(--table-frozen-bg);
    }
    .feedback-comment {
      width: 240px;
      min-height: 76px;
      resize: vertical;
      font: inherit;
    }
    .feedback-text {
      min-width: 240px;
      max-width: 320px;
      white-space: pre-wrap;
      line-height: 1.35;
    }
    .rating-cell {
      text-align: center;
      font-weight: 800;
      min-width: 46px;
    }
    .rating-low { background: #ea9999; color: #151515; }
    .rating-mid { background: #ffe599; color: #151515; }
    .rating-high { background: #b7e1cd; color: #151515; }
    .summary > label {
      flex: 1 1 230px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: 16px;
      padding: 13px 14px;
      background: var(--soft-panel);
      color: var(--ink);
    }
    .time-summary {
      display: inline-flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 6px;
      min-width: 120px;
    }
    .time-summary-chip {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 4px 9px;
      border-radius: 999px;
      border: 1px solid var(--line);
      background: var(--field-bg);
      color: var(--ink);
      font-weight: 800;
      white-space: nowrap;
    }
    input, select, button {
      font: inherit;
      color: var(--ink);
      border-radius: 13px;
      border: 1px solid var(--line);
      padding: 10px 12px;
      background: var(--field-bg);
      outline: none;
    }
    input:focus, select:focus {
      border-color: rgba(76, 124, 243, .76);
      box-shadow: 0 0 0 3px rgba(76, 124, 243, .14);
    }
    input[type="checkbox"] {
      width: 18px;
      height: 18px;
      padding: 0;
      accent-color: var(--accent);
    }
    input[type="radio"] {
      width: 16px;
      height: 16px;
      padding: 0;
      border-radius: 50%;
      accent-color: var(--accent);
      vertical-align: middle;
    }
    input[type="time"] {
      color-scheme: var(--control-scheme);
    }
    select {
      color-scheme: var(--control-scheme);
      background: var(--field-bg);
      color: var(--ink);
    }
    select option,
    select optgroup {
      background: #fffaf4 !important;
      color: #2a1d17 !important;
    }
    button {
      cursor: pointer;
      border: none;
      color: white;
      font-weight: 750;
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      box-shadow: 0 14px 34px rgba(76, 124, 243, .24);
    }
    button.secondary {
      background: rgba(255, 255, 255, .1);
      color: var(--ink);
      border: 1px solid var(--line);
      box-shadow: none;
    }
    button.danger {
      border-color: rgba(228, 102, 126, .55);
      color: var(--danger);
    }
    a.button-like {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 44px;
      padding: 0 18px;
      border-radius: 12px;
      color: white;
      font-weight: 750;
      text-decoration: none;
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      box-shadow: 0 14px 34px rgba(76, 124, 243, .24);
    }
    a.button-like.secondary {
      background: rgba(255, 255, 255, .1);
      color: var(--ink);
      border: 1px solid var(--line);
      box-shadow: none;
    }
    a.button-like:hover {
      transform: translateY(-1px);
      border-color: rgba(255,255,255,.2);
    }
    button,
    a.button-like {
      transition: transform .14s ease, filter .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
    }
    button:not(:disabled):not([aria-disabled="true"]):hover,
    a.button-like:not([aria-disabled="true"]):hover {
      filter: brightness(1.08);
    }
    button:not(:disabled):not([aria-disabled="true"]):active,
    a.button-like:not([aria-disabled="true"]):active {
      transform: translateY(2px) scale(.97);
      filter: brightness(.88);
      box-shadow: inset 0 2px 5px rgba(0, 0, 0, .28);
      transition-duration: 0s;
    }
    button:focus-visible,
    a.button-like:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 3px;
    }
    @media (prefers-reduced-motion: reduce) {
      button, a.button-like { transition: none; }
      button:not(:disabled):not([aria-disabled="true"]):active,
      a.button-like:not([aria-disabled="true"]):active { transform: none; }
    }
    #fbsEmployeesSection .staff-row-actions {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
    }
    #fbsEmployeesSection .staff-row-actions button { margin: 0; }
    /* Владелец 2026-09-20: «Редактировать» -- маленький значок-карандаш рядом с ФИО вместо отдельной колонки. */
    #fbsEmployeesSection .fbs-edit-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      padding: 0;
      margin: 0;
      flex: none;
      border-radius: 8px;
      background: transparent;
      border-color: transparent;
      box-shadow: none;
      color: var(--muted);
      cursor: pointer;
    }
    /* значок-карандаш всегда слева от ФИО; фамилия и имя -- две строки */
    #fbsEmployeesSection .fbs-employee-cell {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    #fbsEmployeesSection .fbs-name-line {
      display: block;
    }
    #fbsEmployeesSection .fbs-edit-icon:hover,
    #fbsEmployeesSection .fbs-edit-icon:focus-visible {
      color: var(--ink);
      background: var(--field-bg);
      border-color: var(--line);
    }
    #fbsEmployeesSection th { background: #fff9f1; }
    button:disabled { opacity: .55; cursor: wait; }
    .hidden { display: none !important; }
    .mini {
      font-size: 13px;
      color: var(--muted);
    }
    .status {
      white-space: pre-wrap;
      font-family: Consolas, monospace;
      font-size: 13px;
      line-height: 1.45;
      background: var(--status-bg);
      color: var(--status-ink);
      border: 1px solid var(--line);
      padding: 14px;
      border-radius: 16px;
      min-height: 150px;
      max-height: 420px;
      overflow: auto;
    }
    .platform-block {
      margin-top: 18px;
      border-top: 1px solid var(--line);
      padding-top: 16px;
    }
    .cabinet-card {
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--panel-2);
      padding: 14px;
      margin-top: 12px;
    }
    .cabinet-head {
      display: flex;
      gap: 10px;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
    }
    .cabinet-time {
      display: flex;
      gap: 6px;
      align-items: center;
      color: var(--muted);
      font-size: 13px;
    }
    .day-grid {
      display: grid;
      grid-template-columns: repeat(7, minmax(112px, 1fr));
      gap: 8px;
      margin-top: 10px;
    }
    .day-cell {
      display: grid;
      gap: 5px;
      min-width: 0;
    }
    .day-cell span {
      font-size: 13px;
      color: var(--muted);
    }
    .day-cell input,
    .day-cell select {
      width: 100%;
    }
    @media (max-width: 760px) {
      main {
        width: min(100% - 18px, 1220px);
        padding-top: 10px;
      }
      header.hero {
        min-height: 230px;
      }
      .topbar {
        grid-template-columns: 1fr;
        justify-items: center;
        align-items: center;
      }
      .top-action {
        justify-content: center;
      }
      .theme-switcher {
        order: 3;
      }
      section {
        padding: 16px;
        border-radius: 16px;
      }
      .day-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .search-grid {
        grid-template-columns: 1fr;
      }
      .b2b-prices-grid,
      .b2b-website-common,
      .public-price-register-grid {
        grid-template-columns: 1fr;
      }
      .b2b-website-wide {
        grid-column: auto;
      }
      .day-cell:last-child {
        grid-column: 1 / -1;
      }
    }

/* --- test-table (Репрайсер/ALX_RNP order-table viewer), ported verbatim from stocks_hub_remote_control.py --- */
    .test-table-toolbar {
      display: grid;
      grid-template-columns: minmax(320px, 1fr) auto auto auto auto minmax(220px, auto);
      gap: 10px;
      align-items: center;
      margin: 14px 0;
    }
    .test-table-toolbar select {
      width: 100%;
      min-width: 0;
    }
    .test-table-shell {
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--soft-panel);
      overflow: hidden;
    }
    .test-table-meta {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      padding: 10px 12px;
      border-bottom: 1px solid var(--line);
      color: var(--muted);
      background: var(--panel-2);
    }
    .test-table-groups {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
      min-height: 38px;
      padding: 6px 10px;
      border-bottom: 1px solid var(--line);
      background: var(--table-head-bg);
    }
    .test-table-group-button {
      flex: 0 0 auto;
      min-width: 34px;
      min-height: 28px;
      padding: 4px 8px;
      border-radius: 6px;
      font-size: 12px;
      line-height: 1;
    }
    .test-table-group-button.is-collapsed {
      color: var(--accent);
      border-color: rgba(239, 68, 68, .55);
    }
    .test-table-freeze-control {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-left: auto;
      color: var(--muted);
      font-size: 12px;
      white-space: nowrap;
    }
    .test-table-freeze-control select {
      width: auto;
      min-width: 150px;
      height: 30px;
      padding: 4px 28px 4px 8px;
      border-radius: 6px;
      font-size: 12px;
    }
    .test-table-column-header {
      position: relative;
      height: 62px;
      overflow: hidden;
      border-bottom: 1px solid var(--line);
      background: var(--table-head-bg);
    }
    .test-table-column-header-track {
      position: absolute;
      inset: 0 auto 0 0;
      will-change: transform;
    }
    .test-table-corner {
      position: absolute;
      inset: 0 auto 0 0;
      z-index: 40;
      display: grid;
      place-items: center;
      width: 54px;
      color: var(--muted);
      background: var(--table-head-bg);
      border-right: 1px solid var(--line);
      font-size: 11px;
      font-weight: 900;
    }
    .test-table-month-band {
      position: absolute;
      top: 0;
      height: 24px;
      box-sizing: border-box;
      overflow: hidden;
      border-right: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
      background: color-mix(in srgb, var(--accent) 8%, var(--table-head-bg));
      color: var(--accent);
      font-size: 11px;
      font-weight: 900;
      white-space: nowrap;
    }
    .test-table-month-band button {
      width: 100%;
      height: 100%;
      padding: 0 6px;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
      color: inherit;
      font: inherit;
    }
    .test-table-month-band button:hover {
      transform: none;
      background: color-mix(in srgb, var(--accent) 13%, transparent);
      box-shadow: none;
    }
    .test-table-column-heading {
      position: absolute;
      top: 0;
      height: 62px;
      box-sizing: border-box;
      padding: 5px 7px;
      overflow: hidden;
      border-right: 1px solid var(--line);
      color: var(--muted);
      background: var(--table-head-bg);
      font-size: 11px;
      font-weight: 900;
      line-height: 1.2;
      text-align: center;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .test-table-column-heading.is-calendar,
    .test-table-column-heading.is-platform-grouped {
      top: 24px;
      height: 38px;
    }
    .test-table-platform-band {
      position: absolute;
      top: 0;
      height: 24px;
      box-sizing: border-box;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      border-right: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
      font-size: 11px;
      font-weight: 900;
      letter-spacing: 0.04em;
    }
    .test-table-platform-band.platform-wb {
      background: #7000ff;
      color: #ffffff;
    }
    .test-table-platform-band.platform-ozon {
      background: #005bff;
      color: #ffffff;
    }
    .test-table-column-heading.is-frozen,
    .test-table-month-band.is-frozen {
      z-index: 30;
      background: var(--table-frozen-bg);
    }
    .test-table-month-band.is-frozen {
      background: color-mix(in srgb, var(--accent) 8%, var(--table-frozen-bg));
    }
    .test-table-column-heading.is-last-frozen {
      box-shadow: 5px 0 8px rgba(0, 0, 0, .14);
    }
    .test-table-heading-main {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 3px;
      width: 100%;
      min-width: 0;
      height: 100%;
      padding: 0 4px;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
      color: inherit;
      font: inherit;
      line-height: inherit;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .test-table-heading-main:hover {
      transform: none;
      background: var(--hover-panel);
      box-shadow: none;
    }
    .test-table-heading-main.is-month-toggle {
      color: var(--accent);
      cursor: pointer;
    }
    .test-table-heading-main.is-custom-group-toggle {
      color: var(--ink);
      background: color-mix(in srgb, var(--accent) 10%, transparent);
      cursor: pointer;
    }
    .test-table-heading-state {
      flex: 0 0 auto;
      color: var(--accent);
      font-size: 10px;
    }
    .test-table-heading-main.has-total {
      height: 100%;
    }
    .test-table-heading-label-block {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      min-width: 0;
      overflow: hidden;
    }
    .test-table-heading-label-block > span:first-child {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 100%;
    }
    .test-table-heading-total {
      font-size: 12px;
      font-weight: 900;
      color: var(--accent);
    }
    .test-table-resize-handle {
      position: absolute;
      z-index: 4;
      top: 0;
      right: -2px;
      width: 6px;
      height: 100%;
      cursor: col-resize;
      touch-action: none;
    }
    .test-table-resize-handle:hover,
    .test-table-resize-handle.is-resizing {
      background: color-mix(in srgb, var(--accent) 55%, transparent);
    }
    .test-table-column-menu {
      position: fixed;
      z-index: 1200;
      width: min(320px, calc(100vw - 24px));
      max-height: calc(100vh - 24px);
      overflow-y: auto;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel-2);
      box-shadow: 0 18px 48px rgba(0, 0, 0, .32);
    }
    .test-table-column-menu h4 {
      margin: 0 0 10px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .test-table-column-menu-actions,
    .test-table-column-menu-footer {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .test-table-custom-group-list {
      display: grid;
      gap: 6px;
      margin: 10px 0;
    }
    .test-table-custom-group-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto auto;
      gap: 6px;
      align-items: center;
    }
    .test-table-column-menu-filter {
      display: grid;
      gap: 8px;
      margin: 10px 0;
      padding-top: 10px;
      border-top: 1px solid var(--line);
    }
    .test-table-column-menu select,
    .test-table-column-menu input {
      width: 100%;
      min-width: 0;
    }
    .test-table-viewport {
      position: relative;
      height: min(72vh, 760px);
      min-height: 440px;
      overflow: auto;
      overscroll-behavior: contain;
      background: var(--table-cell-bg);
      font-size: 13px;
      line-height: 1.25;
    }
    .test-table-spacer {
      position: relative;
      min-width: 100%;
      min-height: 100%;
    }
    .test-table-canvas {
      position: absolute;
      inset: 0 auto auto 0;
      pointer-events: none;
    }
    .test-table-cell {
      position: absolute;
      box-sizing: border-box;
      height: 28px;
      padding: 5px 7px;
      border-right: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      background: var(--table-cell-bg);
      color: var(--ink);
      pointer-events: auto;
    }
    .test-table-cell:hover {
      z-index: 8;
      background: var(--hover-panel);
      box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .28);
    }
    .test-table-row-number {
      position: absolute;
      z-index: 40;
      width: 54px;
      text-align: right;
      color: var(--muted);
      background: var(--table-head-bg);
      font-variant-numeric: tabular-nums;
      font-weight: 800;
    }
    .test-table-cell.is-frozen {
      z-index: 20;
      background: var(--table-frozen-bg);
    }
    .test-table-cell.is-last-frozen {
      box-shadow: 5px 0 8px rgba(0, 0, 0, .14);
    }
    .test-table-header-cell {
      font-weight: 900;
      background: var(--table-head-bg);
      color: var(--muted);
    }
    .test-table-row-header .test-table-cell:not(.test-table-row-number) {
      background: var(--table-head-bg);
      color: var(--muted);
      font-weight: 800;
    }
    .test-table-cell.test-table-row-product {
      background: var(--table-cell-bg);
    }
    .test-table-cell.test-table-row-product.test-table-heat-month {
      background: rgba(220, 38, 38, var(--heat-alpha));
    }
    .test-table-cell.test-table-row-product.test-table-heat-day {
      background: rgba(22, 163, 74, var(--heat-alpha));
    }
    .test-table-cell.test-table-row-product.test-table-heat-month:hover,
    .test-table-cell.test-table-row-product.test-table-heat-day:hover {
      z-index: 8;
      box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
      filter: saturate(1.12) brightness(1.04);
    }
    .test-table-cell.test-table-row-product.is-frozen {
      z-index: 20;
      background: var(--table-frozen-bg);
    }
    .test-table-cell.test-table-row-product.is-frozen.test-table-heat-month {
      background:
        linear-gradient(rgba(220, 38, 38, var(--heat-alpha)), rgba(220, 38, 38, var(--heat-alpha))),
        var(--table-frozen-bg);
    }
    .test-table-cell.test-table-row-product.is-frozen.test-table-heat-day {
      background:
        linear-gradient(rgba(22, 163, 74, var(--heat-alpha)), rgba(22, 163, 74, var(--heat-alpha))),
        var(--table-frozen-bg);
    }
    .test-table-cell.test-table-row-product.is-frozen:hover {
      z-index: 21;
      background: var(--table-frozen-hover);
    }
    .test-table-cell.test-table-row-number {
      z-index: 40;
      background: var(--table-head-bg);
    }
    .test-table-row-empty .test-table-cell:not(.test-table-row-number) {
      color: transparent;
    }
    .test-table-loading {
      padding: 16px;
      color: var(--muted);
    }

/* --- EA price-compare table cells (photo / cabinet price+id) --- */
.test-table-cell-photo {
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.test-table-photo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}
.test-table-cell-cabinet {
  white-space: normal;
  line-height: 1.25;
  padding: 4px 8px;
}
.test-table-cabinet-price {
  font-weight: 600;
}
.test-table-cabinet-id {
  color: var(--muted);
  font-size: 11px;
}
.test-table-cell-cabinet.is-min-price {
  background: #fff59d;
  color: #2a1d17;
}
.test-table-cell-cabinet.is-min-price .test-table-cabinet-id {
  color: #6d5f55;
}
.test-table-search-row {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.test-table-refresh-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
}
.test-table-refresh-modal.hidden {
  display: none;
}
.test-table-refresh-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(8px);
}
.test-table-refresh-modal-panel {
  position: relative;
  width: min(480px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  box-shadow: 0 24px 80px var(--shadow);
  padding: 20px;
}
.test-table-refresh-modal-panel h3 {
  margin: 0 0 8px;
  font-size: 20px;
}
.test-table-refresh-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.test-table-refresh-modal-range {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
#testTableOrdersRefreshStatus {
  margin-top: 12px;
  min-height: 16px;
}
.test-table-export-cabinets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.test-table-export-cabinet {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
}
.test-table-date-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.test-table-date-control input[type="date"] {
  height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field-bg);
  color: var(--ink);
  font-size: 12px;
}
.test-table-cell.is-total-row {
  font-weight: 800;
  background: var(--table-frozen-bg);
}
.test-table-cell.is-total-row.test-table-heat-month,
.test-table-cell.is-total-row.test-table-heat-day {
  background: var(--table-frozen-bg);
}
.test-table-row-toggle {
  cursor: pointer;
  text-align: center !important;
  font-size: 16px;
  user-select: none;
}
.test-table-row-toggle:hover {
  background: var(--hover-panel);
}
.test-table-search-row input {
  width: 100%;
  max-width: 560px;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--ink);
  font-size: 13px;
}
.test-table-column-heading.platform-wb {
  background: #7000ff;
  color: #ffffff;
}
.test-table-column-heading.platform-ozon {
  background: #005bff;
  color: #ffffff;
}
.test-table-column-heading.platform-wb .test-table-resize-handle,
.test-table-column-heading.platform-ozon .test-table-resize-handle {
  background: rgba(255, 255, 255, 0.35);
}

/* -------------------------------------------------------------------- */
/* orders.mannupserv.ru -- "Аналитика" tab                              */
/* -------------------------------------------------------------------- */
.analytics-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.analytics-button-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.analytics-toggle-btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1;
}
.analytics-custom-range {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.analytics-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  font-size: 11px;
  font-weight: 800;
}
.analytics-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
}
.analytics-summary-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.analytics-summary-tile strong {
  font-size: 22px;
  color: var(--ink);
}
.analytics-summary-tile.is-prior strong {
  color: var(--muted);
}
.analytics-summary-delta.is-up strong { color: var(--green); }
.analytics-summary-delta.is-down strong { color: var(--accent); }
.analytics-chart-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  padding: 14px 14px 6px;
  margin-bottom: 18px;
}
.analytics-chart-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 6px;
  padding-left: 4px;
}
.analytics-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.analytics-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: 0 0 auto;
}
.analytics-legend-swatch.is-current {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.analytics-legend-swatch.is-prior {
  background: color-mix(in srgb, var(--accent) 42%, var(--soft) 30%);
}
.analytics-chart-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}
.analytics-chart-svg {
  display: block;
}
.analytics-bar.is-current {
  fill: var(--accent);
}
.analytics-bar.is-prior {
  fill: color-mix(in srgb, var(--accent) 42%, var(--soft) 30%);
}
.analytics-hit {
  cursor: crosshair;
}
.analytics-line.is-current {
  stroke: var(--accent);
  stroke-width: 2.2;
}
.analytics-line.is-prior {
  stroke: color-mix(in srgb, var(--accent) 42%, var(--soft) 30%);
  stroke-width: 2;
  stroke-dasharray: 4 3;
}
.analytics-marker.is-current {
  fill: var(--accent);
}
.analytics-marker.is-prior {
  fill: color-mix(in srgb, var(--accent) 42%, var(--soft) 30%);
}
.analytics-grid-line {
  stroke: var(--line);
  stroke-width: 1;
}
.analytics-axis-label {
  fill: var(--muted);
  font-size: 11px;
}
.analytics-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--menu-bg);
  box-shadow: 0 14px 34px var(--shadow);
  pointer-events: none;
  font-size: 12px;
}
.analytics-tooltip-title {
  font-weight: 750;
  margin-bottom: 4px;
  color: var(--ink);
}
.analytics-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.analytics-tooltip-row strong {
  color: var(--ink);
  margin-left: auto;
}
.analytics-products-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  padding: 14px 16px 16px;
}
.analytics-products-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.analytics-products-head h3 {
  margin: 0;
  font-size: 16px;
}
.analytics-products-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 520px;
  overflow-y: auto;
}
.analytics-product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(90px, 240px);
  align-items: center;
  gap: 12px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
}
.analytics-product-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink);
}
.analytics-product-qty {
  text-align: right;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}
.analytics-product-bar-track {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--soft-panel);
  overflow: hidden;
}
.analytics-product-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

body:not(.mode-buh-oper) #buhMpSection {
  display: none;
}
body.mode-buh-oper main {
  width: min(1560px, calc(100% - 28px));
}
body.mode-buh-oper #appShell > section {
  display: none !important;
}
body.mode-buh-oper #appShell > #buhMpSection {
  display: block !important;
}
.buh-mp-upload-card {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}
.buh-mp-upload-card .mini {
  grid-column: 1 / -1;
  margin: 0;
  white-space: pre-wrap;
}
.buh-mp-file-label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}
.buh-mp-file-label input {
  width: 100%;
}
.buh-mp-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.buh-mp-metric {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}
.buh-mp-metric span { color: var(--muted); font-size: 13px; font-weight: 650; }
.buh-mp-metric strong { color: var(--ink); font-size: 1.35rem; }
.buh-mp-result-head { margin-top: 8px; }
.buh-mp-result-head h3,
.buh-mp-unmatched h3 { margin: 0 0 5px; }
.buh-mp-table .number-cell { text-align: right; white-space: nowrap; }
.buh-mp-unmatched { margin-top: 22px; }
@media (max-width: 800px) {
  .buh-mp-upload-card { grid-template-columns: 1fr; }
  .buh-mp-summary-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}

#ozonOneCSection { display:none; }
body.mode-fbs #ozonOneCSection.fbs-view-active { display:block; }
.ozon-one-c-warehouse { margin:24px 0; padding:20px; border:1px solid var(--border, #ccd2dc); border-radius:12px; }
.ozon-one-c-batch { margin-top:16px; padding-top:16px; border-top:1px solid var(--border, #ccd2dc); }
.ozon-one-c-table { max-height:380px; overflow:auto; margin-top:12px; }
.ozon-one-c-table th { position:sticky; top:0; background:var(--panel, white); }
.ozon-one-c-warning { color:#b45309; margin:10px 0; }
.ozon-one-c-marks { width:100%; min-height:160px; font-family:Consolas,monospace; }

.ozon-one-c-warehouse > h3 { font-size:30px; line-height:1.25; }
.ozon-one-c-cabinet { margin-top:28px; }
.ozon-one-c-cabinet + .ozon-one-c-cabinet { margin-top:36px; padding-top:28px; border-top:2px solid var(--line); }
.ozon-one-c-cabinet > h4 { margin:0 0 16px; padding:14px 18px; font-size:clamp(23px, 2vw, 28px); font-weight:800; line-height:1.3; color:var(--ink); background:var(--soft-panel); border-left:5px solid var(--accent); border-radius:8px; overflow-wrap:anywhere; }
#fbsEmployeesSection input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
#fbsEmployeesSection input[type="number"]::-webkit-inner-spin-button,
#fbsEmployeesSection input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.table-column-tools { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.table-column-tools button { padding: 5px 8px; font-size: 12px; white-space: nowrap; }
.table-column-tools button:first-child { background: transparent; border-color: transparent; box-shadow: none; white-space: normal; font: inherit; padding: 0; color: inherit; }
.table-tools-toolbar { display: flex; gap: 12px; align-items: center; margin: 10px 0; }
.table-tools-toolbar span { font-size: 13px; color: var(--muted); }
.table-tools-options { display: grid; gap: 8px; max-height: 45vh; overflow: auto; margin: 14px 0; }
.table-tools-options label { display: flex; gap: 8px; align-items: center; }
@media print { .table-column-tools, .table-tools-toolbar { display: none !important; } }
button.fbs-oldest-order { flex: 1; margin: 0 20px; padding: 3px 12px; background: transparent; border-color: transparent; box-shadow: none; color: var(--ink); font-size: 20px; line-height: 1.3; text-align: center; }
button.fbs-oldest-order .mini { font-size: 14px; margin-top: 3px; }
.fbs-waiting-orders-panel { width: min(1200px, 95vw); max-width: 1200px; }
.fbs-waiting-orders-scroll { max-height: 65vh; overflow: auto; }
.fbs-waiting-orders-scroll table { width: 100%; min-width: 0; table-layout: fixed; }
.fbs-waiting-orders-scroll th:first-child { width: 24%; }
.fbs-waiting-orders-scroll th:last-child { width: 24%; }
.fbs-waiting-orders-scroll th, .fbs-waiting-orders-scroll td { overflow-wrap: anywhere; }
.fbs-waiting-orders-scroll td { vertical-align: top; }
@media(max-width: 700px) { button.fbs-oldest-order { flex-basis: 100%; margin: 8px 0; font-size: 18px; } }

/* One employee row with aligned warehouse intervals. */
#staffShiftsBody .staff-shift-line{min-height:30px;line-height:30px;white-space:nowrap;}
#staffShiftsBody td{vertical-align:middle;}
#staffShiftsBody .staff-shift-person{text-align:center;min-width:220px;}
#staffShiftsBody .staff-shift-total{text-align:center;font-size:1.5em;font-weight:700;min-width:160px;}

.fbs-waiting-orders-scroll .fbs-stage-meta { white-space: normal; }


/* ===== FF glass theme layer (sidebar layout, glass cards) ===== */
main {
  width: min(1380px, calc(100% - 28px));
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  padding: 14px 0 40px;
}
main > * { grid-column: 2; min-width: 0; }
header.hero {
  grid-column: 1;
  grid-row: 1 / span 400;
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  padding: 14px 10px;
  border-radius: 20px;
  color: #fff;
  background: var(--side-grad);
  box-shadow: 0 12px 34px rgba(84, 110, 240, .35);
  overflow-y: auto;
  overflow-x: hidden;
}
header.hero .topbar { display: contents; }
header.hero .brand { order: 0; padding: 2px 6px 14px; color: #fff; font-size: 15px; }
header.hero .brand-mark { background: #fff; color: var(--accent); box-shadow: none; border-radius: 10px; width: 30px; height: 30px; }
header.hero .theme-switcher { display: none; }
header.hero .hero-actions { order: 1; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 3px; justify-content: flex-start; }
header.hero .top-action { order: 2; margin-top: auto; justify-content: stretch; padding-top: 10px; }
header.hero .top-action > * { width: 100%; }
header.hero .hero-actions button,
header.hero .hero-actions a {
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  padding: 9px 12px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .94);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: none;
}
header.hero .hero-actions button:hover { background: rgba(255, 255, 255, .16); transform: none; }
header.hero .hero-actions button.active,
header.hero .hero-actions .stocks-nav-button.active {
  background: #fff;
  color: #3b5bd9;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
header.hero .top-exit-button,
header.hero .top-action button {
  width: 100%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: none;
}
.page-banner {
  grid-row: 1;
  margin-bottom: 14px;
  padding: 20px 24px;
  border-radius: 20px;
  color: #fff;
  background: var(--hero-grad);
  box-shadow: 0 12px 30px rgba(90, 120, 240, .3);
  position: relative;
  overflow: hidden;
}
.page-banner h1 { margin: 0 0 4px; max-width: none; font-size: 24px; line-height: 1.15; }
.page-banner p { margin: 0; max-width: none; color: rgba(255, 255, 255, .92); font-size: 13px; }
.page-banner::after {
  content: "";
  position: absolute;
  right: -30px; top: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .35), transparent 70%);
}
section {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(12px);
}
input, select, textarea {
  border-radius: 10px;
  border-color: var(--line);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 124, 243, .18);
}
button:not(.secondary):not(.danger) { box-shadow: 0 8px 20px rgba(76, 124, 243, .26); }
@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  main > * { grid-column: 1; }
  header.hero { grid-column: 1; grid-row: auto; position: static; height: auto; }
  header.hero .hero-actions { flex-direction: row; flex-wrap: wrap; }
  header.hero .hero-actions button { width: auto; }
  header.hero .top-action { margin-top: 6px; }
}
