* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f4f6;
    color: #111827;
}

header {
    background: #111827;
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
}

header p {
    margin: 4px 0 0;
    opacity: 0.8;
}

header a {
    color: white;
}

main {
    padding: 24px;
    max-width: 1300px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.row {
    display: flex;
    gap: 10px;
}

label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 14px;
    color: #374151;
}

input, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
}

button {
    margin-top: 14px;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: white;
    font-size: 15px;
    cursor: pointer;
}

button:hover {
    background: #1d4ed8;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
}

th, td {
    border-bottom: 1px solid #e5e7eb;
    padding: 9px;
    text-align: left;
    font-size: 14px;
}

.bad {
    color: #b91c1c;
    font-weight: bold;
}

.good {
    color: #047857;
    font-weight: bold;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-card {
    width: 360px;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.login-card h1 {
    margin-top: 0;
}

.login-error {
    margin: 12px 0 16px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 14px;
    font-weight: 600;
}

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

    main {
        padding: 12px;
    }
}

.selected-product-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
    font-size: 14px;
}

.selected-product-box div {
    margin-top: 4px;
    color: #111827;
}

.inventory-today-status {
    margin-top: 8px;
    min-height: 20px;
    font-size: 13px;
    line-height: 1.35;
}

.inventory-today-status-ok {
    color: #047857;
    font-weight: 600;
}

.inventory-today-status-warning {
    color: #b45309;
    font-weight: 600;
}

.inventory-today-status-blocked {
    color: #991b1b;
    font-weight: 600;
}

.stock-ok {
    color: #047857;
    font-weight: bold;
}

.stock-low {
    color: #b91c1c;
    font-weight: bold;
}

.small-btn {
    margin-top: 0;
    padding: 6px 10px;
    font-size: 13px;
}

.stock-ok {
    color: #047857;
    font-weight: bold;
}

.stock-low {
    color: #b91c1c;
    font-weight: bold;
}

.small-btn {
    margin-top: 0;
    padding: 6px 10px;
    font-size: 13px;
}

.danger-btn {
    background: #b91c1c;
}

.danger-btn:hover {
    background: #991b1b;
}

.danger-btn {
    background: #b91c1c;
}

.danger-btn:hover {
    background: #991b1b;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.action-buttons .small-btn {
    margin-top: 0;
    white-space: nowrap;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: grid;
    place-items: center;
    z-index: 9999;
    padding: 16px;
}

.modal.hidden {
    display: none;
}

.modal-card {
    width: 100%;
    max-width: 520px;
    background: white;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-card h2 {
    margin-top: 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.secondary-btn {
    background: #6b7280;
}

.secondary-btn:hover {
    background: #4b5563;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.action-buttons .small-btn {
    margin-top: 0;
    white-space: nowrap;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: grid;
    place-items: center;
    z-index: 9999;
    padding: 16px;
}

.modal.hidden {
    display: none;
}

.modal-card {
    width: 100%;
    max-width: 520px;
    background: white;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-card h2 {
    margin-top: 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.secondary-btn {
    background: #6b7280;
}

.secondary-btn:hover {
    background: #4b5563;
}

.product-select {
    min-height: 42px;
    background: #fff;
}

.product-select option {
    font-size: 14px;
}

.product-select {
    min-height: 58px;
    line-height: 1.25;
    white-space: normal;
}

.selected-product-info {
    margin-top: 8px;
    padding: 10px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    font-size: 13px;
    line-height: 1.35;
    color: #111827;
}

.selected-product-info b {
    display: block;
    margin-bottom: 4px;
}

.product-select {
    min-height: 58px;
    line-height: 1.25;
    white-space: normal;
}

.selected-product-info {
    margin-top: 8px;
    padding: 10px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    font-size: 13px;
    line-height: 1.35;
    color: #111827;
}

.selected-product-info b {
    display: block;
    margin-bottom: 4px;
}

.scanner-card {
    border: 2px solid #dbeafe;
}

.scanner-grid {
    margin-bottom: 10px;
}

.scanner-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    font-family: Arial, sans-serif;
    resize: vertical;
}

.top-nav {
    background: white;
    padding: 14px 24px;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.top-nav label {
    margin-top: 0;
}

.top-nav select {
    max-width: 420px;
}

.nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.page-section.hidden-page {
    display: none;
}

.page-section {
    display: block;
}

.search-card {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
}

.search-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.search-card h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.search-card p {
    margin: 5px 0;
}

.search-card h4 {
    margin-top: 18px;
    margin-bottom: 8px;
}

@media (max-width: 900px) {
    .search-card-header {
        flex-direction: column;
    }
}


.stock-final {
    font-weight: 700;
}

.link-button {
    display: inline-block;
    background: #2563eb;
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.link-button:hover {
    background: #1d4ed8;
}

button.link-button {
    border: none;
    cursor: pointer;
}


.labels-note {
    margin-top: 10px;
    font-size: 13px;
    color: #4b5563;
}

.labels-preview {
    margin-top: 18px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.label-sheet {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.qr-label-mini {
    width: 10mm;
    height: 20mm;
    background: #fff;
    border: 1px dashed #d1d5db;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
}

.qr-top {
    width: 10mm;
    height: 10mm;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
}

.qr-top img {
    width: 9.2mm;
    height: 9.2mm;
    object-fit: contain;
    display: block;
    margin-top: 0;
}

.qr-sku {
    width: 10mm;
    min-height: 8mm;
    margin-top: 0.5mm;
    font-size: 6px;
    line-height: 1.05;
    text-align: center;
    word-break: break-all;
    overflow: hidden;
}



/* QR labels 30x20mm */
.labels-note {
    margin-top: 10px;
    font-size: 13px;
    color: #4b5563;
}

.labels-preview {
    margin-top: 18px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.label-sheet-30x20 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.qr-label-30x20 {
    width: 30mm;
    height: 20mm;
    background: #fff;
    border: 1px dashed #d1d5db;
    box-sizing: border-box;
    overflow: hidden;
    padding: 1mm 1mm 0.5mm 1mm;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.qr-label-code {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.qr-label-code img {
    width: 100% !important;
    height: 100% !important;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain;
}

.qr-label-sku {
    margin-top: 0.5mm;
    max-width: 16mm;
    font-size: 2.2mm;
    line-height: 1;
    color: #000;
    word-break: break-all;
    overflow: hidden;
    text-align: left;
}



.home-summary-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.home-summary-header h2 {
    margin-bottom: 4px;
}

.home-summary-header p {
    margin-top: 0;
}

.stock-warning {
    color: #b45309;
    font-weight: 700;
}



/* Дополнительные колонки инвентаризации в Остатки сейчас */
.inventory-stock-extra-col {
    text-align: center;
    white-space: nowrap;
}

.history-empty {
    color: #9ca3af;
}



/* Кликабельная актуальность инвентаризации */
.clickable-inventory-summary .clickable-row {
    cursor: pointer;
}

.clickable-inventory-summary .clickable-row:hover td {
    background: #eef4ff;
}

.inventory-session-details {
    margin-top: 14px;
}

.inventory-session-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.inventory-session-title h3 {
    margin: 0 0 8px 0;
}

.inventory-session-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 6px 18px;
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .inventory-session-meta {
        grid-template-columns: 1fr;
    }
}



/* FINAL clickable inventory summary */
.clickable-inventory-summary .clickable-row {
    cursor: pointer;
}

.clickable-inventory-summary .clickable-row:hover td {
    background: #eef4ff !important;
}

.inventory-session-details {
    margin-top: 14px;
}

.inventory-session-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.inventory-session-title h3 {
    margin: 0 0 8px 0;
}

.inventory-session-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 6px 18px;
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .inventory-session-meta {
        grid-template-columns: 1fr;
    }
}



/* Clickable inventory summary final */
.clickable-inventory-summary .clickable-row {
    cursor: pointer;
}

.clickable-inventory-summary .clickable-row:hover td {
    background: #eef4ff !important;
}

.not-clickable-row {
    cursor: default;
}



/* Выравнивание фильтра и кнопок в блоке Сверка с 1С */
[data-page="onec"] .row {
    align-items: center;
}

[data-page="onec"] .row input,
[data-page="onec"] .row button {
    height: 42px;
}

[data-page="onec"] .row button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    margin-top: 0;
}

[data-page="onec"] .row input {
    display: inline-flex;
    align-items: center;
}



/* ===== OneC compact header ===== */
.onec-header-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.onec-top-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  background: #f8fafc;
}

.onec-status-host {
  display: contents;
}

.onec-item {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 1.45;
}

.onec-label {
  font-weight: 700;
  color: #1f2f46;
}

.onec-value {
  color: #233247;
}

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

.onec-mini-card {
  padding: 12px 14px;
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  background: #ffffff;
  line-height: 1.5;
}

.onec-mini-card strong,
.onec-mini-card b {
  color: #1f2f46;
}

.onec-filter-row-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.onec-filter-row-compact input {
  flex: 1 1 460px;
  min-width: 280px;
}

.onec-filter-row-compact button {
  align-self: center;
}

@media (max-width: 900px) {
  .onec-top-line {
    padding: 10px 12px;
  }

  .onec-item {
    width: 100%;
  }
}



/* ===== HARD FIX ONEC COMPACT VISUAL ===== */

#onecCompactTop {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
}

#onecJobStatus {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.onec-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
}

#onecCompactMeta {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.onec-compact-card {
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    line-height: 1.4 !important;
    font-size: 14px !important;
}

.onec-compact-filter-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 0 !important;
    margin-bottom: 14px !important;
}

.onec-compact-filter-row input {
    flex: 1 1 auto !important;
    height: 42px !important;
}

.onec-compact-filter-row button {
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

@media (max-width: 900px) {
    #onecCompactMeta {
        grid-template-columns: 1fr;
    }

    .onec-pill {
        width: 100%;
        justify-content: flex-start;
    }

    .onec-compact-filter-row {
        flex-direction: column;
        align-items: stretch !important;
    }

    .onec-compact-filter-row input,
    .onec-compact-filter-row button {
        width: 100% !important;
    }
}



/* ===== OneC visual separation v2 ===== */

#onecCompactTop {
    display: block !important;
    width: 100% !important;
    margin-bottom: 12px !important;
    padding: 14px 16px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #f8fafc !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

#onecJobStatus {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(220px, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
}

.onec-pill {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 34px !important;
    padding: 8px 11px !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
}

#onecCompactMeta {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
    width: 100% !important;
}

.onec-compact-card {
    width: 100% !important;
    margin: 0 !important;
    padding: 14px 16px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    line-height: 1.45 !important;
    font-size: 14px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

#onecXlsxStatus {
    width: 100% !important;
}

.onec-compact-card b,
.onec-compact-card strong {
    display: inline-block;
    margin-bottom: 4px;
}

.onec-compact-filter-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 4px !important;
    margin-bottom: 16px !important;
    padding: 12px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.onec-compact-filter-row input {
    flex: 1 1 auto !important;
    height: 42px !important;
}

.onec-compact-filter-row button {
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

@media (max-width: 1100px) {
    #onecJobStatus {
        grid-template-columns: repeat(2, minmax(220px, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    #onecJobStatus {
        grid-template-columns: 1fr !important;
    }

    .onec-compact-filter-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .onec-compact-filter-row input,
    .onec-compact-filter-row button {
        width: 100% !important;
    }
}



/* ===== OneC top block polish v4 ===== */

#onecCompactTop {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
    margin: 0 0 14px 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

#onecJobStatus {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(240px, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
}

#onecJobStatus .onec-pill {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    min-height: 92px !important;
    padding: 14px 16px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    text-align: left !important;
}

#onecJobStatus .onec-pill-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.3 !important;
}

#onecJobStatus .onec-pill-value {
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #1f2937 !important;
    line-height: 1.35 !important;
    word-break: break-word !important;
}

#onecCompactMeta {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 0 14px 0 !important;
}

#onecCompactMeta .onec-compact-card,
#onecXlsxStatus,
#onecHowItWorks {
    width: 100% !important;
    margin: 0 !important;
    padding: 14px 16px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
    line-height: 1.5 !important;
    font-size: 14px !important;
    text-align: left !important;
}

#onecCompactMeta .onec-compact-card b,
#onecCompactMeta .onec-compact-card strong,
#onecXlsxStatus b,
#onecXlsxStatus strong,
#onecHowItWorks b,
#onecHowItWorks strong {
    display: inline-block !important;
    margin-bottom: 6px !important;
}

.onec-compact-filter-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 0 14px 0 !important;
    padding: 12px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

.onec-compact-filter-row input {
    flex: 1 1 auto !important;
    height: 42px !important;
    margin: 0 !important;
}

.onec-compact-filter-row button {
    height: 42px !important;
    padding: 0 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    margin: 0 !important;
}

@media (max-width: 1200px) {
    #onecJobStatus {
        grid-template-columns: repeat(2, minmax(240px, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    #onecJobStatus {
        grid-template-columns: 1fr !important;
    }

    .onec-compact-filter-row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .onec-compact-filter-row input,
    .onec-compact-filter-row button {
        width: 100% !important;
    }
}



/* ===== ONEC TOP FINAL HARD VISUAL OVERRIDE ===== */

/* Общий верхний блок 1С */
#onecCompactTop,
#onecJobStatus {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Убираем старый вид "простынёй" */
#onecCompactTop {
    margin: 0 0 14px 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Сам статус делаем аккуратной сеткой */
#onecJobStatus {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Все прямые блоки внутри статуса - одинаковые карточки */
#onecJobStatus > div,
#onecJobStatus .onec-pill,
#onecJobStatus .onec-item {
    display: block !important;
    min-height: 78px !important;
    margin: 0 !important;
    padding: 14px 16px !important;
    box-sizing: border-box !important;

    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;

    font-size: 14px !important;
    line-height: 1.35 !important;
    color: #1f2937 !important;
    text-align: left !important;
    white-space: normal !important;
}

/* Жирный заголовок внутри карточки */
#onecJobStatus > div b,
#onecJobStatus .onec-pill b,
#onecJobStatus .onec-item b,
#onecJobStatus .onec-label,
#onecJobStatus .onec-pill-title {
    display: block !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;

    font-size: 13px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
    color: #111827 !important;
}

/* Значение внутри карточки */
#onecJobStatus .onec-value,
#onecJobStatus .onec-pill-value {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;

    font-size: 15px !important;
    line-height: 1.35 !important;
    font-weight: 500 !important;
    color: #1f2937 !important;
}

/* Убираем br, если старый JS их вставил */
#onecJobStatus br {
    display: none !important;
}

/* Блоки "Файл 1С" и "Как это работает" */
#onecCompactMeta {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 0 14px 0 !important;
    padding: 0 !important;
}

#onecXlsxStatus,
#onecCompactMeta > div,
.onec-compact-card {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 14px 16px !important;

    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;

    font-size: 14px !important;
    line-height: 1.45 !important;
    color: #1f2937 !important;
}

/* Строка фильтра */
.onec-compact-filter-row,
[data-page="onec"] .row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;

    margin: 0 0 16px 0 !important;
    padding: 12px !important;

    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

#onecFilterInput,
.onec-compact-filter-row input,
[data-page="onec"] .row input {
    flex: 1 1 auto !important;
    min-width: 320px !important;
    height: 42px !important;
    margin: 0 !important;
}

.onec-compact-filter-row button,
[data-page="onec"] .row button {
    height: 42px !important;
    margin: 0 !important;
    padding: 0 18px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    white-space: nowrap !important;
}

/* Адаптация */
@media (max-width: 1200px) {
    #onecJobStatus {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 760px) {
    #onecJobStatus {
        grid-template-columns: 1fr !important;
    }

    .onec-compact-filter-row,
    [data-page="onec"] .row {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #onecFilterInput,
    .onec-compact-filter-row input,
    .onec-compact-filter-row button,
    [data-page="onec"] .row input,
    [data-page="onec"] .row button {
        width: 100% !important;
        min-width: 0 !important;
    }
}



/* Кнопка печати сверки 1С */
#printOneCCompareButton {
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}



/* ===== TOP HEADER / NAV STABILITY FINAL ===== */

/* Убираем верхний выпадающий список разделов, оставляем только кнопки */
.top-page-select-hidden,
.top-page-select-wrapper-hidden {
    display: none !important;
}

/* Стабилизируем верхнюю шапку, чтобы текст не прыгал */
header,
.header,
.top-bar,
nav {
    box-sizing: border-box !important;
}

/* Кнопки разделов держим ровно */
button,
.small-btn,
.nav-btn {
    line-height: 1.2 !important;
}

/* Верхние кнопки не должны менять размер при клике/фокусе */
button:focus,
button:active {
    outline-offset: 0 !important;
}

/* Блоки 1С фиксируем по размеру, чтобы при обновлении текста не было скачков */
#onecJobStatus {
    align-items: stretch !important;
}

#onecJobStatus > div,
#onecJobStatus .onec-pill,
#onecJobStatus .onec-item {
    min-height: 78px !important;
    box-sizing: border-box !important;
}

/* Убираем визуальный скачок при hover/focus у карточек */
#onecJobStatus *,
#onecCompactTop *,
#onecCompactMeta * {
    transition: none !important;
}



/* ===== FINAL NAV CLEANUP / NO JUMP ===== */

/* Если верхний select вдруг остался - прячем любой похожий select в верхней части */
header select,
.top-bar select,
nav select,
body > select,
body > div > select:first-child {
    display: none !important;
}

/* Верхние кнопки разделов: без прыжков, без изменения размеров */
header button,
nav button,
.top-bar button,
button[onclick^="showPage"] {
    min-height: 38px !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    transform: none !important;
    transition: none !important;
    font-weight: 600 !important;
    border-width: 1px !important;
}

/* При клике/фокусе размер не меняется */
button:active,
button:focus,
button:hover {
    transform: none !important;
    transition: none !important;
}

/* Чтобы контент не прыгал при динамических обновлениях */
.page-section,
.card,
section {
    box-sizing: border-box !important;
}



/* ===== CENTER TOP NAV BUTTONS ===== */

/* Центрируем строку кнопок разделов */
header nav,
.header nav,
.top-bar nav,
nav {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
}

/* Если кнопки лежат не прямо в nav, а в отдельном контейнере */
header .nav-buttons,
.header .nav-buttons,
.top-bar .nav-buttons,
.nav-buttons,
.menu-buttons,
.tabs,
.tab-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
}

/* Сами кнопки разделов */
button[onclick^="showPage"] {
    margin: 0 !important;
    flex: 0 0 auto !important;
    min-width: 112px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.top-nav {
    min-height: 74px !important;
    align-content: center !important;
}

.top-nav .nav-buttons {
    min-height: 44px !important;
}

.warehouse-stock-mini,
.warehouse-stock-inline {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-top: 6px !important;
}

.warehouse-stock-chip {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 26px !important;
    padding: 4px 8px !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    border-radius: 999px !important;
    background: rgba(248, 250, 252, 0.92) !important;
    color: #334155 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

#warehousesList,
#transferTable,
#warehouseStockTable,
#warehouseTransfersLog {
    overflow-x: auto !important;
}

#transferTable {
    max-height: 420px !important;
    overflow-y: auto !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    border-radius: 8px !important;
}

#transferTable table,
#warehouseTransfersLog table {
    min-width: 760px !important;
}

#warehousesList .warehouse-list-row {
    display: grid !important;
    grid-template-columns: minmax(180px, 1fr) auto auto auto !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22) !important;
}

#warehousesList .warehouse-list-row input[type="text"],
#warehousesList .warehouse-list-row input:not([type]) {
    min-width: 0 !important;
    width: 100% !important;
}

.warehouse-inline-flag {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    margin: 0 !important;
}

#warehousesList .warehouse-list-row:last-child {
    border-bottom: 0 !important;
}

body.dark-theme .warehouse-stock-chip {
    background: rgba(15, 23, 42, 0.86) !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
    color: #dbeafe !important;
}

.transfer-shortage-row > td {
    background: #fee2e2 !important;
}

.transfer-warning {
    padding: 10px 12px !important;
    border-radius: 8px !important;
    margin-bottom: 8px !important;
    background: #fee2e2 !important;
    color: #991b1b !important;
    font-weight: 700 !important;
}

.history-warehouse-stock-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    margin-top: 5px !important;
}

body.dark-theme .transfer-shortage-row > td {
    background: rgba(127, 29, 29, 0.35) !important;
}

body.dark-theme .transfer-warning {
    background: rgba(127, 29, 29, 0.42) !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.3) !important;
}

@media (max-width: 760px) {
    #warehousesList .warehouse-list-row {
        grid-template-columns: 1fr !important;
    }
}


/* ===== Top stock stats date picker ===== */

.top-stock-stats-date-picker {
    margin: 10px 0 14px 0 !important;
    padding: 12px 14px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

.top-stock-stats-title {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px 14px !important;
    margin-bottom: 10px !important;
}

.top-stock-stats-title b {
    font-size: 15px !important;
}

.top-stock-stats-title span {
    color: #4b5563 !important;
    font-size: 14px !important;
}

.top-stock-stats-controls {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
}

.top-stock-stats-controls label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
}

#topStockStatsWarehouseSelect {
    display: inline-block !important;
    min-width: 180px !important;
    width: auto !important;
}

.top-stock-stats-controls label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-weight: 600 !important;
}

.top-stock-stats-controls input[type="date"] {
    height: 38px !important;
    padding: 0 10px !important;
}

.top-stock-stats-controls button {
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}



/* ===== Final stock stats status ===== */

.top-stock-stats-status {
    margin-top: 10px !important;
    padding: 9px 11px !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.final-stock-stats-col {
    text-align: center !important;
    white-space: nowrap !important;
}



/* ===== Barcode label support ===== */

.label-code-type-box {
    margin: 10px 0 12px 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 14px !important;
    background: #ffffff !important;
}

.label-code-type-box label {
    display: block !important;
    font-weight: 700 !important;
    margin-bottom: 6px !important;
}

.label-code-type-box select {
    display: block !important;
    width: 260px !important;
    max-width: 100% !important;
    height: 40px !important;
    margin-top: 5px !important;
}

.label-code-type-box small {
    display: block !important;
    color: #4b5563 !important;
    margin-top: 5px !important;
}

.barcode-label-preview-holder {
    display: inline-block !important;
    padding: 8px !important;
    border: 1px dashed #d1d5db !important;
    border-radius: 10px !important;
    background: #fff !important;
}

.barcode-label-30x20 {
    width: 30mm;
    height: 20mm;
    box-sizing: border-box;
    border: 1px dashed #d1d5db;
    border-radius: 4px;
    padding: 1.2mm 1.4mm 0.8mm 1.4mm;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.barcode-label-code {
    width: 27mm;
    height: 14mm;
    overflow: hidden;
}

.barcode-label-code svg {
    width: 27mm;
    height: 14mm;
    display: block;
}

.barcode-label-sku {
    width: 100%;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 6pt;
    line-height: 1;
    color: #111;
    margin-top: 0.7mm;
    white-space: nowrap;
    overflow: hidden;
}



/* ===== Real barcode selector and label ===== */

.label-code-type-box {
    margin: 10px 0 14px 0 !important;
    padding: 12px 14px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

.label-code-type-box label {
    display: block !important;
    font-weight: 700 !important;
    margin-bottom: 6px !important;
}

.label-code-type-box select {
    width: 280px !important;
    max-width: 100% !important;
    height: 40px !important;
}

.label-code-type-box small {
    display: block !important;
    margin-top: 6px !important;
    color: #4b5563 !important;
}

.barcode-preview-final {
    margin-top: 12px !important;
    padding: 10px !important;
    border: 1px dashed #cbd5e1 !important;
    border-radius: 12px !important;
    background: #fff !important;
    display: inline-block !important;
}

.barcode-label-30x20-final {
    width: 30mm;
    height: 20mm;
    box-sizing: border-box;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    padding: 1.2mm 1.2mm 0.7mm 1.2mm;
    background: #fff;
}

.barcode-final-code {
    width: 27.5mm;
    height: 14.5mm;
    overflow: hidden;
}

.barcode-final-code svg {
    width: 27.5mm;
    height: 14.5mm;
    display: block;
}

.barcode-final-text {
    margin-top: 0.5mm;
    width: 100%;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 6pt;
    line-height: 1;
    color: #000;
}



/* ===== Settings page ===== */

.settings-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
    gap: 14px !important;
    margin-top: 14px !important;
}

.settings-card {
    padding: 16px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

.settings-card h3 {
    margin: 0 0 8px 0 !important;
    font-size: 18px !important;
}

.settings-card p {
    margin: 0 0 12px 0 !important;
    color: #4b5563 !important;
    line-height: 1.45 !important;
}

.settings-card button:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
}



/* ===== Active nav button ===== */

.active-nav-button {
    filter: brightness(0.92) !important;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35) !important;
}



/* ===== Settings users management ===== */

.settings-card-wide {
    grid-column: 1 / -1 !important;
}

.users-settings-toolbar {
    margin: 10px 0 12px 0 !important;
}

.users-create-box {
    margin: 12px 0 !important;
    padding: 12px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
}

.users-create-box h4 {
    margin: 0 0 10px 0 !important;
}

.users-form-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center !important;
}

.users-form-row input,
.users-form-row select {
    height: 40px !important;
    min-width: 180px !important;
}

.settings-users-status {
    margin: 10px 0 !important;
    font-weight: 700 !important;
}

.settings-users-table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.settings-users-table th,
.settings-users-table td {
    border: 1px solid #dbe3ee !important;
    padding: 8px 10px !important;
    vertical-align: middle !important;
}

.settings-users-table th {
    background: #f3f6fb !important;
}

.settings-users-table input,
.settings-users-table select {
    height: 36px !important;
}

.settings-users-table button {
    margin: 2px !important;
}

.user-self-mark {
    display: inline-block !important;
    margin-left: 6px !important;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    background: #eef4ff !important;
    color: #1d4ed8 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.danger-btn {
    background: #dc2626 !important;
    color: #fff !important;
}

@media (max-width: 900px) {
    .settings-users-table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
}



/* ===== User page permissions ===== */

.user-pages-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(160px, 1fr)) !important;
    gap: 6px 10px !important;
    min-width: 340px !important;
}

.user-page-check {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.user-page-check input {
    width: 16px !important;
    height: 16px !important;
}

.user-pages-admin-note {
    padding: 8px 10px !important;
    border-radius: 10px !important;
    background: #eef4ff !important;
    color: #1d4ed8 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

.settings-users-table td:nth-child(6) {
    min-width: 380px !important;
}

@media (max-width: 900px) {
    .user-pages-grid {
        grid-template-columns: 1fr !important;
        min-width: 260px !important;
    }
}



/* ===== Regular user restrictions ===== */

.regular-user-no-edit [data-hidden-for-regular-user="1"] {
    display: none !important;
}



/* ===== Regular user restrictions ===== */

.regular-user-no-edit [data-hidden-for-regular-user="1"] {
    display: none !important;
}



/* ===== Final settings tile pages ===== */

.settings-root-card {
    padding: 22px !important;
}

.settings-home-subtitle {
    margin: 4px 0 16px 0 !important;
    color: #4b5563 !important;
}

.settings-tiles-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
    gap: 14px !important;
    margin-top: 14px !important;
}

.settings-card {
    padding: 16px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

.settings-card h3 {
    margin: 0 0 8px 0 !important;
    font-size: 18px !important;
}

.settings-card p {
    margin: 0 0 12px 0 !important;
    color: #4b5563 !important;
    line-height: 1.45 !important;
}

.settings-subpage-final {
    margin-top: 4px !important;
}

.settings-subpage-back {
    margin-bottom: 14px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.settings-placeholder-box {
    margin-top: 14px !important;
    padding: 14px 16px !important;
    border: 1px dashed #cbd5e1 !important;
    border-radius: 16px !important;
    background: #f8fafc !important;
    color: #4b5563 !important;
    font-weight: 600 !important;
}

.users-settings-toolbar {
    margin: 10px 0 12px 0 !important;
}

.users-create-box {
    margin: 12px 0 !important;
    padding: 12px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
}

.users-create-box h4 {
    margin: 0 0 10px 0 !important;
}

.users-form-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center !important;
}

.users-form-row input,
.users-form-row select {
    height: 40px !important;
    min-width: 180px !important;
}

.settings-users-status {
    margin: 10px 0 !important;
    font-weight: 700 !important;
}

.settings-users-table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.settings-users-table th,
.settings-users-table td {
    border: 1px solid #dbe3ee !important;
    padding: 8px 10px !important;
    vertical-align: middle !important;
}

.settings-users-table th {
    background: #f3f6fb !important;
}

.settings-users-table input,
.settings-users-table select {
    height: 36px !important;
}

.settings-users-table button {
    margin: 2px !important;
}

.user-self-mark {
    display: inline-block !important;
    margin-left: 6px !important;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    background: #eef4ff !important;
    color: #1d4ed8 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.user-pages-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(160px, 1fr)) !important;
    gap: 6px 10px !important;
    min-width: 340px !important;
}

.user-page-check {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.user-page-check input {
    width: 16px !important;
    height: 16px !important;
}

.user-pages-admin-note {
    padding: 8px 10px !important;
    border-radius: 10px !important;
    background: #eef4ff !important;
    color: #1d4ed8 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

.settings-users-table td:nth-child(6) {
    min-width: 380px !important;
}

.danger-btn {
    background: #dc2626 !important;
    color: #fff !important;
}

@media (max-width: 900px) {
    .settings-users-table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }

    .user-pages-grid {
        grid-template-columns: 1fr !important;
        min-width: 260px !important;
    }
}



/* ===== Print settings page ===== */

.print-settings-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 12px !important;
    margin: 14px 0 !important;
}

.print-settings-card {
    padding: 14px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

.print-settings-card label {
    display: block !important;
    font-weight: 700 !important;
}

.print-settings-card select,
.print-settings-card input {
    width: 100% !important;
    height: 40px !important;
    margin-top: 7px !important;
}

.print-settings-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin: 12px 0 !important;
}

.print-settings-preview-box {
    margin-top: 14px !important;
    padding: 14px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #f8fafc !important;
}

.print-settings-label-preview {
    width: 30mm !important;
    height: 20mm !important;
    box-sizing: border-box !important;
    padding: 1.2mm !important;
    border: 1px dashed #cbd5e1 !important;
    border-radius: 4px !important;
    background: #fff !important;
}

.print-settings-label-code {
    width: 27.5mm !important;
    height: 14.5mm !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.print-settings-label-code svg {
    width: 27.5mm !important;
    height: 14.5mm !important;
    display: block !important;
}

.print-settings-label-sku {
    margin-top: 0.5mm !important;
    width: 100% !important;
    text-align: center !important;
    font-family: Arial, sans-serif !important;
    font-size: 6pt !important;
    line-height: 1 !important;
}

.print-settings-fake-qr {
    width: 13mm !important;
    height: 13mm !important;
    border: 1px solid #111 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 800 !important;
    font-size: 8pt !important;
}

.print-scale-small {
    transform: scale(0.86) !important;
}

.print-scale-medium {
    transform: scale(1) !important;
}

.print-scale-large {
    transform: scale(1.12) !important;
}




/* ===== Print all stock labels button ===== */

.bulk-stock-labels-toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center !important;
    margin: 10px 0 14px 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
}

#printAllStockLabelsBtn {
    font-weight: 700 !important;
}




/* ===== Bulk QR code source select ===== */

.bulk-qr-source-control {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    min-width: 240px !important;
}

.bulk-qr-source-control label {
    font-weight: 700 !important;
}

.bulk-qr-source-control select {
    height: 36px !important;
    margin-left: 6px !important;
}

.bulk-qr-source-hint {
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
}



/* ===== Quick search on top ===== */

.quick-search-top-block {
    order: -999 !important;
    margin-top: 0 !important;
    margin-bottom: 14px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08) !important;
}



/* ===== Quick search before stock block ===== */

.quick-search-before-stock-final {
    margin-bottom: 14px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08) !important;
}



/* ===== Bigger inventory not found message ===== */

.inventory-not-found-inline-big {
    margin-top: 12px !important;
    margin-bottom: 14px !important;
    padding: 18px 20px !important;
    border: 3px solid #dc2626 !important;
    border-radius: 16px !important;
    background: #fee2e2 !important;
    color: #b91c1c !important;
    font-size: 34px !important;
    line-height: 1.1 !important;
    font-weight: 1000 !important;
    letter-spacing: 0.5px !important;
    text-align: center !important;
    text-transform: uppercase !important;
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.18) !important;
}

.inventory-not-found-inline-big span {
    display: block !important;
    margin-top: 8px !important;
    color: #7f1d1d !important;
    font-size: 24px !important;
    font-family: monospace !important;
    font-weight: 900 !important;
}



/* ===== Safe quick search not found message ===== */

#quickSearchNotFoundInlineMessage.quick-search-not-found-safe {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 12px 0 0 0 !important;
    padding: 12px 16px !important;
    border: 1.5px solid #ef4444 !important;
    border-radius: 12px !important;
    background: #fef2f2 !important;
    color: #b91c1c !important;
    font-size: 18px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    text-align: left !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08) !important;
}

#quickSearchNotFoundInlineMessage.quick-search-not-found-safe span {
    color: #7f1d1d !important;
    font-size: 17px !important;
    font-family: monospace !important;
    font-weight: 800 !important;
}



/* ===== Main history table with movements final ===== */

.hidden-current-stock-final {
    display: none !important;
}

.movement-text-cell-final {
    min-width: 220px !important;
    max-width: 420px !important;
    white-space: normal !important;
    color: #334155 !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
}

.history-only-row-final {
    background: #fff7ed !important;
}

.history-only-note-final {
    margin-top: 3px !important;
    color: #9a3412 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.history-movement-col-final {
    vertical-align: top !important;
}




/* ===== Main history table with movements final ===== */

.hidden-current-stock-final {
    display: none !important;
}

.movement-text-cell-final {
    min-width: 220px !important;
    max-width: 420px !important;
    white-space: normal !important;
    color: #334155 !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
}

.history-only-row-final {
    background: #fff7ed !important;
}

.history-only-note-final {
    margin-top: 3px !important;
    color: #9a3412 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.history-movement-col-final {
    vertical-align: top !important;
}




/* ===== Stable home inventory history with movements ===== */

.home-history-hidden-stock {
    display: none !important;
}

.home-history-stable-col {
    vertical-align: top !important;
}

.home-history-movement-cell {
    min-width: 220px !important;
    max-width: 420px !important;
    white-space: normal !important;
    color: #334155 !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
}

.home-history-only-row {
    background: #fff7ed !important;
}

.home-history-note {
    margin-top: 3px !important;
    color: #9a3412 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}




/* ===== Robust product manage table ===== */

.product-manage-status-robust {
    margin: 10px 0 12px 0 !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 700 !important;
}

.product-manage-scroll {
    width: 100% !important;
    overflow-x: auto !important;
}

.product-manage-table-robust {
    width: 100% !important;
    border-collapse: collapse !important;
}

.product-manage-table-robust th,
.product-manage-table-robust td {
    padding: 8px 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    vertical-align: middle !important;
}

.product-manage-table-robust th {
    background: #f8fafc !important;
    text-align: left !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}

.product-manage-input {
    width: 100% !important;
    min-width: 130px !important;
    box-sizing: border-box !important;
    padding: 7px 8px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
}

.product-manage-name {
    min-width: 360px !important;
}

.product-manage-sku {
    min-width: 90px !important;
}

.product-manage-min {
    min-width: 70px !important;
}

.product-manage-id,
.product-manage-stock,
.product-manage-active-cell {
    text-align: center !important;
    white-space: nowrap !important;
}

.product-manage-actions {
    white-space: nowrap !important;
}

.product-save-btn-robust {
    border: none !important;
    border-radius: 9px !important;
    padding: 8px 12px !important;
    background: #0d4dcc !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    cursor: pointer !important;
}

.product-save-btn-robust:disabled {
    opacity: 0.6 !important;
    cursor: wait !important;
}




/* ===== Robust Vladivostok movements table ===== */

.movement-status-robust {
    margin: 10px 0 12px 0 !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 700 !important;
}

.movement-table-scroll-robust {
    width: 100% !important;
    overflow-x: auto !important;
}

.movement-table-robust {
    width: 100% !important;
    border-collapse: collapse !important;
}

.movement-table-robust th,
.movement-table-robust td {
    padding: 8px 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    vertical-align: top !important;
}

.movement-table-robust th {
    background: #f8fafc !important;
    text-align: left !important;
    white-space: nowrap !important;
    font-weight: 800 !important;
}

.movement-product-name-robust {
    min-width: 320px !important;
}

.movement-comment-robust {
    min-width: 260px !important;
    max-width: 520px !important;
    white-space: normal !important;
}




/* ===== Force movements order final ===== */

.movement-table-locked-order tbody tr {
    transition: none !important;
}

.movement-table-locked-order th,
.movement-table-locked-order td {
    vertical-align: top !important;
}




/* ===== Monthly stock history page ===== */

.history-page-card {
    overflow: hidden !important;
}

.history-page-subtitle {
    color: #475569 !important;
    margin-top: 4px !important;
}

.history-controls {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: end !important;
    gap: 12px !important;
    margin: 16px 0 !important;
}

.history-controls label {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    font-weight: 700 !important;
}

.history-controls input {
    min-width: 190px !important;
}

.history-status {
    margin: 10px 0 12px 0 !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 700 !important;
}

.history-empty {
    padding: 16px !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    color: #475569 !important;
    font-weight: 700 !important;
}

.history-table-wrap {
    width: 100% !important;
    max-height: 75vh !important;
    overflow: auto !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
}

.history-month-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    min-width: max-content !important;
    width: max-content !important;
    font-size: 13px !important;
}

.history-month-table th,
.history-month-table td {
    border-right: 1px solid #94a3b8 !important;
    border-bottom: 1px solid #94a3b8 !important;
    padding: 7px 8px !important;
    vertical-align: top !important;
}

.history-month-table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 6 !important;
    background: #e2e8f0 !important;
    text-align: center !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
}

.history-month-table thead tr:nth-child(2) th {
    top: 36px !important;
    z-index: 7 !important;
}

.history-sticky {
    position: sticky !important;
    z-index: 8 !important;
    background: #ffffff !important;
}

.history-main-header.history-sticky {
    z-index: 12 !important;
    background: #e2e8f0 !important;
}

.history-sku {
    left: 0 !important;
    min-width: 92px !important;
    width: 92px !important;
    max-width: 92px !important;
    text-align: center !important;
    font-weight: 800 !important;
}

.history-name {
    left: 92px !important;
    min-width: 360px !important;
    width: 360px !important;
    max-width: 360px !important;
    white-space: normal !important;
    font-weight: 700 !important;
}

.history-day-header {
    background: #dbeafe !important;
    min-width: 150px !important;
}

.history-sub-header {
    min-width: 75px !important;
}

.history-morning,
.history-morning-cell {
    background: #dcfce7 !important;
}

.history-evening,
.history-evening-cell {
    background: #bbf7d0 !important;
}

.history-cell {
    min-width: 75px !important;
    max-width: 140px !important;
    text-align: center !important;
}

.history-qty {
    font-weight: 900 !important;
    font-size: 14px !important;
}

.history-zero .history-qty {
    color: #64748b !important;
}

.history-positive .history-qty {
    color: #14532d !important;
}

.history-negative .history-qty {
    color: #991b1b !important;
}

.history-movement-text {
    margin-top: 3px !important;
    padding-top: 3px !important;
    border-top: 1px dashed rgba(15, 23, 42, 0.25) !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    text-align: left !important;
    color: #7f1d1d !important;
    font-weight: 800 !important;
    max-width: 135px !important;
    white-space: normal !important;
}

.history-row:hover td {
    filter: brightness(0.98) !important;
}

.history-month-table th.history-period-no-inventory {
    background: #fee2e2 !important;
    color: #7f1d1d !important;
    box-shadow: inset 0 -3px 0 rgba(220, 38, 38, 0.34) !important;
}

.history-month-table td.history-calculated-without-inventory {
    background: #fff1f2 !important;
    box-shadow: inset 3px 0 0 rgba(220, 38, 38, 0.46) !important;
}

.history-month-table td.history-calculated-without-inventory.history-morning-cell {
    background: linear-gradient(90deg, rgba(254, 202, 202, 0.78), rgba(255, 241, 242, 0.92)) !important;
}

.history-month-table td.history-calculated-without-inventory.history-evening-cell {
    background: linear-gradient(90deg, rgba(252, 165, 165, 0.70), rgba(255, 228, 230, 0.92)) !important;
}

.history-month-table td.history-calculated-without-inventory .history-qty {
    color: #7f1d1d !important;
}

.history-month-table td.history-real-inventory-cell {
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.12) !important;
}




/* ===== Home hide zero products checkbox ===== */

.home-hide-zero-products-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 9px !important;
    margin: 10px 0 4px 0 !important;
    padding: 9px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    user-select: none !important;
}

.home-hide-zero-products-toggle input {
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
}

.home-zero-product-hidden-by-checkbox {
    display: none !important;
}

.home-hide-zero-products-active {
    border-top: 2px solid #e2e8f0 !important;
}




/* ===== Missing evening inventory on home ===== */

.home-evening-missing-forced-blank {
    color: #64748b !important;
    font-weight: 800 !important;
    background: #f1f5f9 !important;
}



/* PRODUCT BARCODES UI PATCH 2026-04-29 */

.product-manage-table {
    width: 100%;
    table-layout: auto;
}

.product-manage-table .onec-name-header,
.product-manage-table .onec-name-cell {
    min-width: 360px;
    max-width: 620px;
    white-space: normal;
    word-break: break-word;
}

.product-manage-table .barcode-cell {
    min-width: 220px;
    white-space: normal;
}

.barcode-line {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 2px 0;
    flex-wrap: wrap;
}

.barcode-line small {
    opacity: 0.65;
}

.barcode-edit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.edit-barcode-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(130px, 0.8fr) minmax(160px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.barcode-add-box {
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    padding-top: 12px;
    margin-top: 10px;
}

.barcode-hint,
.muted-text {
    font-size: 12px;
    opacity: 0.65;
}

@media (max-width: 900px) {
    .edit-barcode-row {
        grid-template-columns: 1fr;
    }

    .product-manage-table .onec-name-header,
    .product-manage-table .onec-name-cell {
        min-width: 240px;
    }
}

/* FORCE PRODUCT TABLE WIDTH FINAL 2026-04-29 */

.product-manage-table-final {
    width: 100%;
    table-layout: fixed;
}

.product-manage-table-final .sku-col {
    width: 90px;
}

.product-manage-table-final .name-col {
    width: 220px;
}

.product-manage-table-final .onec-name-col {
    width: 420px;
    min-width: 420px;
    white-space: normal;
    word-break: break-word;
}

.product-manage-table-final .barcodes-col {
    width: 260px;
    white-space: normal;
    word-break: break-word;
}

.product-manage-table-final .stock-col {
    width: 80px;
    text-align: center;
}

.product-manage-table-final .actions-col {
    width: 160px;
}

.barcode-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0;
}

.barcode-line small {
    opacity: 0.65;
}

.edit-barcode-row {
    display: grid;
    grid-template-columns: minmax(170px, 1.2fr) minmax(120px, 0.7fr) minmax(150px, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.barcode-edit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.barcode-add-box {
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    padding-top: 12px;
    margin-top: 10px;
}

.barcode-hint,
.muted-text {
    font-size: 12px;
    opacity: 0.65;
}

@media (max-width: 900px) {
    .product-manage-table-final {
        table-layout: auto;
    }

    .product-manage-table-final .onec-name-col {
        min-width: 280px;
        width: 280px;
    }

    .edit-barcode-row {
        grid-template-columns: 1fr;
    }
}

/* HARD FINAL PRODUCT TABLE WIDTH 2026-04-29 */

#productManageTable table.product-manage-table-final {
    width: 100%;
    table-layout: fixed;
}

#productManageTable .sku-col {
    width: 90px;
}

#productManageTable .name-col {
    width: 220px;
}

#productManageTable .onec-name-col {
    width: 480px;
    min-width: 480px;
    white-space: normal;
    word-break: break-word;
}

#productManageTable .barcodes-col {
    width: 260px;
    white-space: normal;
    word-break: break-word;
}

#productManageTable .stock-col {
    width: 80px;
    text-align: center;
}

#productManageTable .actions-col {
    width: 150px;
}

#productManageTable .barcode-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0;
}

#productManageTable .barcode-line small {
    opacity: 0.65;
}

@media (max-width: 900px) {
    #productManageTable table.product-manage-table-final {
        table-layout: auto;
    }

    #productManageTable .onec-name-col {
        min-width: 320px;
        width: 320px;
    }
}

/* FIX BARCODE EDIT MODAL LAYOUT 2026-04-29 */

#productModal .modal-card {
    max-width: 760px;
    width: min(760px, calc(100vw - 32px));
}

#editProductBarcodes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#editProductBarcodes .edit-barcode-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1.25fr) minmax(130px, 0.75fr) auto;
    grid-template-areas:
        "barcode type action"
        "comment comment comment";
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.55);
}

#editProductBarcodes .edit-barcode-value {
    grid-area: barcode;
    min-width: 0;
    width: 100%;
}

#editProductBarcodes .edit-barcode-type {
    grid-area: type;
    min-width: 0;
    width: 100%;
}

#editProductBarcodes .edit-barcode-comment {
    grid-area: comment;
    min-width: 0;
    width: 100%;
}

#editProductBarcodes .danger-btn {
    grid-area: action;
    white-space: nowrap;
    width: auto;
    min-width: 82px;
}

#editProductBarcodes .barcode-hint {
    grid-area: action;
    max-width: 110px;
    font-size: 12px;
    line-height: 1.15;
    opacity: 0.65;
    text-align: left;
}

#productModal .barcode-add-box {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
}

#productModal .barcode-add-box input,
#productModal .barcode-add-box select {
    width: 100%;
}

@media (max-width: 700px) {
    #editProductBarcodes .edit-barcode-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "barcode"
            "type"
            "comment"
            "action";
    }

    #editProductBarcodes .danger-btn,
    #editProductBarcodes .barcode-hint {
        width: 100%;
        max-width: none;
    }
}


/* FIX PRODUCT MODAL FIT 2026-04-29 */

#productModal {
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 12px;
}

#productModal .modal-card {
    width: min(860px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 20px 22px;
    border-radius: 18px;
    box-sizing: border-box;
}

#productModal .modal-card h2 {
    margin-bottom: 14px;
    font-size: 22px;
    line-height: 1.2;
}

#productModal label {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.2;
}

#productModal input,
#productModal select,
#productModal textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 15px;
    box-sizing: border-box;
}

#editProductBarcodes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#editProductBarcodes .edit-barcode-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1.2fr) minmax(170px, 0.7fr) auto;
    grid-template-areas:
        "barcode type action"
        "comment comment comment";
    gap: 6px;
    align-items: center;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.55);
    box-sizing: border-box;
}

#editProductBarcodes .edit-barcode-value {
    grid-area: barcode;
    min-width: 0;
}

#editProductBarcodes .edit-barcode-type {
    grid-area: type;
    min-width: 0;
}

#editProductBarcodes .edit-barcode-comment {
    grid-area: comment;
    min-width: 0;
}

#editProductBarcodes .danger-btn {
    grid-area: action;
    white-space: nowrap;
    min-width: 96px;
    height: 42px;
}

#editProductBarcodes .barcode-hint {
    grid-area: action;
    font-size: 12px;
    line-height: 1.15;
    max-width: 110px;
    color: #6b7280;
}

#productModal .barcode-add-box {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
}

#productModal .modal-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    padding-bottom: 2px;
    background: #fff;
}

#productModal .modal-actions button {
    min-height: 42px;
    padding: 10px 20px;
}

@media (max-width: 900px) {
    #productModal .modal-card {
        width: min(820px, calc(100vw - 20px));
        max-height: calc(100vh - 20px);
        padding: 18px;
    }
}

@media (max-width: 700px) {
    #editProductBarcodes .edit-barcode-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "barcode"
            "type"
            "comment"
            "action";
    }

    #editProductBarcodes .danger-btn,
    #editProductBarcodes .barcode-hint {
        max-width: none;
        width: 100%;
    }
}


/* COMPACT VERTICAL PRODUCT BUTTONS 2026-04-29 */

#productManageTable .actions-col {
    width: 135px !important;
    min-width: 135px !important;
}

#productManageTable .actions-col .action-buttons {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 5px !important;
    flex-wrap: nowrap !important;
}

#productManageTable .actions-col .small-btn {
    width: 118px !important;
    min-width: 118px !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 5px 8px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
}

#productManageTable .actions-col .danger-btn {
    width: 82px !important;
    min-width: 82px !important;
}

#productManageTable table.product-manage-table-final th,
#productManageTable table.product-manage-table-final td {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

#productManageTable .barcode-line {
    margin: 0 !important;
    line-height: 1.2 !important;
}




/* ===== Compact product list buttons ===== */

/* Кнопки в списке товаров: История / Редактировать / Удалить */
#productManageTable button,
#productManageTable .small-btn,
#productManageTable .link-button,
#productManageTable .secondary-btn,
#productManageTable .danger-btn,
.product-manage-table button,
.product-manage-table-final button,
.product-manage-table-robust button {
    font-size: 11px !important;
    line-height: 1.15 !important;
    padding: 4px 7px !important;
    border-radius: 7px !important;
    min-height: 24px !important;
    min-width: auto !important;
    width: auto !important;
    white-space: nowrap !important;
    margin: 2px !important;
}

/* Ячейка с действиями больше не распирает таблицу */
#productManageTable td:last-child,
.product-manage-actions {
    white-space: normal !important;
    min-width: 90px !important;
    max-width: 160px !important;
}

/* Если кнопки стоят рядом - разрешаем аккуратно переносить */
#productManageTable td:last-child {
    line-height: 1.2 !important;
}

/* Отдельно для кнопки удаления - тоже маленькая */
#productManageTable button[onclick*="delete"],
#productManageTable button[onclick*="Delete"],
#productManageTable button[data-product-delete],
#productManageTable .danger-btn {
    font-size: 11px !important;
    padding: 4px 7px !important;
}

/* ===== End compact product list buttons ===== */

/* ===== VERY COMPACT PRODUCT ACTION BUTTONS FINAL ===== */

#productManageTable table td:last-child {
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    padding: 4px 4px !important;
    text-align: center !important;
    white-space: normal !important;
}

#productManageTable table td:last-child button,
#productManageTable table td:last-child .small-btn,
#productManageTable table td:last-child .link-button,
#productManageTable table td:last-child .secondary-btn,
#productManageTable table td:last-child .danger-btn {
    display: block !important;
    width: 78px !important;
    min-width: 0 !important;
    max-width: 78px !important;
    height: 22px !important;
    min-height: 22px !important;
    padding: 2px 4px !important;
    margin: 2px auto !important;
    font-size: 9px !important;
    line-height: 1 !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* На случай если кнопки не в последней ячейке, а имеют onclick */
#productManageTable button[onclick*="edit"],
#productManageTable button[onclick*="Edit"],
#productManageTable button[onclick*="delete"],
#productManageTable button[onclick*="Delete"],
#productManageTable button[onclick*="Product"] {
    width: 78px !important;
    min-width: 0 !important;
    max-width: 78px !important;
    height: 22px !important;
    min-height: 22px !important;
    padding: 2px 4px !important;
    margin: 2px auto !important;
    font-size: 9px !important;
    line-height: 1 !important;
    border-radius: 6px !important;
}

/* Чтобы таблица не раздувалась из-за действий */
#productManageTable th:last-child {
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    text-align: center !important;
}

/* ===== END VERY COMPACT PRODUCT ACTION BUTTONS FINAL ===== */




/* ===== Movement product search inputs final ===== */

.movement-product-original-select-hidden {
    display: none !important;
}

.movement-product-search-wrapper {
    display: grid !important;
    grid-template-columns: minmax(220px, 1fr) auto !important;
    gap: 8px !important;
    align-items: center !important;
    margin-bottom: 8px !important;
}

.movement-product-search-input {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}

.movement-product-search-button {
    padding: 10px 14px !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
}

.movement-product-search-status {
    grid-column: 1 / -1 !important;
    min-height: 22px !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 700 !important;
}

.movement-product-search-status:empty {
    display: none !important;
}

.movement-product-search-stock {
    margin-left: 8px !important;
    color: #475569 !important;
}

.movement-product-search-title {
    margin-bottom: 6px !important;
    font-weight: 900 !important;
}

.movement-product-search-result {
    display: block !important;
    width: 100% !important;
    margin: 4px 0 !important;
    padding: 8px 10px !important;
    border-radius: 9px !important;
    text-align: left !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    background: #0d4dcc !important;
    color: #ffffff !important;
}

/* ===== End movement product search inputs final ===== */

/* ===== FIX MOVEMENT SEARCH BUTTON ALIGN ===== */

.movement-product-search-wrapper {
    display: grid !important;
    grid-template-columns: minmax(240px, 1fr) 92px !important;
    gap: 8px !important;
    align-items: stretch !important;
}

.movement-product-search-input {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.movement-product-search-button {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    align-self: stretch !important;
}

/* ===== END FIX MOVEMENT SEARCH BUTTON ALIGN ===== */




/* ===== Clean movements page no jump ===== */

.clean-movements-table-box {
    margin-top: 14px !important;
}

.clean-movements-status {
    margin: 10px 0 12px 0 !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 800 !important;
}

.clean-movements-scroll {
    width: 100% !important;
    overflow-x: auto !important;
}

.clean-movements-table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.clean-movements-table th,
.clean-movements-table td {
    padding: 8px 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    vertical-align: top !important;
}

.clean-movements-table th {
    background: #f8fafc !important;
    text-align: left !important;
    white-space: nowrap !important;
    font-weight: 900 !important;
}

.clean-movement-name {
    min-width: 320px !important;
    max-width: 520px !important;
}

.clean-movement-comment {
    min-width: 240px !important;
    max-width: 520px !important;
    white-space: normal !important;
}

/* ===== End clean movements page no jump ===== */

/* ===== Hard lock movements display final ===== */

#movementsHardLockRoot {
    margin-top: 14px !important;
    display: block !important;
}

.movements-hard-status {
    margin: 10px 0 12px 0 !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 800 !important;
}

.movements-hard-scroll {
    width: 100% !important;
    overflow-x: auto !important;
}

.movements-hard-table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.movements-hard-table th,
.movements-hard-table td {
    padding: 8px 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    vertical-align: top !important;
}

.movements-hard-table th {
    background: #f8fafc !important;
    text-align: left !important;
    white-space: nowrap !important;
    font-weight: 900 !important;
}

.movements-hard-name {
    min-width: 320px !important;
    max-width: 520px !important;
}

.movements-hard-comment {
    min-width: 240px !important;
    max-width: 520px !important;
    white-space: normal !important;
}

/* ===== End hard lock movements display final ===== */


/* ===== Home stock table settle guard final ===== */

.home-stock-settle-status {
    margin: 10px 0 12px 0 !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 800 !important;
}

.home-stock-table-settling {
    opacity: 0 !important;
    max-height: 120px !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* ===== End home stock table settle guard final ===== */




/* ===== Home stock hard lock final ===== */

#homeStockHardLockRoot {
    display: block !important;
    margin-top: 10px !important;
}

.home-stock-hard-status {
    margin: 10px 0 12px 0 !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 800 !important;
}

.home-stock-hard-scroll {
    width: 100% !important;
    overflow-x: auto !important;
}

.home-stock-hard-table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.home-stock-hard-table th,
.home-stock-hard-table td {
    padding: 8px 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    vertical-align: top !important;
}

.home-stock-hard-table th {
    background: #f8fafc !important;
    text-align: left !important;
    white-space: nowrap !important;
    font-weight: 900 !important;
}

.home-stock-sku {
    min-width: 80px !important;
    font-weight: 800 !important;
}

.home-stock-name {
    min-width: 320px !important;
    max-width: 560px !important;
}

.home-stock-qty {
    text-align: center !important;
    font-weight: 900 !important;
    min-width: 70px !important;
}

.home-stock-qty.stock-empty,
.home-stock-qty.stock-zero {
    color: #64748b !important;
    background: #f8fafc !important;
}

.home-stock-movement {
    min-width: 180px !important;
    max-width: 360px !important;
    white-space: normal !important;
    font-weight: 700 !important;
}

.home-stock-actions {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    text-align: center !important;
}

.home-stock-action-btn {
    display: block !important;
    width: 82px !important;
    max-width: 82px !important;
    height: 22px !important;
    min-height: 22px !important;
    margin: 2px auto !important;
    padding: 2px 4px !important;
    font-size: 9px !important;
    line-height: 1 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.home-stock-empty-row {
    text-align: center !important;
    padding: 16px !important;
    color: #64748b !important;
    font-weight: 800 !important;
}

/* ===== End home stock hard lock final ===== */

/* ===== QR LABELS SELECT ALIGN FIX ===== */

/* Выпадающие списки в разделе QR-этикетки */
[data-page="labels"] select,
#labelsPage select,
.qr-labels-card select,
.labels-card select {
    min-width: 260px !important;
    width: auto !important;
    max-width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 8px 34px 8px 12px !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    text-align-last: center !important;
    white-space: normal !important;
}

/* Конкретно блок "Печать всего склада" */
[data-page="labels"] label,
[data-page="labels"] .bulk-label-source,
[data-page="labels"] .qr-source-select-wrap {
    max-width: 100% !important;
}

/* Если select стоит в строке с кнопками - не даём ему сжиматься */
[data-page="labels"] .row select,
[data-page="labels"] .action-buttons select,
[data-page="labels"] .grid select {
    flex: 0 0 auto !important;
}

/* ===== END QR LABELS SELECT ALIGN FIX ===== */




/* ===== QR labels product search and QR preview final ===== */

.labels-product-search-wrapper {
    margin-top: 4px !important;
    margin-bottom: 10px !important;
}

.labels-qr-preview-fix-box {
    margin: 12px 0 !important;
    padding: 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    text-align: center !important;
}

.labels-qr-preview-title {
    margin-bottom: 8px !important;
    font-weight: 900 !important;
    color: #334155 !important;
}

.labels-qr-preview-img {
    width: 150px !important;
    height: 150px !important;
    object-fit: contain !important;
    background: #ffffff !important;
    padding: 8px !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
}

.labels-qr-preview-value {
    margin-top: 7px !important;
    font-weight: 800 !important;
    color: #334155 !important;
}

.labels-qr-preview-placeholder {
    color: #64748b !important;
    font-weight: 800 !important;
}

/* ===== End QR labels product search and QR preview final ===== */



/* ===== HIDE LABEL PREVIEWS FINAL ===== */

.labels-preview-hidden-force {
    display: none !important;
}

/* ===== END HIDE LABEL PREVIEWS FINAL ===== */



/* ===== QR LABELS STABLE PRODUCT SEARCH FINAL ===== */

[data-page="labels"] #labelsQrPreviewFixBox,
[data-page="labels"] .labels-qr-preview-fix-box,
[data-page="labels"] .labels-preview-hidden-force {
    display: none !important;
}

.labels-product-search-wrapper {
    margin-top: 4px !important;
    margin-bottom: 10px !important;
}

/* ===== END QR LABELS STABLE PRODUCT SEARCH FINAL ===== */



/* ===== QR LABELS STABLE PRODUCT SEARCH FINAL ===== */

[data-page="labels"] #labelsQrPreviewFixBox,
[data-page="labels"] .labels-qr-preview-fix-box,
[data-page="labels"] .labels-preview-hidden-force {
    display: none !important;
}

.labels-product-search-wrapper {
    margin-top: 4px !important;
    margin-bottom: 10px !important;
}

/* ===== END QR LABELS STABLE PRODUCT SEARCH FINAL ===== */



/* ===== Label product select exact fix final ===== */

.labels-product-search-wrapper {
    margin-top: 4px !important;
    margin-bottom: 10px !important;
}

[data-page="labels"] #labelsQrPreviewFixBox,
[data-page="labels"] .labels-qr-preview-fix-box,
[data-page="labels"] .labels-preview-hidden-force {
    display: none !important;
}

/* ===== End label product select exact fix final ===== */
/* ===== ONEC HIDE NO DATA ROWS FILTER FINAL ===== */

.onec-hide-no-data-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 10px 0 12px 0 !important;
    padding: 9px 12px !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    user-select: none !important;
}

.onec-hide-no-data-toggle input {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
}

.onec-hide-no-data-counter {
    margin: 0 0 10px 0 !important;
    color: #64748b !important;
    font-weight: 700 !important;
    font-size: 13px !important;
}

.onec-no-data-hidden-row {
    display: none !important;
}

/* ===== END ONEC HIDE NO DATA ROWS FILTER FINAL ===== */



/* ===== PRETTY HEADER FINAL ===== */

.pretty-app-header {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    gap: 18px !important;
    padding: 18px 28px !important;
    margin: 0 !important;
    background:
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.22), transparent 30%),
        linear-gradient(135deg, #0f172a 0%, #111827 45%, #020617 100%) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22) !important;
}

.header-user-card,
.header-brand-card,
.header-logout-card {
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18) !important;
}

.header-user-card {
    justify-self: start !important;
    min-width: 210px !important;
    padding: 12px 16px !important;
    color: #e5e7eb !important;
    text-align: center !important;
}

.header-user-label {
    font-size: 11px !important;
    line-height: 1.1 !important;
    color: #93c5fd !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    font-weight: 900 !important;
    margin-bottom: 4px !important;
}

.header-user-name {
    font-size: 17px !important;
    line-height: 1.15 !important;
    color: #ffffff !important;
    font-weight: 950 !important;
}

.header-user-role {
    display: inline-flex !important;
    margin-top: 6px !important;
    padding: 3px 8px !important;
    border-radius: 999px !important;
    background: rgba(37, 99, 235, 0.28) !important;
    color: #bfdbfe !important;
    font-size: 12px !important;
    font-weight: 900 !important;
}

.header-brand-card {
    justify-self: center !important;
    min-width: 260px !important;
    text-align: center !important;
    padding: 11px 28px 13px !important;
    color: #ffffff !important;
}

.header-brand-card h1 {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 32px !important;
    line-height: 1 !important;
    letter-spacing: -0.04em !important;
    color: #ffffff !important;
    text-shadow: 0 8px 20px rgba(59, 130, 246, 0.32) !important;
}

.header-brand-kicker {
    margin-bottom: 4px !important;
    color: #93c5fd !important;
    font-size: 11px !important;
    font-weight: 950 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.16em !important;
}

.header-logout-card {
    justify-self: end !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 92px !important;
    min-height: 42px !important;
    padding: 10px 16px !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 950 !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.header-logout-card:hover {
    transform: translateY(-1px) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18) !important;
}

/* Чуть аккуратнее навигация под новым верхом */
.top-nav {
    margin-top: 0 !important;
    padding-top: 18px !important;
}

/* ===== END PRETTY HEADER FINAL ===== */

/* ===== COMPACT PRETTY HEADER FINAL ===== */

.pretty-app-header {
    padding: 7px 22px !important;
    gap: 12px !important;
    min-height: 48px !important;
}

.header-user-card,
.header-brand-card,
.header-logout-card {
    border-radius: 12px !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14) !important;
}

.header-user-card {
    min-width: 170px !important;
    padding: 6px 10px !important;
}

.header-user-label {
    font-size: 9px !important;
    margin-bottom: 2px !important;
    letter-spacing: 0.06em !important;
}

.header-user-name {
    font-size: 13px !important;
    line-height: 1.05 !important;
}

.header-user-role {
    margin-top: 3px !important;
    padding: 2px 6px !important;
    font-size: 10px !important;
}

.header-brand-card {
    min-width: 210px !important;
    padding: 6px 20px 7px !important;
}

.header-brand-kicker {
    margin-bottom: 2px !important;
    font-size: 9px !important;
    letter-spacing: 0.12em !important;
}

.header-brand-card h1 {
    font-size: 22px !important;
    line-height: 0.95 !important;
}

.header-logout-card {
    min-width: 74px !important;
    min-height: 30px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 12px !important;
}

.top-nav {
    padding-top: 10px !important;
}

/* ===== END COMPACT PRETTY HEADER FINAL ===== */


/* ===== CENTER TOP NAV WITHOUT LABEL FINAL ===== */

.top-nav > label {
    display: none !important;
}

.top-nav {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.top-nav .nav-buttons {
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

/* ===== END CENTER TOP NAV WITHOUT LABEL FINAL ===== */




/* ===== DARK THEME TOGGLE FINAL ===== */

/* Правая часть шапки: тема + выход */
.header-actions-card {
    justify-self: end !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.theme-toggle-button {
    width: 54px !important;
    min-width: 54px !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 3px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    transition: 0.18s ease !important;
}

.theme-toggle-button span {
    width: 22px !important;
    height: 22px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    line-height: 1 !important;
    opacity: 0.55 !important;
    transition: 0.18s ease !important;
}

.theme-toggle-button .theme-toggle-sun {
    background: rgba(255, 255, 255, 0.18) !important;
    opacity: 1 !important;
}

.theme-toggle-button.theme-toggle-active .theme-toggle-sun {
    background: transparent !important;
    opacity: 0.45 !important;
}

.theme-toggle-button.theme-toggle-active .theme-toggle-moon {
    background: rgba(96, 165, 250, 0.28) !important;
    opacity: 1 !important;
}

.theme-toggle-button:hover {
    background: rgba(255, 255, 255, 0.13) !important;
    transform: translateY(-1px) !important;
}

/* Общая тёмная тема */
body.dark-theme {
    background:
        radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.16), transparent 28%),
        radial-gradient(circle at 90% 12%, rgba(14, 165, 233, 0.10), transparent 26%),
        linear-gradient(135deg, #07111f 0%, #0b1220 45%, #050814 100%) !important;
    color: #dbeafe !important;
}

/* Верх оставляем в том же стиле, но чуть глубже */
body.dark-theme .pretty-app-header {
    background:
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.16), transparent 30%),
        linear-gradient(135deg, #050b16 0%, #08111f 48%, #020617 100%) !important;
    border-bottom-color: rgba(96, 165, 250, 0.16) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34) !important;
}

body.dark-theme .header-user-card,
body.dark-theme .header-brand-card,
body.dark-theme .header-logout-card,
body.dark-theme .theme-toggle-button {
    background: rgba(15, 23, 42, 0.66) !important;
    border-color: rgba(96, 165, 250, 0.16) !important;
}

/* Основные карточки */
body.dark-theme .card,
body.dark-theme section.card,
body.dark-theme .form-block,
body.dark-theme .selected-product-info,
body.dark-theme .home-stock-hard-status,
body.dark-theme .movements-hard-status,
body.dark-theme .clean-movements-status,
body.dark-theme .onec-hide-no-data-toggle,
body.dark-theme .movement-product-search-status,
body.dark-theme .home-stock-settle-status {
    background: rgba(15, 23, 42, 0.78) !important;
    border-color: rgba(96, 165, 250, 0.14) !important;
    color: #dbeafe !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24) !important;
}

/* Навигация */
body.dark-theme .top-nav {
    background: transparent !important;
}

body.dark-theme .top-nav button,
body.dark-theme .small-btn,
body.dark-theme button.secondary-btn,
body.dark-theme .link-button {
    background: rgba(15, 23, 42, 0.82) !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
    color: #dbeafe !important;
}

body.dark-theme .top-nav button:hover,
body.dark-theme .small-btn:hover,
body.dark-theme button:hover,
body.dark-theme .link-button:hover {
    background: rgba(30, 64, 175, 0.42) !important;
    color: #ffffff !important;
}

/* Обычные кнопки оставляем читаемыми */
body.dark-theme button {
    border-color: rgba(96, 165, 250, 0.20) !important;
}

/* Поля ввода и select */
body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
    background: rgba(2, 6, 23, 0.70) !important;
    border-color: rgba(96, 165, 250, 0.20) !important;
    color: #e5efff !important;
}

body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: #64748b !important;
}

body.dark-theme option {
    background: #0f172a !important;
    color: #e5efff !important;
}

/* Таблицы */
body.dark-theme table,
body.dark-theme .home-stock-hard-table,
body.dark-theme .movements-hard-table,
body.dark-theme .clean-movements-table {
    background: rgba(15, 23, 42, 0.62) !important;
    color: #dbeafe !important;
}

body.dark-theme th,
body.dark-theme .home-stock-hard-table th,
body.dark-theme .movements-hard-table th,
body.dark-theme .clean-movements-table th {
    background: rgba(30, 41, 59, 0.92) !important;
    color: #bfdbfe !important;
    border-color: rgba(96, 165, 250, 0.14) !important;
}

body.dark-theme td,
body.dark-theme .home-stock-hard-table td,
body.dark-theme .movements-hard-table td,
body.dark-theme .clean-movements-table td {
    border-color: rgba(96, 165, 250, 0.10) !important;
}

body.dark-theme tr:hover td {
    background: rgba(30, 64, 175, 0.16) !important;
}

/* Служебные плашки */
body.dark-theme .stock-ok {
    color: #86efac !important;
}

body.dark-theme .stock-low,
body.dark-theme .danger-btn {
    color: #fecaca !important;
}

body.dark-theme .stock-zero,
body.dark-theme .stock-empty,
body.dark-theme .history-missing-real-session-cell {
    background: rgba(15, 23, 42, 0.68) !important;
    color: #94a3b8 !important;
}

/* Текстовые мелочи */
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme label,
body.dark-theme small {
    color: #dbeafe !important;
}

body.dark-theme a {
    color: #93c5fd !important;
}

/* ===== END DARK THEME TOGGLE FINAL ===== */

/* ===== FIX THEME TOGGLE VERTICAL ALIGN FINAL ===== */

.header-actions-card {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    height: 30px !important;
    line-height: 1 !important;
}

.theme-toggle-button,
.header-actions-card .header-logout-card {
    align-self: center !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    transform: none !important;
}

.theme-toggle-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    vertical-align: middle !important;
    position: relative !important;
    top: 0 !important;
}

.header-actions-card .header-logout-card {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 30px !important;
    min-height: 30px !important;
    line-height: 1 !important;
}

.theme-toggle-button:hover,
.header-actions-card .header-logout-card:hover {
    transform: translateY(-1px) !important;
}

/* ===== END FIX THEME TOGGLE VERTICAL ALIGN FINAL ===== */




/* ===== STRICT HISTORY REAL INVENTORY SESSIONS NO CACHE FINAL ===== */

.history-missing-real-session-cell {
    background: #f8fafc !important;
    color: #94a3b8 !important;
}

/* ===== END STRICT HISTORY REAL INVENTORY SESSIONS NO CACHE FINAL ===== */



/* ===== BARCODE PRODUCT MANUAL SEARCH FINAL ===== */

.barcode-product-search-wrapper {
    margin-top: 4px !important;
    margin-bottom: 10px !important;
}

/* ===== END BARCODE PRODUCT MANUAL SEARCH FINAL ===== */



/* ===== EDIT SAVED INVENTORY SESSION FINAL ===== */

.inventory-edit-card {
    margin-top: 12px !important;
    padding: 14px !important;
    border-radius: 14px !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
}

.inventory-edit-inline-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
}

.inventory-edit-meta {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 8px !important;
    margin: 8px 0 12px 0 !important;
}

.inventory-edit-warning {
    margin: 10px 0 !important;
    font-weight: 900 !important;
}

.inventory-edit-live-notice {
    margin: 8px 0 !important;
    padding: 7px 10px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    background: rgba(248, 250, 252, 0.92) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

.inventory-edit-add-box {
    margin: 12px 0 !important;
    padding: 12px !important;
    border-radius: 12px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
}

.inventory-edit-add-row {
    margin-top: 8px !important;
}

.inventory-edit-add-row input:first-child {
    min-width: 280px !important;
}

.inventory-edit-add-row input[type="number"] {
    max-width: 120px !important;
}

.inventory-edit-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
}

.inventory-edit-actions .small-btn {
    padding: 5px 8px !important;
    font-size: 12px !important;
}

.inventory-edit-bottom-actions {
    margin-top: 12px !important;
}

body.dark-theme .inventory-edit-card,
body.dark-theme .inventory-edit-add-box {
    background: rgba(15, 23, 42, 0.78) !important;
    border-color: rgba(96, 165, 250, 0.14) !important;
    color: #dbeafe !important;
}

/* ===== END EDIT SAVED INVENTORY SESSION FINAL ===== */



/* ===== MOVEMENTS SINGLE CLEAN RENDER FINAL ===== */

.movements-single-render-wrap {
    width: 100% !important;
    overflow-x: auto !important;
}

.movements-single-render-table {
    width: 100% !important;
}

.movements-single-render-table th,
.movements-single-render-table td {
    vertical-align: middle !important;
}

.movements-single-action-cell {
    text-align: center !important;
    white-space: nowrap !important;
}

.movements-single-edit-btn {
    padding: 5px 8px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
}

/* ===== END MOVEMENTS SINGLE CLEAN RENDER FINAL ===== */



/* ===== MOVEMENTS SORT ID ONLY FINAL ===== */

.movements-single-render-wrap {
    width: 100% !important;
    overflow-x: auto !important;
}

.movements-single-render-table {
    width: 100% !important;
}

.movements-single-render-table th,
.movements-single-render-table td {
    vertical-align: middle !important;
}

.movements-single-render-table th:first-child,
.movements-single-render-table td:first-child {
    width: 58px !important;
    text-align: center !important;
    color: #64748b !important;
    font-weight: 800 !important;
}

.movements-single-action-cell {
    text-align: center !important;
    white-space: nowrap !important;
}

.movements-single-edit-btn {
    padding: 5px 8px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
}

/* ===== END MOVEMENTS SORT ID ONLY FINAL ===== */



/* ===== MOVEMENTS DATE SORT FINAL ===== */

.movements-single-render-wrap {
    width: 100% !important;
    overflow-x: auto !important;
}

.movements-single-render-table {
    width: 100% !important;
}

.movements-single-render-table th,
.movements-single-render-table td {
    vertical-align: middle !important;
}

.movements-single-action-cell {
    text-align: center !important;
    white-space: nowrap !important;
}

.movements-single-edit-btn {
    padding: 5px 8px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
}

/* ===== END MOVEMENTS DATE SORT FINAL ===== */


/* ===== MONTH HISTORY EMPTY CELLS NO COLOR FINAL ===== */

/* Пустые ячейки месячной истории не должны выглядеть как заполненные */
.history-month-table td.history-cell.history-empty-value,
.history-month-table td.history-cell.history-empty-value.history-morning-cell,
.history-month-table td.history-cell.history-empty-value.history-evening-cell {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* На всякий случай гасим фон у внутренностей пустой ячейки */
.history-month-table td.history-cell.history-empty-value .history-qty {
    visibility: hidden !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* Если в пустой ячейке нет движения - она полностью визуально пустая */
.history-month-table td.history-cell.history-empty-value:not([title]) {
    color: transparent !important;
}

/* Если есть движение, например -1 Ремонт, текст движения оставляем видимым */
.history-month-table td.history-cell.history-empty-value .history-movement-text {
    visibility: visible !important;
    color: inherit !important;
}

/* В тёмной теме тоже без зелёной/цветной заливки */
.dark-theme .history-month-table td.history-cell.history-empty-value,
.dark-theme .history-month-table td.history-cell.history-empty-value.history-morning-cell,
.dark-theme .history-month-table td.history-cell.history-empty-value.history-evening-cell {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* ===== END MONTH HISTORY EMPTY CELLS NO COLOR FINAL ===== */


/* ===== LIVE INVENTORY SCAN ROW COLORS FINAL ===== */

#inventoryScanTable table tbody tr.inventory-scan-row-diff-live > td {
    background: rgba(239, 68, 68, 0.16) !important;
}

#inventoryScanTable table tbody tr.inventory-scan-row-diff-live:hover > td {
    background: rgba(239, 68, 68, 0.23) !important;
}

#inventoryScanTable table tbody tr.inventory-scan-row-ok-live > td {
    background: rgba(34, 197, 94, 0.15) !important;
}

#inventoryScanTable table tbody tr.inventory-scan-row-ok-live:hover > td {
    background: rgba(34, 197, 94, 0.22) !important;
}

.dark-theme #inventoryScanTable table tbody tr.inventory-scan-row-diff-live > td,
body.dark-theme #inventoryScanTable table tbody tr.inventory-scan-row-diff-live > td {
    background: rgba(248, 113, 113, 0.18) !important;
}

.dark-theme #inventoryScanTable table tbody tr.inventory-scan-row-ok-live > td,
body.dark-theme #inventoryScanTable table tbody tr.inventory-scan-row-ok-live > td {
    background: rgba(74, 222, 128, 0.16) !important;
}

/* ===== END LIVE INVENTORY SCAN ROW COLORS FINAL ===== */


/* ===== INVENTORY AUTOFILL POSITIVE STOCK FINAL ===== */

.inventory-autofill-stock-btn {
    background: rgba(15, 23, 42, 0.08) !important;
    color: #0f172a !important;
    border: 1px solid rgba(15, 23, 42, 0.18) !important;
}

.inventory-autofill-stock-btn:hover {
    background: rgba(15, 23, 42, 0.13) !important;
}

.dark-theme .inventory-autofill-stock-btn,
body.dark-theme .inventory-autofill-stock-btn {
    background: rgba(255, 255, 255, 0.10) !important;
    color: #e5e7eb !important;
    border-color: rgba(255, 255, 255, 0.20) !important;
}

.dark-theme .inventory-autofill-stock-btn:hover,
body.dark-theme .inventory-autofill-stock-btn:hover {
    background: rgba(255, 255, 255, 0.16) !important;
}

/* ===== END INVENTORY AUTOFILL POSITIVE STOCK FINAL ===== */


/* ===== INVENTORY HISTORY UX FINAL PACK ===== */

.inventory-live-status {
    margin: 10px 0 12px 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
    border: 1px solid #d1d5db;
}

.inventory-live-status-empty {
    background: #f9fafb;
    color: #374151;
}

.inventory-live-status-ok {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.inventory-live-status-diff {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.inventory-live-row-ok td {
    background: #dcfce7 !important;
}

.inventory-live-row-diff td {
    background: #fee2e2 !important;
}

.inventory-log-actions-final {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inventory-editor-close-actions-final {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.history-empty-cell-final {
    background: #ffffff !important;
    color: #111827;
}

.history-empty-cell-final .history-qty {
    color: transparent !important;
}

.history-empty-cell-final .history-movement-text {
    color: #111827 !important;
}

#historyPrintButtonFinal {
    white-space: nowrap;
}

/* ===== END INVENTORY HISTORY UX FINAL PACK ===== */


/* ===== INVENTORY EDITOR TOP BUTTONS FINAL ===== */

.inventory-editor-top-actions-final {
    position: sticky;
    top: 8px;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 14px 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
}

.inventory-editor-top-actions-title {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

.inventory-editor-top-actions-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inventory-editor-top-actions-buttons button {
    margin: 0 !important;
}

.dark-theme .inventory-editor-top-actions-final,
html.dark-theme .inventory-editor-top-actions-final,
body.dark-theme .inventory-editor-top-actions-final {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.dark-theme .inventory-editor-top-actions-title,
html.dark-theme .inventory-editor-top-actions-title,
body.dark-theme .inventory-editor-top-actions-title {
    color: #e5e7eb;
}

/* ===== END INVENTORY EDITOR TOP BUTTONS FINAL ===== */


/* ===== INVENTORY ACTION BUTTON COLORS FINAL ===== */

.inventory-action-blue-final {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.inventory-action-blue-final:hover {
    background: #1d4ed8 !important;
}

.inventory-action-red-final {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.inventory-action-red-final:hover {
    background: #b91c1c !important;
}

.inventory-action-yellow-final {
    background: #facc15 !important;
    border-color: #eab308 !important;
    color: #1f2937 !important;
}

.inventory-action-yellow-final:hover {
    background: #eab308 !important;
}

/* ===== END INVENTORY ACTION BUTTON COLORS FINAL ===== */


/* ===== INVENTORY EDITOR BUTTON COLORS FINAL ===== */

.inventory-editor-save-green-final {
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #ffffff !important;
}

.inventory-editor-save-green-final:hover {
    background: #15803d !important;
}

.inventory-editor-close-blue-final {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.inventory-editor-close-blue-final:hover {
    background: #1d4ed8 !important;
}

.inventory-editor-refresh-yellow-final {
    background: #facc15 !important;
    border-color: #eab308 !important;
    color: #1f2937 !important;
}

.inventory-editor-refresh-yellow-final:hover {
    background: #eab308 !important;
}

.inventory-editor-delete-red-final {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.inventory-editor-delete-red-final:hover {
    background: #b91c1c !important;
}

/* ===== END INVENTORY EDITOR BUTTON COLORS FINAL ===== */


/* ===== OUTGOING REPAIR ENGINEER HIDE AND HISTORY NUMBER FINAL ===== */

.outgoing-repair-engineer-hidden-final {
    display: none !important;
}

/* ===== END OUTGOING REPAIR ENGINEER HIDE AND HISTORY NUMBER FINAL ===== */


/* ===== STABLE HISTORY SINGLE CENTER FINAL ===== */
.history-table-wrap {
    scroll-behavior: auto !important;
}
/* ===== END STABLE HISTORY SINGLE CENTER FINAL ===== */

/* ===== STABLE HISTORY SINGLE CENTER FINAL ===== */
.history-table-wrap {
    scroll-behavior: auto !important;
}
/* ===== END STABLE HISTORY SINGLE CENTER FINAL ===== */

/* ===== HARD HISTORY NO SMOOTH SCROLL FINAL ===== */
#historyTable .history-table-wrap {
    scroll-behavior: auto !important;
}
/* ===== END HARD HISTORY NO SMOOTH SCROLL FINAL ===== */

/* ===== HISTORY BUTTON COLORS FINAL ===== */

/* Обновить историю - зелёная */
section[data-page="history"] .history-controls button[onclick*="loadHistoryMonth"] {
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #ffffff !important;
}

section[data-page="history"] .history-controls button[onclick*="loadHistoryMonth"]:hover {
    background: #15803d !important;
}

/* Печать месяца - синяя */
section[data-page="history"] #historyPrintButton,
section[data-page="history"] .history-controls button[onclick*="printHistoryMonth"]:not(#historyPrintButtonFinal) {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

section[data-page="history"] #historyPrintButton:hover,
section[data-page="history"] .history-controls button[onclick*="printHistoryMonth"]:not(#historyPrintButtonFinal):hover {
    background: #1d4ed8 !important;
}

/* Печать таблицы - скрываем полностью */
section[data-page="history"] #historyPrintButtonFinal {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ===== END HISTORY BUTTON COLORS FINAL ===== */

/* ===== HISTORY CONTROLS ALIGN FINAL ===== */

section[data-page="history"] .history-controls {
    align-items: flex-end !important;
}

section[data-page="history"] .history-controls label {
    margin: 0 !important;
}

section[data-page="history"] .history-controls input {
    height: 38px !important;
    box-sizing: border-box !important;
}

section[data-page="history"] .history-controls button {
    align-self: flex-end !important;
    height: 38px !important;
    min-height: 38px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* На всякий случай скрытая кнопка печати таблицы не должна занимать место */
section[data-page="history"] #historyPrintButtonFinal {
    display: none !important;
}

/* ===== END HISTORY CONTROLS ALIGN FINAL ===== */








/* ===== TARGETED BLOCK BUTTON COLORS SAFE V2 ===== */

.ds-target-blue {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.ds-target-blue:hover {
    background: #1d4ed8 !important;
}

.ds-target-green {
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #ffffff !important;
}

.ds-target-green:hover {
    background: #15803d !important;
}

.ds-target-yellow {
    background: #facc15 !important;
    border-color: #eab308 !important;
    color: #1f2937 !important;
}

.ds-target-yellow:hover {
    background: #eab308 !important;
}

.ds-target-red {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.ds-target-red:hover {
    background: #b91c1c !important;
}

/* Центровка кнопок на главной без изменения размеров */
[data-page="home"] .top-stock-stats-date-picker,
[data-page="home"] #topStockStatsDatePicker,
[data-page="home"] #stockHistoryDateControls,
[data-page="home"] .stock-history-date-controls {
    display: flex !important;
    align-items: flex-end !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}

[data-page="home"] .top-stock-stats-date-picker button,
[data-page="home"] #topStockStatsDatePicker button,
[data-page="home"] #stockHistoryDateControls button,
[data-page="home"] .stock-history-date-controls button {
    align-self: flex-end !important;
    margin-bottom: 0 !important;
}

[data-page="home"] .action-buttons {
    align-items: center !important;
}

/* ===== END TARGETED BLOCK BUTTON COLORS SAFE V2 ===== */

/* ===== TARGETED BLOCK BUTTON COLORS SAFE V2 ===== */

.ds-target-blue {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.ds-target-blue:hover {
    background: #1d4ed8 !important;
}

.ds-target-green {
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #ffffff !important;
}

.ds-target-green:hover {
    background: #15803d !important;
}

.ds-target-yellow {
    background: #facc15 !important;
    border-color: #eab308 !important;
    color: #1f2937 !important;
}

.ds-target-yellow:hover {
    background: #eab308 !important;
}

.ds-target-red {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.ds-target-red:hover {
    background: #b91c1c !important;
}

/* Центровка кнопок на главной без изменения размеров */
[data-page="home"] .top-stock-stats-date-picker,
[data-page="home"] #topStockStatsDatePicker,
[data-page="home"] #stockHistoryDateControls,
[data-page="home"] .stock-history-date-controls {
    display: flex !important;
    align-items: flex-end !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}

[data-page="home"] .top-stock-stats-date-picker button,
[data-page="home"] #topStockStatsDatePicker button,
[data-page="home"] #stockHistoryDateControls button,
[data-page="home"] .stock-history-date-controls button {
    align-self: flex-end !important;
    margin-bottom: 0 !important;
}

[data-page="home"] .action-buttons {
    align-items: center !important;
}

/* ===== END TARGETED BLOCK BUTTON COLORS SAFE V2 ===== */

/* ===== HOME BUTTON ALIGN FIX NO HEREDOC ===== */

[data-page="home"] .top-stock-stats-date-picker,
[data-page="home"] #topStockStatsDatePicker,
[data-page="home"] #stockHistoryDateControls,
[data-page="home"] .stock-history-date-controls {
    display: flex !important;
    align-items: flex-end !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}

[data-page="home"] .top-stock-stats-date-picker label,
[data-page="home"] #topStockStatsDatePicker label,
[data-page="home"] #stockHistoryDateControls label,
[data-page="home"] .stock-history-date-controls label {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    margin: 0 !important;
    gap: 5px !important;
}

[data-page="home"] .top-stock-stats-date-picker input,
[data-page="home"] #topStockStatsDatePicker input,
[data-page="home"] #stockHistoryDateControls input,
[data-page="home"] .stock-history-date-controls input,
[data-page="home"] .top-stock-stats-date-picker button,
[data-page="home"] #topStockStatsDatePicker button,
[data-page="home"] #stockHistoryDateControls button,
[data-page="home"] .stock-history-date-controls button {
    height: 38px !important;
    min-height: 38px !important;
    box-sizing: border-box !important;
}

[data-page="home"] .top-stock-stats-date-picker button,
[data-page="home"] #topStockStatsDatePicker button,
[data-page="home"] #stockHistoryDateControls button,
[data-page="home"] .stock-history-date-controls button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: flex-end !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    position: relative !important;
    top: 0 !important;
    transform: none !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

[data-page="home"] .home-stock-action-cell,
[data-page="home"] td:has(.home-stock-action-btn),
[data-page="home"] td:has([data-stock-action]) {
    text-align: center !important;
    vertical-align: middle !important;
}

[data-page="home"] .home-stock-actions,
[data-page="home"] .action-buttons,
[data-page="home"] td:has(.home-stock-action-btn) > div,
[data-page="home"] td:has([data-stock-action]) > div {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
}

[data-page="home"] .home-stock-action-btn,
[data-page="home"] [data-stock-action] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-self: center !important;
    vertical-align: middle !important;
}

/*===== END HOME BUTTON ALIGN FIX NO HEREDOC ===== */

/* ===== HOME STABLE QUICK SEARCH HISTORY NO JUMP FINAL ===== */
#homeStableTopFinal {
    display: block !important;
    width: 100% !important;
}

#homeStableTopFinal > .card,
#homeStableTopFinal > section {
    width: 100% !important;
}

.ds-home-quick-search-stable-final {
    margin-top: 0 !important;
}

.home-history-copy-card {
    margin-top: 16px !important;
}

[data-page="home"] .ds-home-hidden-stock-now-final,
[data-page="home"] .ds-home-hidden-scanner-action-final {
    display: none !important;
}

.home-history-copy-card .history-controls {
    align-items: flex-end !important;
}

#homeHistoryCopyRefreshButton {
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #ffffff !important;
    white-space: nowrap !important;
}

#homeHistoryCopyRefreshButton:hover {
    background: #15803d !important;
}

#homeHistoryCopyPrintButton {
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
}

#homeHistoryCopyPrintButton:hover {
    background: #1d4ed8 !important;
}

.home-history-copy-wrap {
    max-height: 70vh !important;
    scroll-behavior: auto !important;
}

.home-history-copy-table {
    font-size: 12px !important;
}
/* ===== END HOME STABLE QUICK SEARCH HISTORY NO JUMP FINAL ===== */

/* ===== HOME HISTORY BUTTONS ALIGN FIX FINAL ===== */

#homeHistoryCopyFromHistoryFinal .history-controls {
    display: flex !important;
    align-items: flex-end !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}

#homeHistoryCopyFromHistoryFinal .history-controls label {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    gap: 5px !important;
    margin: 0 !important;
}

#homeHistoryCopyFromHistoryFinal .history-controls input,
#homeHistoryCopyFromHistoryFinal .history-controls button {
    height: 38px !important;
    min-height: 38px !important;
    box-sizing: border-box !important;
}

#homeHistoryCopyFromHistoryFinal #homeHistoryCopyRefreshButton,
#homeHistoryCopyFromHistoryFinal #homeHistoryCopyPrintButton {
    align-self: flex-end !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 14px !important;
    line-height: 1 !important;
    position: relative !important;
    top: 0 !important;
    transform: none !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

/* ===== END HOME HISTORY BUTTONS ALIGN FIX FINAL ===== */

/* ===== EXTRA MENU PAGE FINAL ===== */

.extra-menu-page-card {
    max-width: 1100px !important;
}

.extra-menu-subtitle {
    margin-top: 4px !important;
    margin-bottom: 18px !important;
    color: #64748b !important;
    font-weight: 600 !important;
}

.extra-menu-grid-final {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
    gap: 14px !important;
}

.extra-menu-tile-final {
    min-height: 110px !important;
    padding: 16px 18px !important;
    border-radius: 16px !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    background: #ffffff !important;
    color: #0f172a !important;
    text-align: left !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 7px !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06) !important;
    cursor: pointer !important;
}

.extra-menu-tile-final:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.10) !important;
}

.extra-menu-tile-final span {
    font-size: 17px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
}

.extra-menu-tile-final small {
    font-size: 13px !important;
    line-height: 1.35 !important;
    color: #64748b !important;
    font-weight: 600 !important;
}

body.dark-theme .extra-menu-tile-final,
.dark-theme .extra-menu-tile-final {
    background: rgba(15, 23, 42, 0.78) !important;
    color: #e5e7eb !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
}

body.dark-theme .extra-menu-tile-final small,
.dark-theme .extra-menu-tile-final small,
body.dark-theme .extra-menu-subtitle,
.dark-theme .extra-menu-subtitle {
    color: #94a3b8 !important;
}

/* ===== END EXTRA MENU PAGE FINAL ===== */








/* ===== SETTINGS NATIVE RESTORE VISUAL FIX FINAL ===== */

/* Кнопка назад внутри главной страницы настроек */
section[data-page="settings"] #settingsHomePage #settingsBackExtraButtonFinal {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 14px !important;
    margin: 0 0 18px 0 !important;
    border-radius: 10px !important;
    border: 1px solid #1d4ed8 !important;
    background: #2563eb !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
}

section[data-page="settings"] #settingsHomePage #settingsBackExtraButtonFinal:hover {
    background: #1d4ed8 !important;
}

/* Карточки настроек ровные, кнопки прижаты вниз */
section[data-page="settings"] .settings-tiles-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
}

section[data-page="settings"] .settings-tiles-grid > .settings-card {
    min-height: 210px !important;
    height: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

section[data-page="settings"] .settings-tiles-grid > .settings-card h3 {
    margin-top: 0 !important;
}

section[data-page="settings"] .settings-tiles-grid > .settings-card p {
    flex: 1 1 auto !important;
    margin-bottom: 16px !important;
}

section[data-page="settings"] .settings-tiles-grid > .settings-card button {
    margin-top: auto !important;
    align-self: flex-start !important;
}

/* ===== END SETTINGS NATIVE RESTORE VISUAL FIX FINAL ===== */

/* ===== EXTRA MENU TILES ONLY CLEAN FIX FINAL ===== */

/* Скрываем кнопку "На главную" в Дополнительно */
section[data-page="extra"] #extraMenuBackHomeButtonFinal {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* Сетка плиток одинаковой высоты */
section[data-page="extra"] .extra-menu-grid-final {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
}

/* Каждая плитка строго одного размера */
section[data-page="extra"] .extra-menu-grid-final > .extra-menu-tile-final {
    width: 100% !important;
    height: 150px !important;
    min-height: 150px !important;
    max-height: 150px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 16px 18px !important;

    display: grid !important;
    grid-template-rows: 34px 1fr !important;
    align-items: start !important;
    justify-items: start !important;
    gap: 8px !important;

    text-align: left !important;
    white-space: normal !important;
    overflow: hidden !important;
}

/* Названия плиток начинаются на одной высоте */
section[data-page="extra"] .extra-menu-grid-final > .extra-menu-tile-final span {
    display: block !important;
    width: 100% !important;
    min-height: 34px !important;
    max-height: 34px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
}

/* Описания тоже начинаются одинаково */
section[data-page="extra"] .extra-menu-grid-final > .extra-menu-tile-final small {
    display: block !important;
    width: 100% !important;
    line-height: 1.25 !important;
    overflow: hidden !important;
    white-space: normal !important;
}

/* ===== END EXTRA MENU TILES ONLY CLEAN FIX FINAL ===== */


/* ===== CLICKABLE HEADER LOGO FINAL ===== */

.header-brand-home-link-final {
    cursor: pointer !important;
    user-select: none !important;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease !important;
}

.header-brand-home-link-final:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12) !important;
}

.header-brand-home-link-final:active {
    transform: translateY(0) !important;
    opacity: 0.9 !important;
}

.header-brand-home-link-final:focus-visible {
    outline: 2px solid #2563eb !important;
    outline-offset: 3px !important;
}

/* ===== END CLICKABLE HEADER LOGO FINAL ===== */

/* ===== INVENTORY QUICK MOVEMENT FROM DIFF FINAL ===== */

.inventory-quick-movement-button-final {
    background: #7c3aed !important;
    border-color: #6d28d9 !important;
    color: #ffffff !important;
    margin-left: 6px !important;
    white-space: nowrap !important;
}

.inventory-quick-movement-button-final:hover {
    background: #6d28d9 !important;
}

.inventory-quick-movement-button-disabled-final,
.inventory-quick-movement-button-disabled-final:hover {
    background: #9ca3af !important;
    border-color: #9ca3af !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.inventory-quick-movement-menu-final {
    position: fixed !important;
    z-index: 999999 !important;
    min-width: 260px !important;
    max-width: 360px !important;
    padding: 12px !important;
    border: 1px solid rgba(148, 163, 184, 0.6) !important;
    border-radius: 14px !important;
    background: var(--card-bg, #ffffff) !important;
    color: var(--text-color, #111827) !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28) !important;
}

.inventory-quick-movement-menu-title-final {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-bottom: 6px !important;
}

.inventory-quick-movement-menu-title-final span {
    font-weight: 700 !important;
}

.inventory-quick-movement-menu-hint-final {
    font-size: 13px !important;
    line-height: 1.35 !important;
    opacity: 0.82 !important;
    margin-bottom: 10px !important;
}

.inventory-quick-movement-menu-actions-final {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.inventory-quick-green-final {
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #ffffff !important;
}

.inventory-quick-green-final:hover {
    background: #15803d !important;
}

.inventory-quick-red-final {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.inventory-quick-red-final:hover {
    background: #b91c1c !important;
}

/* ===== END INVENTORY QUICK MOVEMENT FROM DIFF FINAL ===== */

/* ===== INCOMING LABELS BY DATE FINAL ===== */

.incoming-labels-card-final {
    margin-top: 16px !important;
}

.incoming-labels-subtitle-final {
    margin-top: 0 !important;
    color: #64748b !important;
    line-height: 1.45 !important;
}

.incoming-labels-controls-final {
    display: grid !important;
    grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) auto auto !important;
    gap: 12px !important;
    align-items: end !important;
    margin: 12px 0 12px 0 !important;
}

.incoming-labels-controls-final label {
    font-weight: 700 !important;
}

.incoming-labels-controls-final input[type="date"] {
    width: 100% !important;
    height: 42px !important;
}

.incoming-labels-checkbox-final {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 42px !important;
    margin: 0 !important;
}

.incoming-labels-checkbox-final input {
    width: auto !important;
}

.incoming-labels-status-final {
    margin: 10px 0 12px 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
}

.incoming-labels-table-final {
    width: 100% !important;
}

.incoming-labels-table-final th,
.incoming-labels-table-final td {
    vertical-align: top !important;
}

.incoming-labels-qty-input-final {
    width: 90px !important;
    min-width: 90px !important;
    height: 36px !important;
    text-align: center !important;
}

.incoming-labels-preview-header-final {
    margin-bottom: 10px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
}

.incoming-labels-preview-header-final span {
    color: #64748b !important;
    font-size: 13px !important;
}

.incoming-label-code-final {
    width: 12mm !important;
    height: 12mm !important;
}

.incoming-label-barcode-final {
    width: 27mm !important;
    height: 11mm !important;
}

.incoming-label-barcode-final svg {
    width: 27mm !important;
    height: 11mm !important;
    display: block !important;
}

.incoming-label-sku-final {
    max-width: 27mm !important;
}

@media (max-width: 900px) {
    .incoming-labels-controls-final {
        grid-template-columns: 1fr !important;
    }

    .incoming-labels-controls-final button {
        width: 100% !important;
    }
}

/* ===== END INCOMING LABELS BY DATE FINAL ===== */



/* ===== MANUAL LABEL PRINT CART FINAL ===== */

.manual-label-cart-box-final {
    margin-top: 16px !important;
    margin-bottom: 16px !important;
    padding: 14px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 16px !important;
    background: #f8fafc !important;
}

.manual-label-cart-box-final h3 {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
}

.manual-label-cart-hint-final {
    margin-bottom: 12px !important;
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
}

.manual-label-cart-controls-final {
    display: grid !important;
    grid-template-columns: minmax(260px, 1fr) 170px auto !important;
    gap: 12px !important;
    align-items: end !important;
}

.manual-label-cart-controls-final label {
    display: block !important;
    font-weight: 700 !important;
    margin-bottom: 5px !important;
}

.manual-label-cart-controls-final input {
    width: 100% !important;
}

.manual-label-cart-buttons-final {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
}

.manual-label-cart-actions-final {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 12px !important;
}

.manual-label-cart-empty-final {
    margin-top: 12px !important;
    padding: 10px 12px !important;
    border: 1px dashed #cbd5e1 !important;
    border-radius: 12px !important;
    color: #64748b !important;
    background: #ffffff !important;
}

.manual-label-cart-summary-final {
    margin-top: 12px !important;
    margin-bottom: 8px !important;
    color: #334155 !important;
}

.manual-label-cart-table-final {
    width: 100% !important;
    margin-top: 8px !important;
}

.manual-label-cart-table-final th,
.manual-label-cart-table-final td {
    vertical-align: middle !important;
}

.manual-label-cart-qty-input-final {
    width: 90px !important;
    min-width: 90px !important;
}

.manual-label-error-final {
    color: #b91c1c !important;
    border-color: #fecaca !important;
    background: #fff1f2 !important;
}

@media (max-width: 900px) {
    .manual-label-cart-controls-final {
        grid-template-columns: 1fr !important;
    }

    .manual-label-cart-buttons-final {
        align-items: stretch !important;
    }

    .manual-label-cart-buttons-final button {
        width: 100% !important;
    }
}

/* ===== END MANUAL LABEL PRINT CART FINAL ===== */





/* ===== EXTERNAL INVENTORY EXCEL FRONTEND FINAL ===== */

.external-inventory-extra-button-box {
    margin-top: 14px !important;
}

.external-inventory-card {
    border: 1px solid #dbe3ee !important;
}

.external-inventory-title-row,
.external-inventory-detail-head {
    display: flex !important;
    justify-content: space-between !important;
    gap: 14px !important;
    align-items: flex-start !important;
}

.external-inventory-muted {
    color: #64748b !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
}

.external-inventory-create-box {
    margin: 14px 0 18px 0 !important;
    padding: 14px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
}

.external-inventory-detail {
    margin-top: 18px !important;
}

.external-inventory-stat-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
    gap: 10px !important;
    margin: 14px 0 !important;
}

.external-inventory-stat-grid > div {
    padding: 10px 12px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    background: #ffffff !important;
}

.external-inventory-stat-grid b {
    display: block !important;
    font-size: 20px !important;
    line-height: 1.1 !important;
}

.external-inventory-stat-grid span {
    display: block !important;
    color: #64748b !important;
    font-size: 12px !important;
    margin-top: 3px !important;
}

.external-inventory-scan-box {
    margin: 14px 0 !important;
    padding: 14px !important;
    border: 1px solid #dbe3ee !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
}

.external-inventory-scan-box input {
    font-size: 20px !important;
    height: 48px !important;
    font-weight: 700 !important;
}

.external-inventory-scan-result {
    margin-top: 8px !important;
    min-height: 20px !important;
    font-weight: 700 !important;
}

.external-inventory-table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
}

.external-inventory-sessions-table th,
.external-inventory-sessions-table td {
    white-space: nowrap !important;
}

.external-inventory-row-none td {
    background: #ffe4e6 !important;
}

.external-inventory-row-partial td {
    background: #dbeafe !important;
}

.external-inventory-row-ok td {
    background: #dcfce7 !important;
}

.external-inventory-row-over td {
    background: #ffedd5 !important;
}

.external-inventory-row-unknown td {
    background: #fef3c7 !important;
}

@media (max-width: 900px) {
    .external-inventory-title-row,
    .external-inventory-detail-head {
        flex-direction: column !important;
    }
}

/* ===== END EXTERNAL INVENTORY EXCEL FRONTEND FINAL ===== */

/* ===== EXTERNAL INVENTORY DELETE FRONTEND FINAL ===== */
.external-inventory-delete-list-btn {
    margin-left: 6px !important;
}

.external-inventory-delete-detail-box {
    margin: 12px 0 14px 0 !important;
    padding: 10px 12px !important;
    border: 1px solid #fecaca !important;
    border-radius: 12px !important;
    background: #fff7f7 !important;
    align-items: center !important;
}

.external-inventory-delete-hint {
    color: #991b1b !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
}
/* ===== END EXTERNAL INVENTORY DELETE FRONTEND FINAL ===== */



/* ===== SETTINGS NATIVE RESTORE VISUAL FIX FINAL ===== */

/* Кнопка назад внутри главной страницы настроек */
section[data-page="settings"] #settingsHomePage #settingsBackExtraButtonFinal {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 14px !important;
    margin: 0 0 18px 0 !important;
    border-radius: 10px !important;
    border: 1px solid #1d4ed8 !important;
    background: #2563eb !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
}

section[data-page="settings"] #settingsHomePage #settingsBackExtraButtonFinal:hover {
    background: #1d4ed8 !important;
}

/* Карточки настроек ровные, кнопки прижаты вниз */
section[data-page="settings"] .settings-tiles-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
}

section[data-page="settings"] .settings-tiles-grid > .settings-card {
    min-height: 210px !important;
    height: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

section[data-page="settings"] .settings-tiles-grid > .settings-card h3 {
    margin-top: 0 !important;
}

section[data-page="settings"] .settings-tiles-grid > .settings-card p {
    flex: 1 1 auto !important;
    margin-bottom: 16px !important;
}

section[data-page="settings"] .settings-tiles-grid > .settings-card button {
    margin-top: auto !important;
    align-self: flex-start !important;
}

/* ===== END SETTINGS NATIVE RESTORE VISUAL FIX FINAL ===== */

/* ===== SETTINGS CLEAN BEHAVIOR FINAL ===== */

section[data-page="settings"] #settingsHomePage #settingsBackExtraButtonFinal,
section[data-page="settings"] #settingsHomePage .settings-back-extra-button-real {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 14px !important;
    margin: 0 0 18px 0 !important;
    border-radius: 10px !important;
    border: 1px solid #1d4ed8 !important;
    background: #2563eb !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
}

section[data-page="settings"] #settingsHomePage #settingsBackExtraButtonFinal:hover,
section[data-page="settings"] #settingsHomePage .settings-back-extra-button-real:hover {
    background: #1d4ed8 !important;
}

section[data-page="settings"] .settings-tiles-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
}

section[data-page="settings"] .settings-tiles-grid > .settings-card {
    min-height: 210px !important;
    height: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

section[data-page="settings"] .settings-tiles-grid > .settings-card h3 {
    margin-top: 0 !important;
}

section[data-page="settings"] .settings-tiles-grid > .settings-card p {
    flex: 1 1 auto !important;
    margin-bottom: 16px !important;
}

section[data-page="settings"] .settings-tiles-grid > .settings-card button {
    margin-top: auto !important;
    align-self: flex-start !important;
}

/* ===== END SETTINGS CLEAN BEHAVIOR FINAL ===== */

/* ===== EXTERNAL INVENTORY BUFFER AND MANUAL ADJUST FINAL ===== */
.external-inventory-buffer-note {
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.external-inventory-manual-head,
.external-inventory-manual-cell {
    text-align: center !important;
    white-space: nowrap !important;
}

.external-inventory-manual-box {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
}

.external-inventory-manual-count {
    min-width: 48px !important;
    display: inline-block !important;
    text-align: center !important;
    font-weight: 700 !important;
}

.external-inventory-manual-minus {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.external-inventory-manual-plus {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.external-inventory-manual-minus:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
}
/* ===== END EXTERNAL INVENTORY BUFFER AND MANUAL ADJUST FINAL ===== */



/* ===== EXTERNAL INVENTORY BLUE PLUS MINUS BUTTONS FINAL ===== */
button[onclick*="externalInventoryManualAdjust"],
button[onclick*="externalInventoryAdjust"],
.external-inventory-manual-btn,
.ext-inv-manual-btn,
.external-inventory-adjust-btn {
    background: #2563eb !important;
    color: #ffffff !important;
    border: 1px solid #1d4ed8 !important;
    font-weight: 700 !important;
}

button[onclick*="externalInventoryManualAdjust"]:hover,
button[onclick*="externalInventoryAdjust"]:hover,
.external-inventory-manual-btn:hover,
.ext-inv-manual-btn:hover,
.external-inventory-adjust-btn:hover {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}
/* ===== END EXTERNAL INVENTORY BLUE PLUS MINUS BUTTONS FINAL ===== */



/* ===== EXTERNAL INVENTORY FULL V5 FRONTEND FINAL ===== */
.external-inventory-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.external-inventory-stat-grid > div {
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    padding: 12px;
    background: #ffffff;
}

.external-inventory-stat-grid b {
    display: block;
    font-size: 22px;
}

.external-inventory-stat-grid span {
    display: block;
    color: #4b5563;
    font-size: 13px;
}

.external-inventory-manual-cell {
    white-space: nowrap;
}

.external-inventory-manual-btn {
    background: #2563eb !important;
    color: #ffffff !important;
    border: 1px solid #1d4ed8 !important;
    font-weight: 700 !important;
    min-width: 44px;
    margin: 2px;
}

.external-inventory-manual-btn:hover {
    background: #1d4ed8 !important;
}

.external-inventory-row-ok td {
    background: #dcfce7 !important;
}

.external-inventory-row-partial td {
    background: #dbeafe !important;
}

.external-inventory-row-missing td {
    background: #fee2e2 !important;
}

.external-inventory-row-over td {
    background: #fef3c7 !important;
}

.external-inventory-row-unknown td {
    background: #fef3c7 !important;
}

.external-inventory-delete-note {
    color: #7f1d1d;
    margin: 8px 0 12px 0;
    font-size: 14px;
}
/* ===== END EXTERNAL INVENTORY FULL V5 FRONTEND FINAL ===== */

/* FIX: выравнивание поля и кнопки быстрого поиска */
.row > button {
    margin-top: 0;
    flex-shrink: 0;
}

.row > input {
    min-width: 0;
}

/* ===== DISPLAYSTOCK DARK THEME GLOBAL OVERRIDE FINAL ===== */

html.dark-theme,
body.dark-theme {
    background:
        radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.16), transparent 28%),
        radial-gradient(circle at 90% 12%, rgba(14, 165, 233, 0.10), transparent 26%),
        linear-gradient(135deg, #07111f 0%, #0b1220 45%, #050814 100%) !important;
    color: #dbeafe !important;
}

/* Базовые контейнеры, карточки, секции */
body.dark-theme main,
body.dark-theme section,
body.dark-theme .card,
body.dark-theme section.card,
body.dark-theme .form-block,
body.dark-theme .panel,
body.dark-theme .modal,
body.dark-theme .modal-content,
body.dark-theme .selected-product-info,
body.dark-theme .product-card,
body.dark-theme .search-result-card,
body.dark-theme .inventory-edit-card,
body.dark-theme .inventory-edit-add-box,
body.dark-theme .extra-menu-tile-final,
body.dark-theme .header-user-card,
body.dark-theme .header-brand-card,
body.dark-theme .header-logout-card {
    background: rgba(15, 23, 42, 0.86) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26) !important;
}

/* Любые внутренние белые блоки */
body.dark-theme div,
body.dark-theme article,
body.dark-theme aside {
    border-color: rgba(96, 165, 250, 0.14);
}

/* Текст */
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme p,
body.dark-theme span,
body.dark-theme label,
body.dark-theme small,
body.dark-theme strong,
body.dark-theme b,
body.dark-theme li {
    color: inherit;
}

body.dark-theme small,
body.dark-theme .muted,
body.dark-theme .subtitle,
body.dark-theme .extra-menu-subtitle,
body.dark-theme .hint,
body.dark-theme .description {
    color: #94a3b8 !important;
}

body.dark-theme a {
    color: #93c5fd !important;
}

/* Формы */
body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
    background: rgba(2, 6, 23, 0.78) !important;
    color: #e5efff !important;
    border-color: rgba(96, 165, 250, 0.24) !important;
    box-shadow: none !important;
}

body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder {
    color: #64748b !important;
}

body.dark-theme option {
    background: #0f172a !important;
    color: #e5efff !important;
}

/* Кнопки */
body.dark-theme button,
body.dark-theme .small-btn,
body.dark-theme .secondary-btn,
body.dark-theme .link-button,
body.dark-theme .theme-toggle-button,
body.dark-theme input[type="button"],
body.dark-theme input[type="submit"] {
    background: rgba(30, 41, 59, 0.92) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.22) !important;
}

body.dark-theme button:hover,
body.dark-theme .small-btn:hover,
body.dark-theme .secondary-btn:hover,
body.dark-theme .link-button:hover,
body.dark-theme .theme-toggle-button:hover {
    background: rgba(37, 99, 235, 0.44) !important;
    color: #ffffff !important;
}

/* Таблицы полностью */
body.dark-theme table,
body.dark-theme thead,
body.dark-theme tbody,
body.dark-theme tfoot {
    background: rgba(15, 23, 42, 0.82) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.16) !important;
}

body.dark-theme th {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #bfdbfe !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
}

body.dark-theme td {
    background: rgba(15, 23, 42, 0.72) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.12) !important;
}

body.dark-theme tr:nth-child(even) td {
    background: rgba(15, 23, 42, 0.88) !important;
}

body.dark-theme tr:hover td {
    background: rgba(30, 64, 175, 0.28) !important;
    color: #ffffff !important;
}

/* Специальные таблицы проекта */
body.dark-theme .home-stock-hard-table,
body.dark-theme .movements-hard-table,
body.dark-theme .clean-movements-table,
body.dark-theme .history-month-table,
body.dark-theme #inventoryScanTable table,
body.dark-theme #inventoryTable table,
body.dark-theme #stockHistoryTable table {
    background: rgba(15, 23, 42, 0.82) !important;
    color: #dbeafe !important;
}

/* Статусы и цветовые ячейки */
body.dark-theme .stock-ok,
body.dark-theme .success,
body.dark-theme .ok {
    color: #86efac !important;
}

body.dark-theme .stock-low,
body.dark-theme .warning {
    color: #fde68a !important;
}

body.dark-theme .stock-zero,
body.dark-theme .stock-empty,
body.dark-theme .danger,
body.dark-theme .danger-btn,
body.dark-theme .history-missing-real-session-cell {
    background: rgba(127, 29, 29, 0.28) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.24) !important;
}

/* Инвентаризация: отличия/совпадения */
body.dark-theme .inventory-scan-row-diff-live > td,
body.dark-theme tr.inventory-scan-row-diff-live > td {
    background: rgba(127, 29, 29, 0.34) !important;
    color: #fecaca !important;
}

body.dark-theme .inventory-scan-row-ok-live > td,
body.dark-theme tr.inventory-scan-row-ok-live > td {
    background: rgba(20, 83, 45, 0.30) !important;
    color: #bbf7d0 !important;
}

/* Плашки, уведомления, статусы */
body.dark-theme .status,
body.dark-theme .alert,
body.dark-theme .notice,
body.dark-theme .badge,
body.dark-theme .home-stock-hard-status,
body.dark-theme .movements-hard-status,
body.dark-theme .clean-movements-status,
body.dark-theme .movement-product-search-status,
body.dark-theme .home-stock-settle-status,
body.dark-theme .onec-hide-no-data-toggle {
    background: rgba(15, 23, 42, 0.86) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
}

/* Выпадающие/служебные блоки */
body.dark-theme .dropdown,
body.dark-theme .menu,
body.dark-theme .popover,
body.dark-theme .tooltip,
body.dark-theme .autocomplete,
body.dark-theme .suggestions,
body.dark-theme .search-results {
    background: rgba(15, 23, 42, 0.96) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
}

/* Скроллбар */
body.dark-theme ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body.dark-theme ::-webkit-scrollbar-track {
    background: #020617;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 999px;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ===== END DISPLAYSTOCK DARK THEME GLOBAL OVERRIDE FINAL ===== */

/* ===== DISPLAYSTOCK DARK THEME PAGE FIXES FINAL ===== */

/* Общие внутренние светлые панели на страницах */
body.dark-theme section[data-page] > div,
body.dark-theme section[data-page] .card,
body.dark-theme section[data-page] .form-block,
body.dark-theme section[data-page] .panel,
body.dark-theme section[data-page] .selected-product-info {
    background: rgba(15, 23, 42, 0.86) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
}

/* QR / этикетки: белые блоки настроек и ручного списка */
body.dark-theme section[data-page="qr"] > div,
body.dark-theme section[data-page="labels"] > div,
body.dark-theme .bulk-qr-source-control,
body.dark-theme .incoming-labels-status-final,
body.dark-theme .incoming-labels-card-final,
body.dark-theme .print-settings-card-final,
body.dark-theme .print-settings-preview-final,
body.dark-theme .print-settings-fake-qr {
    background: rgba(15, 23, 42, 0.88) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
}

/* Excel-инвентаризация: форма создания */
body.dark-theme section[data-page="externalInventory"] > div,
body.dark-theme section[data-page="external-inventory"] > div,
body.dark-theme .external-inventory-stat-grid > div {
    background: rgba(15, 23, 42, 0.88) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
}

body.dark-theme .external-inventory-stat-grid span,
body.dark-theme .external-inventory-delete-note {
    color: #94a3b8 !important;
}

/* Статусы/плашки, которые оставались белыми */
body.dark-theme #inventoryScanResult,
body.dark-theme #inventoryCurrentStatus,
body.dark-theme #inventoryScanTable,
body.dark-theme #historyMonthlyStatus,
body.dark-theme #historyMonthStatus,
body.dark-theme #qrManualList,
body.dark-theme #acceptedLabelsResult,
body.dark-theme #incomingLabelsResult,
body.dark-theme .status,
body.dark-theme .notice,
body.dark-theme .hint-box,
body.dark-theme .info-box {
    background: rgba(15, 23, 42, 0.88) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
}

/* История остатков: первые колонки и заголовки не должны быть белыми */
body.dark-theme .history-month-table th,
body.dark-theme .history-month-table td,
body.dark-theme .history-month-table th:first-child,
body.dark-theme .history-month-table th:nth-child(2),
body.dark-theme .history-month-table td:first-child,
body.dark-theme .history-month-table td:nth-child(2) {
    background: rgba(15, 23, 42, 0.88) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.16) !important;
}

body.dark-theme .history-month-table thead th {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #bfdbfe !important;
}

body.dark-theme .history-month-table tr:hover td {
    background: rgba(30, 64, 175, 0.30) !important;
    color: #ffffff !important;
}

/* Подписи, которые на скринах почти сливаются */
body.dark-theme section[data-page] label,
body.dark-theme section[data-page] small,
body.dark-theme section[data-page] .hint,
body.dark-theme section[data-page] .subtitle,
body.dark-theme section[data-page] .description {
    color: #cbd5e1 !important;
}

/* Поля выбора файла */
body.dark-theme input[type="file"] {
    background: rgba(2, 6, 23, 0.78) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.24) !important;
}

body.dark-theme input[type="file"]::file-selector-button {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #dbeafe !important;
    border: 1px solid rgba(96, 165, 250, 0.22) !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
}

/* Светлые полосы-разделители */
body.dark-theme hr,
body.dark-theme .divider,
body.dark-theme .separator {
    background: rgba(96, 165, 250, 0.18) !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
}

/* ===== END DISPLAYSTOCK DARK THEME PAGE FIXES FINAL ===== */

/* ===== DISPLAYSTOCK DARK THEME HARD FORCE FIX ===== */

/*
   Жёсткий финальный слой для тёмной темы.
   Нужен потому, что часть старых блоков имеет background: #fff/#ffffff !important
   и не перекрывается обычной темой.
*/

html.dark-theme .page-section,
html.dark-theme .page-section .card,
html.dark-theme .page-section section,
html.dark-theme .page-section div,
body.dark-theme .page-section,
body.dark-theme .page-section .card,
body.dark-theme .page-section section,
body.dark-theme .page-section div,
.dark-theme .page-section,
.dark-theme .page-section .card,
.dark-theme .page-section section,
.dark-theme .page-section div {
    background-color: rgba(15, 23, 42, 0.88) !important;
    background-image: none !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
}

/* QR / этикетки */
html.dark-theme [data-page="labels"] .card,
html.dark-theme [data-page="labels"] .label-code-type-box,
html.dark-theme [data-page="labels"] .selected-product-info,
html.dark-theme [data-page="labels"] .labels-note,
html.dark-theme [data-page="labels"] .labels-preview,
html.dark-theme [data-page="labels"] .bulk-label-source,
html.dark-theme [data-page="labels"] .qr-source-select-wrap,
html.dark-theme [data-page="labels"] .manual-label-cart-box-final,
html.dark-theme [data-page="labels"] .manual-label-cart-empty-final,
html.dark-theme [data-page="labels"] .manual-label-cart-summary-final,
body.dark-theme [data-page="labels"] .card,
body.dark-theme [data-page="labels"] .label-code-type-box,
body.dark-theme [data-page="labels"] .selected-product-info,
body.dark-theme [data-page="labels"] .labels-note,
body.dark-theme [data-page="labels"] .labels-preview,
body.dark-theme [data-page="labels"] .bulk-label-source,
body.dark-theme [data-page="labels"] .qr-source-select-wrap,
body.dark-theme [data-page="labels"] .manual-label-cart-box-final,
body.dark-theme [data-page="labels"] .manual-label-cart-empty-final,
body.dark-theme [data-page="labels"] .manual-label-cart-summary-final,
.dark-theme [data-page="labels"] .card,
.dark-theme [data-page="labels"] .label-code-type-box,
.dark-theme [data-page="labels"] .selected-product-info,
.dark-theme [data-page="labels"] .labels-note,
.dark-theme [data-page="labels"] .labels-preview,
.dark-theme [data-page="labels"] .bulk-label-source,
.dark-theme [data-page="labels"] .qr-source-select-wrap,
.dark-theme [data-page="labels"] .manual-label-cart-box-final,
.dark-theme [data-page="labels"] .manual-label-cart-empty-final,
.dark-theme [data-page="labels"] .manual-label-cart-summary-final {
    background-color: rgba(15, 23, 42, 0.92) !important;
    background-image: none !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.20) !important;
}

/* Инвентаризация сканером */
html.dark-theme [data-page="inventory"] .card,
html.dark-theme [data-page="inventory"] #inventoryScanResult,
html.dark-theme [data-page="inventory"] #inventoryScanTable,
html.dark-theme [data-page="inventory"] #inventoryLog,
body.dark-theme [data-page="inventory"] .card,
body.dark-theme [data-page="inventory"] #inventoryScanResult,
body.dark-theme [data-page="inventory"] #inventoryScanTable,
body.dark-theme [data-page="inventory"] #inventoryLog,
.dark-theme [data-page="inventory"] .card,
.dark-theme [data-page="inventory"] #inventoryScanResult,
.dark-theme [data-page="inventory"] #inventoryScanTable,
.dark-theme [data-page="inventory"] #inventoryLog {
    background-color: rgba(15, 23, 42, 0.92) !important;
    background-image: none !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.20) !important;
}

/* Excel-инвентаризация */
html.dark-theme .external-inventory-create-box,
html.dark-theme .external-inventory-card,
html.dark-theme .external-inventory-detail,
html.dark-theme .external-inventory-scan-box,
html.dark-theme .external-inventory-scan-result,
html.dark-theme .external-inventory-table-wrap,
html.dark-theme .external-inventory-stat-grid > div,
body.dark-theme .external-inventory-create-box,
body.dark-theme .external-inventory-card,
body.dark-theme .external-inventory-detail,
body.dark-theme .external-inventory-scan-box,
body.dark-theme .external-inventory-scan-result,
body.dark-theme .external-inventory-table-wrap,
body.dark-theme .external-inventory-stat-grid > div,
.dark-theme .external-inventory-create-box,
.dark-theme .external-inventory-card,
.dark-theme .external-inventory-detail,
.dark-theme .external-inventory-scan-box,
.dark-theme .external-inventory-scan-result,
.dark-theme .external-inventory-table-wrap,
.dark-theme .external-inventory-stat-grid > div {
    background-color: rgba(15, 23, 42, 0.92) !important;
    background-image: none !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.20) !important;
}

/* История остатков */
html.dark-theme [data-page="history"] .card,
html.dark-theme [data-page="history"] .history-controls,
html.dark-theme [data-page="history"] #historyStatus,
html.dark-theme [data-page="history"] #historyTable,
html.dark-theme [data-page="history"] .history-status,
html.dark-theme [data-page="history"] .history-table-wrap,
body.dark-theme [data-page="history"] .card,
body.dark-theme [data-page="history"] .history-controls,
body.dark-theme [data-page="history"] #historyStatus,
body.dark-theme [data-page="history"] #historyTable,
body.dark-theme [data-page="history"] .history-status,
body.dark-theme [data-page="history"] .history-table-wrap,
.dark-theme [data-page="history"] .card,
.dark-theme [data-page="history"] .history-controls,
.dark-theme [data-page="history"] #historyStatus,
.dark-theme [data-page="history"] #historyTable,
.dark-theme [data-page="history"] .history-status,
.dark-theme [data-page="history"] .history-table-wrap {
    background-color: rgba(15, 23, 42, 0.92) !important;
    background-image: none !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.20) !important;
}

/* Таблицы, включая липкие колонки истории */
html.dark-theme table,
html.dark-theme thead,
html.dark-theme tbody,
html.dark-theme tr,
html.dark-theme th,
html.dark-theme td,
html.dark-theme .history-month-table,
html.dark-theme .history-month-table th,
html.dark-theme .history-month-table td,
html.dark-theme .history-sticky,
html.dark-theme .history-sku,
html.dark-theme .history-name,
body.dark-theme table,
body.dark-theme thead,
body.dark-theme tbody,
body.dark-theme tr,
body.dark-theme th,
body.dark-theme td,
body.dark-theme .history-month-table,
body.dark-theme .history-month-table th,
body.dark-theme .history-month-table td,
body.dark-theme .history-sticky,
body.dark-theme .history-sku,
body.dark-theme .history-name,
.dark-theme table,
.dark-theme thead,
.dark-theme tbody,
.dark-theme tr,
.dark-theme th,
.dark-theme td,
.dark-theme .history-month-table,
.dark-theme .history-month-table th,
.dark-theme .history-month-table td,
.dark-theme .history-sticky,
.dark-theme .history-sku,
.dark-theme .history-name {
    background-color: rgba(15, 23, 42, 0.90) !important;
    background-image: none !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
}

/* Заголовки таблиц */
html.dark-theme th,
html.dark-theme .history-main-header,
body.dark-theme th,
body.dark-theme .history-main-header,
.dark-theme th,
.dark-theme .history-main-header {
    background-color: rgba(30, 41, 59, 0.98) !important;
    color: #bfdbfe !important;
}

/* Инпуты / селекты / textarea / файл */
html.dark-theme input,
html.dark-theme select,
html.dark-theme textarea,
body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea,
.dark-theme input,
.dark-theme select,
.dark-theme textarea {
    background-color: rgba(2, 6, 23, 0.86) !important;
    background-image: none !important;
    color: #e5efff !important;
    border-color: rgba(96, 165, 250, 0.28) !important;
}

html.dark-theme input[type="file"],
body.dark-theme input[type="file"],
.dark-theme input[type="file"] {
    background-color: rgba(2, 6, 23, 0.86) !important;
    color: #e5efff !important;
}

/* Подписи */
html.dark-theme label,
html.dark-theme small,
html.dark-theme .hint,
html.dark-theme .description,
html.dark-theme .history-page-subtitle,
html.dark-theme .external-inventory-muted,
html.dark-theme .manual-label-cart-hint-final,
body.dark-theme label,
body.dark-theme small,
body.dark-theme .hint,
body.dark-theme .description,
body.dark-theme .history-page-subtitle,
body.dark-theme .external-inventory-muted,
body.dark-theme .manual-label-cart-hint-final,
.dark-theme label,
.dark-theme small,
.dark-theme .hint,
.dark-theme .description,
.dark-theme .history-page-subtitle,
.dark-theme .external-inventory-muted,
.dark-theme .manual-label-cart-hint-final {
    color: #cbd5e1 !important;
}

/* Статусные светлые полосы */
html.dark-theme .selected-product-info,
html.dark-theme .status,
html.dark-theme .notice,
html.dark-theme .info-box,
html.dark-theme .history-status,
html.dark-theme #historyStatus,
html.dark-theme #inventoryScanResult,
html.dark-theme #acceptedLabelsResult,
html.dark-theme #incomingLabelsResult,
html.dark-theme #manualLabelStatus,
body.dark-theme .selected-product-info,
body.dark-theme .status,
body.dark-theme .notice,
body.dark-theme .info-box,
body.dark-theme .history-status,
body.dark-theme #historyStatus,
body.dark-theme #inventoryScanResult,
body.dark-theme #acceptedLabelsResult,
body.dark-theme #incomingLabelsResult,
body.dark-theme #manualLabelStatus,
.dark-theme .selected-product-info,
.dark-theme .status,
.dark-theme .notice,
.dark-theme .info-box,
.dark-theme .history-status,
.dark-theme #historyStatus,
.dark-theme #inventoryScanResult,
.dark-theme #acceptedLabelsResult,
.dark-theme #incomingLabelsResult,
.dark-theme #manualLabelStatus {
    background-color: rgba(15, 23, 42, 0.92) !important;
    background-image: none !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.20) !important;
}

/* Сохраняем смысловые цвета */
html.dark-theme .stock-ok,
body.dark-theme .stock-ok,
.dark-theme .stock-ok {
    color: #86efac !important;
}

html.dark-theme .danger-btn,
body.dark-theme .danger-btn,
.dark-theme .danger-btn {
    background-color: rgba(127, 29, 29, 0.45) !important;
    color: #fecaca !important;
}

/* ===== END DISPLAYSTOCK DARK THEME HARD FORCE FIX ===== */

/* ===== DISPLAYSTOCK DARK THEME VISUAL POLISH FINAL ===== */

/* Более живой фон по краям */
html.dark-theme,
body.dark-theme {
    background:
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.22), transparent 32%),
        radial-gradient(circle at 100% 8%, rgba(14, 165, 233, 0.16), transparent 30%),
        radial-gradient(circle at 50% 100%, rgba(79, 70, 229, 0.14), transparent 34%),
        linear-gradient(135deg, #06101f 0%, #0b1220 42%, #040817 100%) !important;
}

/* Верхнее меню: кнопки должны читаться как кнопки, а не сливаться */
body.dark-theme nav,
body.dark-theme .top-nav,
body.dark-theme .nav-buttons {
    background: rgba(2, 6, 23, 0.16) !important;
    border-radius: 18px !important;
}

body.dark-theme button[onclick^="showPage"],
body.dark-theme .nav-buttons button {
    background: rgba(15, 23, 42, 0.88) !important;
    color: #dbeafe !important;
    border: 1px solid rgba(96, 165, 250, 0.34) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 6px 14px rgba(0,0,0,0.18) !important;
}

body.dark-theme button[onclick^="showPage"]:hover,
body.dark-theme .nav-buttons button:hover {
    background: rgba(30, 64, 175, 0.58) !important;
    border-color: rgba(147, 197, 253, 0.58) !important;
    color: #ffffff !important;
}

body.dark-theme button[onclick^="showPage"].active-nav-button,
body.dark-theme .nav-buttons button.active-nav-button {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.88), rgba(14, 165, 233, 0.64)) !important;
    color: #ffffff !important;
    border-color: rgba(191, 219, 254, 0.76) !important;
    box-shadow:
        0 0 0 1px rgba(147, 197, 253, 0.18),
        0 8px 18px rgba(37, 99, 235, 0.28) !important;
}

/* История остатков: липкие колонки непрозрачные, чтобы таблица не просвечивала */
body.dark-theme .history-table-wrap {
    background: #07111f !important;
    border-color: rgba(96, 165, 250, 0.24) !important;
}

body.dark-theme .history-month-table .history-sticky,
body.dark-theme .history-month-table .history-sku,
body.dark-theme .history-month-table .history-name,
body.dark-theme .history-month-table th.history-sticky,
body.dark-theme .history-month-table td.history-sticky {
    background: #0f172a !important;
    color: #e5efff !important;
    box-shadow: 8px 0 12px rgba(2, 6, 23, 0.70) !important;
    background-clip: padding-box !important;
}

body.dark-theme .history-month-table .history-main-header.history-sticky,
body.dark-theme .history-month-table thead .history-sticky {
    background: #1e293b !important;
    color: #bfdbfe !important;
    box-shadow: 8px 0 12px rgba(2, 6, 23, 0.78) !important;
}

/* История остатков: возвращаем смысловые цвета, которые hard-force мог перебить */
body.dark-theme .history-month-table .history-cell-picked,
body.dark-theme .history-month-table .history-picked,
body.dark-theme .history-month-table .picked,
body.dark-theme .history-month-table td.stock-ok,
body.dark-theme .history-month-table td.ok,
body.dark-theme .history-month-table td.success {
    background: rgba(22, 101, 52, 0.58) !important;
    color: #dcfce7 !important;
    font-weight: 800 !important;
}

body.dark-theme .history-month-table td.stock-low,
body.dark-theme .history-month-table td.warning,
body.dark-theme .history-month-table td.danger {
    background: rgba(127, 29, 29, 0.52) !important;
    color: #fecaca !important;
    font-weight: 800 !important;
}

body.dark-theme .history-month-table td {
    color: #dbeafe !important;
}

body.dark-theme .history-month-table td:empty {
    background: rgba(15, 23, 42, 0.68) !important;
}

body.dark-theme .history-month-table th.history-period-no-inventory {
    background: rgba(127, 29, 29, 0.62) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.32) !important;
    box-shadow:
        inset 0 -3px 0 rgba(248, 113, 113, 0.52),
        inset 0 0 0 1px rgba(248, 113, 113, 0.16) !important;
}

body.dark-theme .history-month-table td.history-calculated-without-inventory,
body.dark-theme .history-month-table td.history-calculated-without-inventory.history-morning-cell,
body.dark-theme .history-month-table td.history-calculated-without-inventory.history-evening-cell {
    background: linear-gradient(90deg, rgba(127, 29, 29, 0.48), rgba(30, 41, 59, 0.86)) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.24) !important;
    box-shadow:
        inset 3px 0 0 rgba(248, 113, 113, 0.58),
        inset 0 0 0 1px rgba(248, 113, 113, 0.10) !important;
}

body.dark-theme .history-month-table td.history-calculated-without-inventory .history-qty {
    color: #fecaca !important;
}

body.dark-theme .history-month-table td.history-real-inventory-cell {
    box-shadow: inset 0 0 0 1px rgba(134, 239, 172, 0.13) !important;
}

/* Общие смысловые цвета по всем таблицам */
body.dark-theme td.stock-ok,
body.dark-theme span.stock-ok,
body.dark-theme div.stock-ok {
    color: #86efac !important;
    font-weight: 800 !important;
}

body.dark-theme td.stock-low,
body.dark-theme span.stock-low,
body.dark-theme div.stock-low {
    color: #fca5a5 !important;
    font-weight: 800 !important;
}

body.dark-theme td.stock-warning,
body.dark-theme span.stock-warning,
body.dark-theme div.stock-warning {
    color: #fde68a !important;
    font-weight: 800 !important;
}

/* Инвентаризация: строки должны быть красными/зелёными, а не синими */
body.dark-theme #inventoryScanTable table tbody tr.inventory-scan-row-diff-live > td,
body.dark-theme #inventoryScanTable table tbody tr.inventory-scan-row-diff-live:hover > td,
body.dark-theme .external-inventory-row-none td,
body.dark-theme .external-inventory-row-partial td {
    background: rgba(127, 29, 29, 0.46) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.22) !important;
}

body.dark-theme #inventoryScanTable table tbody tr.inventory-scan-row-ok-live > td,
body.dark-theme #inventoryScanTable table tbody tr.inventory-scan-row-ok-live:hover > td,
body.dark-theme .external-inventory-row-ok td {
    background: rgba(20, 83, 45, 0.48) !important;
    color: #bbf7d0 !important;
    border-color: rgba(74, 222, 128, 0.22) !important;
}

body.dark-theme .external-inventory-row-over td {
    background: rgba(124, 45, 18, 0.48) !important;
    color: #fed7aa !important;
    border-color: rgba(251, 146, 60, 0.22) !important;
}

body.dark-theme .external-inventory-row-unknown td {
    background: rgba(113, 63, 18, 0.44) !important;
    color: #fde68a !important;
    border-color: rgba(245, 158, 11, 0.22) !important;
}

/* Инвентаризация: маленькие кнопки плюс/минус/движение не должны быть чёрными */
body.dark-theme #inventoryScanTable button,
body.dark-theme #inventoryScanTable .small-btn,
body.dark-theme .external-inventory-manual-minus,
body.dark-theme .external-inventory-manual-plus {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #dbeafe !important;
    border: 1px solid rgba(96, 165, 250, 0.32) !important;
}

body.dark-theme .external-inventory-manual-minus,
body.dark-theme button[onclick*="-1"],
body.dark-theme button[onclick*="changeInventoryCount"][onclick*="-1"] {
    background: rgba(127, 29, 29, 0.56) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.34) !important;
}

body.dark-theme .external-inventory-manual-plus,
body.dark-theme button[onclick*="+1"],
body.dark-theme button[onclick*="changeInventoryCount"][onclick*="1"] {
    background: rgba(20, 83, 45, 0.58) !important;
    color: #bbf7d0 !important;
    border-color: rgba(74, 222, 128, 0.34) !important;
}

/* Рабочие кнопки: добавить/вернуть/зафиксировать/обновить */
body.dark-theme [data-page="incoming"] button,
body.dark-theme button[onclick*="incoming"],
body.dark-theme button[onclick*="createIncoming"],
body.dark-theme button[onclick*="addIncoming"] {
    background: rgba(22, 101, 52, 0.68) !important;
    color: #dcfce7 !important;
    border: 1px solid rgba(74, 222, 128, 0.36) !important;
}

body.dark-theme [data-page="return"] button,
body.dark-theme button[onclick*="return_to_stock"] {
    background: rgba(14, 116, 144, 0.68) !important;
    color: #cffafe !important;
    border: 1px solid rgba(103, 232, 249, 0.34) !important;
}

body.dark-theme [data-page="outgoing"] button,
body.dark-theme button[onclick*="outgoing_repair"] {
    background: rgba(71, 85, 105, 0.88) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.34) !important;
}

body.dark-theme [data-page="correction"] button,
body.dark-theme button[onclick*="write_off"],
body.dark-theme button[onclick*="spis"],
body.dark-theme .danger-btn {
    background: rgba(127, 29, 29, 0.72) !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.38) !important;
}

/* Обычные secondary-кнопки с нормальной обводкой */
body.dark-theme .secondary-btn,
body.dark-theme button.secondary-btn,
body.dark-theme button[id*="Reload"],
body.dark-theme button[id*="Refresh"],
body.dark-theme button[onclick*="reload"],
body.dark-theme button[onclick*="refresh"],
body.dark-theme button[onclick*="load"] {
    background: rgba(30, 41, 59, 0.92) !important;
    color: #dbeafe !important;
    border: 1px solid rgba(96, 165, 250, 0.34) !important;
}

/* Сверка 1С: белые карточки автозагрузки/следующей сверки */
body.dark-theme #onecJobStatus,
body.dark-theme #onecJobStatus > div,
body.dark-theme #onecJobStatus .onec-pill,
body.dark-theme #onecCompactTop,
body.dark-theme #onecCompactTop > div,
body.dark-theme #onecCompactMeta,
body.dark-theme #onecCompactMeta > div,
body.dark-theme #onecXlsxStatus,
body.dark-theme #onecHowItWorks,
body.dark-theme .onec-compact-card,
body.dark-theme .onec-mini-card,
body.dark-theme .onec-item {
    background: rgba(15, 23, 42, 0.92) !important;
    background-image: none !important;
    color: #dbeafe !important;
    border: 1px solid rgba(96, 165, 250, 0.22) !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18) !important;
}

body.dark-theme #onecJobStatus *,
body.dark-theme #onecCompactTop *,
body.dark-theme #onecCompactMeta *,
body.dark-theme #onecXlsxStatus *,
body.dark-theme #onecHowItWorks * {
    color: inherit !important;
}

/* Календарь / месяц / дата: делаем иконку видимой насколько позволяет браузер */
body.dark-theme input[type="date"],
body.dark-theme input[type="month"],
body.dark-theme input[type="datetime-local"],
body.dark-theme input[type="time"] {
    color-scheme: dark !important;
    background: rgba(2, 6, 23, 0.86) !important;
    color: #e5efff !important;
    border-color: rgba(96, 165, 250, 0.30) !important;
}

body.dark-theme input[type="date"]::-webkit-calendar-picker-indicator,
body.dark-theme input[type="month"]::-webkit-calendar-picker-indicator,
body.dark-theme input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body.dark-theme input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.4) contrast(0.85) !important;
    opacity: 0.9 !important;
}

/* Быстрый поиск и сохранённые значения браузера/autofill */
body.dark-theme input:-webkit-autofill,
body.dark-theme input:-webkit-autofill:hover,
body.dark-theme input:-webkit-autofill:focus,
body.dark-theme textarea:-webkit-autofill,
body.dark-theme select:-webkit-autofill {
    -webkit-text-fill-color: #e5efff !important;
    caret-color: #e5efff !important;
    box-shadow: 0 0 0 1000px #020617 inset !important;
    border-color: rgba(96, 165, 250, 0.30) !important;
}

/* Подсветка строки/поля при фокусе в тёмной теме */
body.dark-theme input:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
    background: rgba(2, 6, 23, 0.94) !important;
    color: #ffffff !important;
    border-color: rgba(147, 197, 253, 0.72) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22) !important;
}

/* ===== END DISPLAYSTOCK DARK THEME VISUAL POLISH FINAL ===== */

/* ===== DISPLAYSTOCK DARK THEME NAV CARD POLISH FINAL ===== */

/* Верхнее меню: единый стиль кнопок в тёмной теме */
body.dark-theme .nav-buttons button,
body.dark-theme button[onclick^="showPage"] {
    background: rgba(15, 23, 42, 0.82) !important;
    color: #dbeafe !important;
    border: 1px solid rgba(96, 165, 250, 0.34) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 6px 14px rgba(0, 0, 0, 0.18) !important;
}

/* Hover для верхнего меню */
body.dark-theme .nav-buttons button:hover,
body.dark-theme button[onclick^="showPage"]:hover {
    background: rgba(30, 64, 175, 0.48) !important;
    color: #ffffff !important;
    border-color: rgba(147, 197, 253, 0.62) !important;
}

/* Активный пункт меню: всегда единый синий, без зелёного/разнобоя */
body.dark-theme .nav-buttons button.active,
body.dark-theme .nav-buttons button.active-nav-button,
body.dark-theme button.active,
body.dark-theme button.active-nav-button,
body.dark-theme button[aria-current="page"] {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(29, 78, 216, 0.78)) !important;
    color: #ffffff !important;
    border-color: rgba(191, 219, 254, 0.78) !important;
    box-shadow:
        0 0 0 1px rgba(147, 197, 253, 0.20),
        0 0 18px rgba(37, 99, 235, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

/* Кнопка Обновить остаётся жёлтым акцентом */
body.dark-theme button[onclick*="refreshAll"],
body.dark-theme button[onclick*="refresh"],
body.dark-theme #refreshButton,
body.dark-theme .refresh-button {
    background: linear-gradient(135deg, #facc15, #f59e0b) !important;
    color: #111827 !important;
    border-color: rgba(253, 224, 71, 0.72) !important;
    font-weight: 800 !important;
}

/* Дополнительно: карточки разделов без грязной серой заливки */
body.dark-theme .extra-menu-tile-final,
body.dark-theme .extra-menu-card,
body.dark-theme .extra-card,
body.dark-theme [data-page="extra"] .card,
body.dark-theme [data-page="extra"] button:not(.refresh-button) {
    background: rgba(15, 23, 42, 0.78) !important;
    color: #dbeafe !important;
    border: 1px solid rgba(96, 165, 250, 0.24) !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18) !important;
}

/* Hover карточек в Дополнительно */
body.dark-theme .extra-menu-tile-final:hover,
body.dark-theme .extra-menu-card:hover,
body.dark-theme .extra-card:hover,
body.dark-theme [data-page="extra"] .card:hover {
    background: rgba(30, 64, 175, 0.24) !important;
    border-color: rgba(147, 197, 253, 0.48) !important;
    transform: translateY(-1px);
}

/* Текст внутри карточек Дополнительно */
body.dark-theme .extra-menu-tile-final h3,
body.dark-theme .extra-menu-tile-final strong,
body.dark-theme .extra-menu-card h3,
body.dark-theme .extra-card h3 {
    color: #e5efff !important;
}

body.dark-theme .extra-menu-tile-final p,
body.dark-theme .extra-menu-subtitle,
body.dark-theme .extra-menu-card p,
body.dark-theme .extra-card p {
    color: #cbd5e1 !important;
}

/* Рабочие кнопки действий: сохранить смысловые цвета */
body.dark-theme button[onclick*="writeOff"],
body.dark-theme button[onclick*="write_off"],
body.dark-theme button[onclick*="spis"],
body.dark-theme .danger-btn {
    background: rgba(127, 29, 29, 0.74) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.42) !important;
}

body.dark-theme button[onclick*="repair"],
body.dark-theme button[onclick*="outgoingRepair"] {
    background: rgba(71, 85, 105, 0.92) !important;
    color: #e2e8f0 !important;
    border-color: rgba(148, 163, 184, 0.38) !important;
}

body.dark-theme button[onclick*="incoming"],
body.dark-theme button[onclick*="addStock"],
body.dark-theme button[onclick*="return"] {
    background: rgba(22, 101, 52, 0.68) !important;
    color: #dcfce7 !important;
    border-color: rgba(74, 222, 128, 0.40) !important;
}

/* ===== END DISPLAYSTOCK DARK THEME NAV CARD POLISH FINAL ===== */

/* ===== DISPLAYSTOCK DARK THEME SMALL FIXES 2026-06-01 ===== */

/* Меню: "Приход / возврат" не должен быть зелёным, он как обычный пункт */
body.dark-theme .nav-buttons button[onclick*="incoming"],
body.dark-theme .nav-buttons button[onclick*="return"],
body.dark-theme button[onclick*="showPage('incoming')"],
body.dark-theme button[onclick*='showPage("incoming")'],
body.dark-theme button[onclick*="showPage('return')"],
body.dark-theme button[onclick*='showPage("return")'] {
    background: rgba(15, 23, 42, 0.82) !important;
    color: #dbeafe !important;
    border: 1px solid rgba(96, 165, 250, 0.34) !important;
}

/* Если активен - пусть будет как остальные активные, синим */
body.dark-theme .nav-buttons button.active[onclick*="incoming"],
body.dark-theme .nav-buttons button.active-nav-button[onclick*="incoming"],
body.dark-theme .nav-buttons button.active[onclick*="return"],
body.dark-theme .nav-buttons button.active-nav-button[onclick*="return"] {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(29, 78, 216, 0.78)) !important;
    color: #ffffff !important;
    border-color: rgba(191, 219, 254, 0.78) !important;
}

/* Расход в ремонт тоже красный, как действие списания/расхода */
body.dark-theme button[onclick*="repair"],
body.dark-theme button[onclick*="Repair"],
body.dark-theme button[onclick*="outgoingRepair"],
body.dark-theme button[onclick*="writeOffRepair"],
body.dark-theme button[onclick*="spisatRepair"] {
    background: rgba(127, 29, 29, 0.72) !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.42) !important;
}

/* При этом кнопки найти/обновить/обычные secondary не красим случайно */
body.dark-theme button[onclick*="search"],
body.dark-theme button[onclick*="Search"],
body.dark-theme button[id*="search"],
body.dark-theme button[id*="Search"] {
    background: rgba(71, 85, 105, 0.92) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.38) !important;
}

/* ===== END DISPLAYSTOCK DARK THEME SMALL FIXES 2026-06-01 ===== */

/* ===== DISPLAYSTOCK DARK BUTTON FINAL FIXES 2026-06-01 ===== */

/* Верхнее меню: Приход / возврат как обычный пункт, не зелёный */
body.dark-theme .nav-buttons button[onclick*="incoming"],
body.dark-theme .nav-buttons button[onclick*="return"],
body.dark-theme button[onclick*="showPage('incoming')"],
body.dark-theme button[onclick*='showPage("incoming")'],
body.dark-theme button[onclick*="showPage('return')"],
body.dark-theme button[onclick*='showPage("return")'] {
    background: rgba(15, 23, 42, 0.82) !important;
    color: #dbeafe !important;
    border: 1px solid rgba(96, 165, 250, 0.34) !important;
}

/* Активный пункт меню всегда синий */
body.dark-theme .nav-buttons button.active[onclick*="incoming"],
body.dark-theme .nav-buttons button.active-nav-button[onclick*="incoming"],
body.dark-theme .nav-buttons button.active[onclick*="return"],
body.dark-theme .nav-buttons button.active-nav-button[onclick*="return"],
body.dark-theme button.active[onclick*="showPage('incoming')"],
body.dark-theme button.active-nav-button[onclick*="showPage('incoming')"],
body.dark-theme button.active[onclick*="showPage('return')"],
body.dark-theme button.active-nav-button[onclick*="showPage('return')"] {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(29, 78, 216, 0.78)) !important;
    color: #ffffff !important;
    border-color: rgba(191, 219, 254, 0.78) !important;
}

/* Все кнопки "Найти" в тёмной теме - нейтральные серо-синие */
body.dark-theme button[onclick*="search"],
body.dark-theme button[onclick*="Search"],
body.dark-theme button[id*="search"],
body.dark-theme button[id*="Search"],
body.dark-theme .search-button,
body.dark-theme .find-button {
    background: rgba(51, 65, 85, 0.96) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.42) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 6px 14px rgba(0, 0, 0, 0.14) !important;
}

/* Кнопка "Обновить" в актуальности инвентаризации - такой же приятный нейтральный стиль */
body.dark-theme #inventoryActualityRefreshButton,
body.dark-theme #inventoryFreshnessRefreshButton,
body.dark-theme button[onclick*="refreshInventoryActuality"],
body.dark-theme button[onclick*="loadInventoryActuality"] {
    background: rgba(51, 65, 85, 0.96) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.42) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 6px 14px rgba(0, 0, 0, 0.14) !important;
}

/* Списать в ремонт тоже красным */
body.dark-theme button[onclick*="repair"],
body.dark-theme button[onclick*="Repair"],
body.dark-theme button[onclick*="outgoingRepair"],
body.dark-theme button[onclick*="writeOffRepair"],
body.dark-theme button[onclick*="spisatRepair"],
body.dark-theme button[onclick*="repairWriteOff"] {
    background: rgba(127, 29, 29, 0.74) !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.44) !important;
}

/* ===== END DISPLAYSTOCK DARK BUTTON FINAL FIXES 2026-06-01 ===== */

/* ===== DISPLAYSTOCK DARK CLASSIFIED BUTTONS 2026-06-01 ===== */

/* Кнопки "Найти" - нейтральные серые */
body.dark-theme button.ds-dark-find-button,
html.dark-theme button.ds-dark-find-button,
.dark-theme button.ds-dark-find-button {
    background: rgba(51, 65, 85, 0.96) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.42) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 6px 14px rgba(0, 0, 0, 0.14) !important;
}

body.dark-theme button.ds-dark-find-button:hover,
html.dark-theme button.ds-dark-find-button:hover,
.dark-theme button.ds-dark-find-button:hover {
    background: rgba(71, 85, 105, 0.98) !important;
    color: #ffffff !important;
    border-color: rgba(203, 213, 225, 0.54) !important;
}

/* Пункт меню "Приход / возврат" - обычный, не зелёный */
body.dark-theme button.ds-dark-nav-neutral-button,
html.dark-theme button.ds-dark-nav-neutral-button,
.dark-theme button.ds-dark-nav-neutral-button {
    background: rgba(15, 23, 42, 0.82) !important;
    color: #dbeafe !important;
    border: 1px solid rgba(96, 165, 250, 0.34) !important;
}

body.dark-theme button.ds-dark-nav-neutral-button:hover,
html.dark-theme button.ds-dark-nav-neutral-button:hover,
.dark-theme button.ds-dark-nav-neutral-button:hover {
    background: rgba(30, 64, 175, 0.48) !important;
    color: #ffffff !important;
    border-color: rgba(147, 197, 253, 0.62) !important;
}

/* Если "Приход / возврат" активен - он синий, как остальные активные */
body.dark-theme button.ds-dark-nav-neutral-button.active,
body.dark-theme button.ds-dark-nav-neutral-button.active-nav-button,
html.dark-theme button.ds-dark-nav-neutral-button.active,
html.dark-theme button.ds-dark-nav-neutral-button.active-nav-button,
.dark-theme button.ds-dark-nav-neutral-button.active,
.dark-theme button.ds-dark-nav-neutral-button.active-nav-button {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(29, 78, 216, 0.78)) !important;
    color: #ffffff !important;
    border-color: rgba(191, 219, 254, 0.78) !important;
}

/* "Списать в ремонт" - красная */
body.dark-theme button.ds-dark-danger-button,
html.dark-theme button.ds-dark-danger-button,
.dark-theme button.ds-dark-danger-button {
    background: rgba(127, 29, 29, 0.74) !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.44) !important;
}

body.dark-theme button.ds-dark-danger-button:hover,
html.dark-theme button.ds-dark-danger-button:hover,
.dark-theme button.ds-dark-danger-button:hover {
    background: rgba(153, 27, 27, 0.86) !important;
    color: #ffffff !important;
    border-color: rgba(252, 165, 165, 0.58) !important;
}

/* Обновить в актуальности инвентаризации - приятная нейтральная */
body.dark-theme button.ds-dark-neutral-update-button,
html.dark-theme button.ds-dark-neutral-update-button,
.dark-theme button.ds-dark-neutral-update-button {
    background: rgba(51, 65, 85, 0.96) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.42) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 6px 14px rgba(0, 0, 0, 0.14) !important;
}

/* Сверка 1С: чуть темнее фон, чтобы не выбивалась */
body.dark-theme [data-page="onec"],
body.dark-theme [data-page="onec"] .card,
body.dark-theme [data-page="onec"] section,
body.dark-theme [data-page="onec"] > div,
body.dark-theme #onecJobStatus,
body.dark-theme #onecCompactTop,
body.dark-theme #onecCompactMeta,
body.dark-theme #onecXlsxStatus,
body.dark-theme #onecHowItWorks {
    background-color: rgba(15, 23, 42, 0.90) !important;
    background-image: none !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.20) !important;
}

/* ===== END DISPLAYSTOCK DARK CLASSIFIED BUTTONS 2026-06-01 ===== */

/* ===== DISPLAYSTOCK DARK CLASSIFIED BUTTON PRIORITY FIX ===== */

/* Эти правила стоят последними и перебивают старые ds-target-blue/yellow/red */

/* Все "Найти" в тёмной теме - нейтральные серые, даже если у них есть ds-target-blue */
html.dark-theme body.dark-theme button.ds-dark-find-button,
html.dark-theme body.dark-theme button.ds-dark-find-button.ds-target-blue,
html.dark-theme body.dark-theme button.ds-dark-find-button.ds-target-yellow,
html.dark-theme body.dark-theme button.ds-dark-find-button.ds-target-red,
body.dark-theme button.ds-dark-find-button,
body.dark-theme button.ds-dark-find-button.ds-target-blue,
body.dark-theme button.ds-dark-find-button.ds-target-yellow,
body.dark-theme button.ds-dark-find-button.ds-target-red {
    background: rgba(51, 65, 85, 0.96) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.42) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 6px 14px rgba(0, 0, 0, 0.14) !important;
}

html.dark-theme body.dark-theme button.ds-dark-find-button:hover,
body.dark-theme button.ds-dark-find-button:hover {
    background: rgba(71, 85, 105, 0.98) !important;
    color: #ffffff !important;
    border-color: rgba(203, 213, 225, 0.56) !important;
}

/* "Приход / возврат" в верхнем меню - обычный пункт, даже если старые правила хотят зелёный */
html.dark-theme body.dark-theme button.ds-dark-nav-neutral-button,
body.dark-theme button.ds-dark-nav-neutral-button {
    background: rgba(15, 23, 42, 0.82) !important;
    color: #dbeafe !important;
    border: 1px solid rgba(96, 165, 250, 0.34) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 6px 14px rgba(0, 0, 0, 0.18) !important;
}

html.dark-theme body.dark-theme button.ds-dark-nav-neutral-button:hover,
body.dark-theme button.ds-dark-nav-neutral-button:hover {
    background: rgba(30, 64, 175, 0.48) !important;
    color: #ffffff !important;
    border-color: rgba(147, 197, 253, 0.62) !important;
}

html.dark-theme body.dark-theme button.ds-dark-nav-neutral-button.active,
html.dark-theme body.dark-theme button.ds-dark-nav-neutral-button.active-nav-button,
body.dark-theme button.ds-dark-nav-neutral-button.active,
body.dark-theme button.ds-dark-nav-neutral-button.active-nav-button {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(29, 78, 216, 0.78)) !important;
    color: #ffffff !important;
    border-color: rgba(191, 219, 254, 0.78) !important;
}

/* "Списать в ремонт" - красный, даже если у него есть ds-target-red */
html.dark-theme body.dark-theme button.ds-dark-danger-button,
html.dark-theme body.dark-theme button.ds-dark-danger-button.ds-target-red,
html.dark-theme body.dark-theme button.ds-dark-danger-button.ds-target-blue,
body.dark-theme button.ds-dark-danger-button,
body.dark-theme button.ds-dark-danger-button.ds-target-red,
body.dark-theme button.ds-dark-danger-button.ds-target-blue {
    background: rgba(127, 29, 29, 0.74) !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.44) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 6px 14px rgba(0, 0, 0, 0.16) !important;
}

html.dark-theme body.dark-theme button.ds-dark-danger-button:hover,
body.dark-theme button.ds-dark-danger-button:hover {
    background: rgba(153, 27, 27, 0.88) !important;
    color: #ffffff !important;
    border-color: rgba(252, 165, 165, 0.58) !important;
}

/* Обновить в актуальности инвентаризации - нейтральная */
html.dark-theme body.dark-theme button.ds-dark-neutral-update-button,
body.dark-theme button.ds-dark-neutral-update-button {
    background: rgba(51, 65, 85, 0.96) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.42) !important;
}

/* ===== END DISPLAYSTOCK DARK CLASSIFIED BUTTON PRIORITY FIX ===== */

/* ===== DISPLAYSTOCK DARK INVENTORY ACTIONS FIX 2026-06-01 ===== */

/* Инвентаризация: в колонке "Действие" не должно быть отдельной плашки под кнопками */
body.dark-theme #inventoryScanTable td:last-child,
body.dark-theme #inventoryScanTable td:last-child > div,
body.dark-theme #inventoryScanTable td:last-child .inventory-actions,
body.dark-theme #inventoryScanTable td:last-child .inventory-action-buttons,
body.dark-theme #inventoryScanTable td:last-child .action-buttons,
body.dark-theme #inventoryScanTable td:last-child .actions {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* Важно: внутренний контейнер с кнопками всегда прозрачный, даже в зелёной/красной строке */
body.dark-theme #inventoryScanTable tr.inventory-scan-row-ok-live td:last-child > div,
body.dark-theme #inventoryScanTable tr.inventory-scan-row-diff-live td:last-child > div,
body.dark-theme #inventoryScanTable tr.inventory-scan-row-ok-live td:last-child .inventory-actions,
body.dark-theme #inventoryScanTable tr.inventory-scan-row-diff-live td:last-child .inventory-actions,
body.dark-theme #inventoryScanTable tr.inventory-scan-row-ok-live td:last-child .action-buttons,
body.dark-theme #inventoryScanTable tr.inventory-scan-row-diff-live td:last-child .action-buttons {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}

/* Сама ячейка колонки действий наследует цвет строки, но без отдельного блока */
body.dark-theme #inventoryScanTable tr.inventory-scan-row-ok-live td:last-child {
    background: rgba(20, 83, 45, 0.48) !important;
    color: #bbf7d0 !important;
}

body.dark-theme #inventoryScanTable tr.inventory-scan-row-diff-live td:last-child {
    background: rgba(127, 29, 29, 0.46) !important;
    color: #fecaca !important;
}

/* Кнопки внутри действий */
body.dark-theme #inventoryScanTable td:last-child button {
    min-height: 34px;
    border-radius: 13px !important;
    background: rgba(30, 41, 59, 0.88) !important;
    color: #dbeafe !important;
    border: 1px solid rgba(96, 165, 250, 0.38) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 4px 10px rgba(0, 0, 0, 0.14) !important;
}

/* +1 */
body.dark-theme #inventoryScanTable td:last-child button:first-child {
    background: rgba(22, 101, 52, 0.62) !important;
    color: #dcfce7 !important;
    border-color: rgba(74, 222, 128, 0.42) !important;
}

/* -1 */
body.dark-theme #inventoryScanTable td:last-child button:nth-child(2) {
    background: rgba(127, 29, 29, 0.58) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.42) !important;
}

/* Задать */
body.dark-theme #inventoryScanTable td:last-child button:nth-child(3) {
    background: rgba(30, 64, 175, 0.40) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.48) !important;
}

/* Движение disabled */
body.dark-theme #inventoryScanTable td:last-child button:disabled,
body.dark-theme #inventoryScanTable td:last-child button[disabled] {
    background: rgba(30, 41, 59, 0.42) !important;
    color: rgba(203, 213, 225, 0.58) !important;
    border-color: rgba(96, 165, 250, 0.20) !important;
    opacity: 1 !important;
    cursor: not-allowed !important;
}

/* ===== END DISPLAYSTOCK DARK INVENTORY ACTIONS FIX 2026-06-01 ===== */

/* ===== DISPLAYSTOCK DARK INVENTORY STATUS COLORS FIX 2026-06-01 ===== */

/*
   Тёмная тема: возвращаем смысловую подсветку инвентаризации.
   Важно: эти правила стоят после общих dark-таблиц и перебивают их.
*/

/* Журнал инвентаризаций: строки/ячейки без расхождений */
body.dark-theme table tr.inventory-ok td,
body.dark-theme table tr.inventory-scan-row-ok-live td,
body.dark-theme #inventoryScanTable tr.inventory-scan-row-ok-live td,
body.dark-theme #inventoryScanTable tr.inventory-scan-row-ok-live > td,
body.dark-theme tr.inventory-scan-row-ok-live > td {
    background: rgba(20, 83, 45, 0.48) !important;
    color: #bbf7d0 !important;
    border-color: rgba(74, 222, 128, 0.24) !important;
}

/* Журнал инвентаризаций: строки/ячейки с расхождениями */
body.dark-theme table tr.inventory-diff td,
body.dark-theme table tr.inventory-scan-row-diff-live td,
body.dark-theme #inventoryScanTable tr.inventory-scan-row-diff-live td,
body.dark-theme #inventoryScanTable tr.inventory-scan-row-diff-live > td,
body.dark-theme tr.inventory-scan-row-diff-live > td {
    background: rgba(127, 29, 29, 0.48) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.24) !important;
}

/* Статус "Сошлось" */
body.dark-theme .inventory-status-ok,
body.dark-theme .inventory-ok,
body.dark-theme .status-ok,
body.dark-theme .ok,
body.dark-theme td.ok,
body.dark-theme td.status-ok,
body.dark-theme span.ok,
body.dark-theme span.status-ok {
    background: rgba(20, 83, 45, 0.62) !important;
    color: #dcfce7 !important;
    border-color: rgba(74, 222, 128, 0.34) !important;
    font-weight: 800 !important;
}

/* Статус "Есть расхождения" / "Не сошлось" */
body.dark-theme .inventory-status-diff,
body.dark-theme .inventory-diff,
body.dark-theme .status-diff,
body.dark-theme .not-ok,
body.dark-theme .diff,
body.dark-theme td.diff,
body.dark-theme td.status-diff,
body.dark-theme span.diff,
body.dark-theme span.status-diff {
    background: rgba(127, 29, 29, 0.62) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.34) !important;
    font-weight: 800 !important;
}

/* Колонка/ячейка "Расхождения": 0 зелёным */
body.dark-theme #inventoryScanTable td.inventory-diff-zero,
body.dark-theme #inventoryScanTable td.inventory-diff-ok,
body.dark-theme #inventoryScanTable td.stock-ok,
body.dark-theme #inventoryScanTable span.stock-ok,
body.dark-theme td.inventory-diff-zero,
body.dark-theme td.inventory-diff-ok {
    background: rgba(20, 83, 45, 0.62) !important;
    color: #dcfce7 !important;
    border-color: rgba(74, 222, 128, 0.34) !important;
    font-weight: 800 !important;
}

/* Колонка/ячейка "Расхождения": не 0 красным */
body.dark-theme #inventoryScanTable td.inventory-diff-nonzero,
body.dark-theme #inventoryScanTable td.inventory-diff-bad,
body.dark-theme #inventoryScanTable td.stock-low,
body.dark-theme #inventoryScanTable span.stock-low,
body.dark-theme td.inventory-diff-nonzero,
body.dark-theme td.inventory-diff-bad {
    background: rgba(127, 29, 29, 0.62) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.34) !important;
    font-weight: 800 !important;
}

/* Если расхождения выводятся просто классами success/danger/warning */
body.dark-theme #inventoryScanTable .success,
body.dark-theme #inventoryScanTable .stock-ok,
body.dark-theme #inventoryScanTable .green,
body.dark-theme #inventoryScanTable .matched {
    background: rgba(20, 83, 45, 0.62) !important;
    color: #dcfce7 !important;
    border-color: rgba(74, 222, 128, 0.34) !important;
    font-weight: 800 !important;
}

body.dark-theme #inventoryScanTable .danger,
body.dark-theme #inventoryScanTable .error,
body.dark-theme #inventoryScanTable .stock-low,
body.dark-theme #inventoryScanTable .red,
body.dark-theme #inventoryScanTable .mismatch,
body.dark-theme #inventoryScanTable .warning {
    background: rgba(127, 29, 29, 0.62) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.34) !important;
    font-weight: 800 !important;
}

/* Журнал снизу: статус и расхождения тоже должны быть цветными */
body.dark-theme table td:nth-child(6),
body.dark-theme table td:nth-child(7) {
    font-weight: 700;
}

body.dark-theme table td:nth-child(6).stock-ok,
body.dark-theme table td:nth-child(6).ok,
body.dark-theme table td:nth-child(7).stock-ok,
body.dark-theme table td:nth-child(7).ok {
    background: rgba(20, 83, 45, 0.62) !important;
    color: #dcfce7 !important;
}

body.dark-theme table td:nth-child(6).stock-low,
body.dark-theme table td:nth-child(6).diff,
body.dark-theme table td:nth-child(7).stock-low,
body.dark-theme table td:nth-child(7).diff {
    background: rgba(127, 29, 29, 0.62) !important;
    color: #fecaca !important;
}

/* ===== END DISPLAYSTOCK DARK INVENTORY STATUS COLORS FIX 2026-06-01 ===== */

/* ===== DISPLAYSTOCK DARK INVENTORY ALERT BLOCK COLORS 2026-06-01 ===== */

/* ВАЖНО: эти правила красят весь информационный блок, а не только текст */

body.dark-theme .ds-inventory-alert-ok,
body.dark-theme #inventoryScanResult .ds-inventory-alert-ok,
body.dark-theme #inventoryCurrentStatus .ds-inventory-alert-ok {
    background: rgba(20, 83, 45, 0.62) !important;
    background-image: none !important;
    color: #dcfce7 !important;
    border: 1px solid rgba(74, 222, 128, 0.42) !important;
    box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.08), 0 10px 22px rgba(0, 0, 0, 0.18) !important;
}

body.dark-theme .ds-inventory-alert-diff,
body.dark-theme #inventoryScanResult .ds-inventory-alert-diff,
body.dark-theme #inventoryCurrentStatus .ds-inventory-alert-diff {
    background: rgba(127, 29, 29, 0.62) !important;
    background-image: none !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.46) !important;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.08), 0 10px 22px rgba(0, 0, 0, 0.18) !important;
}

body.dark-theme .ds-inventory-alert-not-found,
body.dark-theme #inventoryScanResult .ds-inventory-alert-not-found,
body.dark-theme #inventoryCurrentStatus .ds-inventory-alert-not-found,
body.dark-theme #inventoryScanTable .ds-inventory-alert-not-found {
    background: rgba(127, 29, 29, 0.68) !important;
    background-image: none !important;
    color: #fecaca !important;
    border: 2px solid rgba(248, 113, 113, 0.56) !important;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.10), 0 12px 26px rgba(127, 29, 29, 0.18) !important;
}

/* Внутренний текст наследует цвет блока */
body.dark-theme .ds-inventory-alert-ok *,
body.dark-theme .ds-inventory-alert-diff *,
body.dark-theme .ds-inventory-alert-not-found * {
    color: inherit !important;
}

/* Артикул внутри "ТОВАР НЕ НАЙДЕН" можно оставить ярко-красным */
body.dark-theme .ds-inventory-alert-not-found strong,
body.dark-theme .ds-inventory-alert-not-found b {
    color: #fecaca !important;
}

/* Если статусная строка является самой плашкой */
body.dark-theme #inventoryScanResult.ds-inventory-alert-ok,
body.dark-theme #inventoryCurrentStatus.ds-inventory-alert-ok {
    background: rgba(20, 83, 45, 0.62) !important;
    color: #dcfce7 !important;
    border-color: rgba(74, 222, 128, 0.42) !important;
}

body.dark-theme #inventoryScanResult.ds-inventory-alert-diff,
body.dark-theme #inventoryCurrentStatus.ds-inventory-alert-diff,
body.dark-theme #inventoryScanResult.ds-inventory-alert-not-found,
body.dark-theme #inventoryCurrentStatus.ds-inventory-alert-not-found {
    background: rgba(127, 29, 29, 0.62) !important;
    color: #fecaca !important;
    border-color: rgba(248, 113, 113, 0.46) !important;
}

/* ===== END DISPLAYSTOCK DARK INVENTORY ALERT BLOCK COLORS 2026-06-01 ===== */

/* ===== DISPLAYSTOCK DARK EXACT INVENTORY ALERT COLORS 2026-06-01 ===== */

/* Инвентаризация: весь блок "Всё сошлось..." зелёный */
body.dark-theme #inventoryScanResult.inventory-live-status-ok,
body.dark-theme .inventory-live-status-ok {
    background: rgba(20, 83, 45, 0.72) !important;
    background-image: none !important;
    color: #dcfce7 !important;
    border: 1px solid rgba(74, 222, 128, 0.48) !important;
    box-shadow:
        0 0 0 1px rgba(74, 222, 128, 0.10),
        0 10px 22px rgba(0, 0, 0, 0.18) !important;
}

/* Инвентаризация: весь блок "Есть расхождения..." красный */
body.dark-theme #inventoryScanResult.inventory-live-status-diff,
body.dark-theme .inventory-live-status-diff {
    background: rgba(127, 29, 29, 0.72) !important;
    background-image: none !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.52) !important;
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.10),
        0 10px 22px rgba(0, 0, 0, 0.18) !important;
}

/* Инвентаризация: большой блок "ТОВАР НЕ НАЙДЕН" красный полностью */
body.dark-theme #inventoryNotFoundInlineMessage,
body.dark-theme .inventory-not-found-inline,
body.dark-theme .inventory-not-found-inline-big {
    background: rgba(127, 29, 29, 0.74) !important;
    background-image: none !important;
    color: #fecaca !important;
    border: 2px solid rgba(248, 113, 113, 0.58) !important;
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.12),
        0 12px 26px rgba(127, 29, 29, 0.20) !important;
}

/* Текст внутри "ТОВАР НЕ НАЙДЕН" */
body.dark-theme #inventoryNotFoundInlineMessage *,
body.dark-theme .inventory-not-found-inline *,
body.dark-theme .inventory-not-found-inline-big * {
    color: #fecaca !important;
}

/* Сам артикул внутри not found можно сделать ярче */
body.dark-theme #inventoryNotFoundInlineMessage span,
body.dark-theme .inventory-not-found-inline span,
body.dark-theme .inventory-not-found-inline-big span {
    color: #fca5a5 !important;
    font-weight: 900 !important;
}

/* Чтобы общие dark-правила не перебивали эти плашки */
body.dark-theme #inventoryScanResult.inventory-live-status-ok *,
body.dark-theme #inventoryScanResult.inventory-live-status-diff * {
    color: inherit !important;
}

/* ===== END DISPLAYSTOCK DARK EXACT INVENTORY ALERT COLORS 2026-06-01 ===== */

/* ===== DISPLAYSTOCK DARK INVENTORY SCAN RESULT STATUS COLORS 2026-06-01 ===== */

/* Весь блок статуса текущей инвентаризации: всё сошлось */
body.dark-theme #inventoryScanResult.ds-inventory-scan-result-ok {
    background: rgba(20, 83, 45, 0.72) !important;
    background-image: none !important;
    color: #dcfce7 !important;
    border: 1px solid rgba(74, 222, 128, 0.50) !important;
    box-shadow:
        0 0 0 1px rgba(74, 222, 128, 0.10),
        0 10px 22px rgba(0, 0, 0, 0.18) !important;
}

/* Весь блок статуса текущей инвентаризации: есть расхождения */
body.dark-theme #inventoryScanResult.ds-inventory-scan-result-diff {
    background: rgba(127, 29, 29, 0.72) !important;
    background-image: none !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.54) !important;
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.10),
        0 10px 22px rgba(0, 0, 0, 0.18) !important;
}

/* На всякий случай: товар не найден тоже целиком красный */
body.dark-theme #inventoryScanResult.ds-inventory-scan-result-not-found {
    background: rgba(127, 29, 29, 0.74) !important;
    background-image: none !important;
    color: #fecaca !important;
    border: 2px solid rgba(248, 113, 113, 0.58) !important;
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.12),
        0 12px 26px rgba(127, 29, 29, 0.20) !important;
}

body.dark-theme #inventoryScanResult.ds-inventory-scan-result-ok *,
body.dark-theme #inventoryScanResult.ds-inventory-scan-result-diff *,
body.dark-theme #inventoryScanResult.ds-inventory-scan-result-not-found * {
    color: inherit !important;
}

/* ===== END DISPLAYSTOCK DARK INVENTORY SCAN RESULT STATUS COLORS 2026-06-01 ===== */

/* ===== DISPLAYSTOCK UNIVERSAL INVENTORY STATUS HIGHLIGHT COLORS 2026-06-01 ===== */

body.dark-theme .ds-inv-status-ok-box {
    background: rgba(20, 83, 45, 0.72) !important;
    background-image: none !important;
    color: #dcfce7 !important;
    border: 1px solid rgba(74, 222, 128, 0.52) !important;
    box-shadow:
        0 0 0 1px rgba(74, 222, 128, 0.10),
        0 10px 22px rgba(0, 0, 0, 0.18) !important;
}

body.dark-theme .ds-inv-status-diff-box,
body.dark-theme .ds-inv-status-not-found-box {
    background: rgba(127, 29, 29, 0.74) !important;
    background-image: none !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.56) !important;
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.12),
        0 10px 22px rgba(0, 0, 0, 0.18) !important;
}

body.dark-theme .ds-inv-status-not-found-box {
    border-width: 2px !important;
}

body.dark-theme .ds-inv-status-ok-box *,
body.dark-theme .ds-inv-status-diff-box *,
body.dark-theme .ds-inv-status-not-found-box * {
    color: inherit !important;
}

/* ===== END DISPLAYSTOCK UNIVERSAL INVENTORY STATUS HIGHLIGHT COLORS 2026-06-01 ===== */

/* ===== DISPLAYSTOCK DARK INVENTORY LIVE STATUS FINAL FIX 2026-06-01 ===== */

/* Реальный блок статуса текущей проверки */
body.dark-theme #inventoryLiveStatusFinal.inventory-live-status-ok,
body.dark-theme #inventoryLiveStatusFinal.ds-inv-status-ok-box,
body.dark-theme .inventory-live-status-ok.ds-inv-status-ok-box {
    background: rgba(20, 83, 45, 0.74) !important;
    background-image: none !important;
    color: #dcfce7 !important;
    border: 1px solid rgba(74, 222, 128, 0.52) !important;
    box-shadow:
        0 0 0 1px rgba(74, 222, 128, 0.12),
        0 10px 22px rgba(0, 0, 0, 0.18) !important;
}

body.dark-theme #inventoryLiveStatusFinal.inventory-live-status-diff,
body.dark-theme #inventoryLiveStatusFinal.ds-inv-status-diff-box,
body.dark-theme .inventory-live-status-diff.ds-inv-status-diff-box {
    background: rgba(127, 29, 29, 0.74) !important;
    background-image: none !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.56) !important;
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.12),
        0 10px 22px rgba(0, 0, 0, 0.18) !important;
}

/* Весь текст внутри статусного блока наследует цвет */
body.dark-theme #inventoryLiveStatusFinal.inventory-live-status-ok *,
body.dark-theme #inventoryLiveStatusFinal.inventory-live-status-diff *,
body.dark-theme #inventoryLiveStatusFinal.ds-inv-status-ok-box *,
body.dark-theme #inventoryLiveStatusFinal.ds-inv-status-diff-box * {
    color: inherit !important;
}

/* Товар не найден */
body.dark-theme #inventoryNotFoundInlineMessage,
body.dark-theme .inventory-not-found-inline,
body.dark-theme .inventory-not-found-inline-big,
body.dark-theme .ds-inv-status-not-found-box {
    background: rgba(127, 29, 29, 0.74) !important;
    background-image: none !important;
    color: #fecaca !important;
    border: 2px solid rgba(248, 113, 113, 0.58) !important;
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.12),
        0 12px 26px rgba(127, 29, 29, 0.20) !important;
}

body.dark-theme #inventoryNotFoundInlineMessage *,
body.dark-theme .inventory-not-found-inline *,
body.dark-theme .inventory-not-found-inline-big *,
body.dark-theme .ds-inv-status-not-found-box * {
    color: inherit !important;
}

/* ===== END DISPLAYSTOCK DARK INVENTORY LIVE STATUS FINAL FIX 2026-06-01 ===== */

/* ===== DISPLAYSTOCK INVENTORY ALERT INNER FILL FIX 2026-06-03 ===== */
/* Убирает тёмную внутреннюю полоску внутри красного блока "Не найдено" */
.ds-inventory-alert-not-found *,
#inventoryScanResult.scanner-error *,
#inventoryScanResult .ds-inventory-alert-not-found * {
    background: transparent !important;
    background-color: transparent !important;
}

.ds-inventory-alert-not-found div,
.ds-inventory-alert-not-found p,
.ds-inventory-alert-not-found span,
#inventoryScanResult.scanner-error div,
#inventoryScanResult.scanner-error p,
#inventoryScanResult.scanner-error span {
    background: transparent !important;
    background-color: transparent !important;
}

/* На случай если код оказался внутри pre/code */
.ds-inventory-alert-not-found pre,
.ds-inventory-alert-not-found code,
#inventoryScanResult.scanner-error pre,
#inventoryScanResult.scanner-error code {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
}

/* ===== DISPLAYSTOCK MOVEMENT EDIT MODAL DARK THEME FIX 2026-06-03 ===== */
/* Исправляет светлую модалку редактирования движения в тёмной теме */

body.dark-theme #movementModal .modal-content,
body.dark-theme #movementEditModal .modal-content,
body.dark-theme .movement-modal .modal-content {
    background: #111827 !important;
    color: #e5e7eb !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55) !important;
}

body.dark-theme #movementModal h1,
body.dark-theme #movementModal h2,
body.dark-theme #movementModal h3,
body.dark-theme #movementEditModal h1,
body.dark-theme #movementEditModal h2,
body.dark-theme #movementEditModal h3,
body.dark-theme .movement-modal h1,
body.dark-theme .movement-modal h2,
body.dark-theme .movement-modal h3 {
    color: #f8fafc !important;
}

body.dark-theme #movementModal label,
body.dark-theme #movementModal .form-label,
body.dark-theme #movementModal .hint,
body.dark-theme #movementModal small,
body.dark-theme #movementEditModal label,
body.dark-theme #movementEditModal .form-label,
body.dark-theme #movementEditModal .hint,
body.dark-theme #movementEditModal small,
body.dark-theme .movement-modal label,
body.dark-theme .movement-modal .form-label,
body.dark-theme .movement-modal .hint,
body.dark-theme .movement-modal small {
    color: #cbd5e1 !important;
}

body.dark-theme #movementModal input,
body.dark-theme #movementModal select,
body.dark-theme #movementModal textarea,
body.dark-theme #movementEditModal input,
body.dark-theme #movementEditModal select,
body.dark-theme #movementEditModal textarea,
body.dark-theme .movement-modal input,
body.dark-theme .movement-modal select,
body.dark-theme .movement-modal textarea {
    background: #1f2937 !important;
    color: #f8fafc !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

body.dark-theme #movementModal input::placeholder,
body.dark-theme #movementModal textarea::placeholder,
body.dark-theme #movementEditModal input::placeholder,
body.dark-theme #movementEditModal textarea::placeholder,
body.dark-theme .movement-modal input::placeholder,
body.dark-theme .movement-modal textarea::placeholder {
    color: #94a3b8 !important;
}

body.dark-theme #movementModal select option,
body.dark-theme #movementEditModal select option,
body.dark-theme .movement-modal select option {
    background: #1f2937 !important;
    color: #f8fafc !important;
}

body.dark-theme #movementModal .secondary-btn,
body.dark-theme #movementEditModal .secondary-btn,
body.dark-theme .movement-modal .secondary-btn {
    background: #334155 !important;
    color: #f8fafc !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
}

body.dark-theme #movementModal .danger-btn,
body.dark-theme #movementEditModal .danger-btn,
body.dark-theme .movement-modal .danger-btn {
    background: #b91c1c !important;
    color: #fff !important;
    border: 1px solid rgba(248, 113, 113, 0.45) !important;
}

body.dark-theme #movementModal .danger-btn:hover,
body.dark-theme #movementEditModal .danger-btn:hover,
body.dark-theme .movement-modal .danger-btn:hover {
    background: #dc2626 !important;
}

/* ===== DISPLAYSTOCK MOVEMENT MODAL CARD DARK FIX 2026-06-03 ===== */
/* Модалка редактирования движения использует .modal-card, а не .modal-content */

body.dark-theme #movementModal .modal-card,
body.dark-theme #movementEditModal .modal-card,
body.dark-theme .movement-modal .modal-card,
body.dark-theme .modal-card:has(#editMovementId),
body.dark-theme .modal-card:has(#editMovementProductId) {
    background: #111827 !important;
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55) !important;
}

body.dark-theme #movementModal .modal-card h1,
body.dark-theme #movementModal .modal-card h2,
body.dark-theme #movementModal .modal-card h3,
body.dark-theme #movementEditModal .modal-card h1,
body.dark-theme #movementEditModal .modal-card h2,
body.dark-theme #movementEditModal .modal-card h3,
body.dark-theme .modal-card:has(#editMovementId) h1,
body.dark-theme .modal-card:has(#editMovementId) h2,
body.dark-theme .modal-card:has(#editMovementId) h3,
body.dark-theme .modal-card:has(#editMovementProductId) h1,
body.dark-theme .modal-card:has(#editMovementProductId) h2,
body.dark-theme .modal-card:has(#editMovementProductId) h3 {
    color: #f8fafc !important;
}

body.dark-theme #movementModal .modal-card label,
body.dark-theme #movementModal .modal-card small,
body.dark-theme #movementModal .modal-card .hint,
body.dark-theme #movementEditModal .modal-card label,
body.dark-theme #movementEditModal .modal-card small,
body.dark-theme #movementEditModal .modal-card .hint,
body.dark-theme .modal-card:has(#editMovementId) label,
body.dark-theme .modal-card:has(#editMovementId) small,
body.dark-theme .modal-card:has(#editMovementId) .hint,
body.dark-theme .modal-card:has(#editMovementProductId) label,
body.dark-theme .modal-card:has(#editMovementProductId) small,
body.dark-theme .modal-card:has(#editMovementProductId) .hint {
    color: #cbd5e1 !important;
}

body.dark-theme #movementModal .modal-card input,
body.dark-theme #movementModal .modal-card select,
body.dark-theme #movementModal .modal-card textarea,
body.dark-theme #movementEditModal .modal-card input,
body.dark-theme #movementEditModal .modal-card select,
body.dark-theme #movementEditModal .modal-card textarea,
body.dark-theme .modal-card:has(#editMovementId) input,
body.dark-theme .modal-card:has(#editMovementId) select,
body.dark-theme .modal-card:has(#editMovementId) textarea,
body.dark-theme .modal-card:has(#editMovementProductId) input,
body.dark-theme .modal-card:has(#editMovementProductId) select,
body.dark-theme .modal-card:has(#editMovementProductId) textarea {
    background: #1f2937 !important;
    color: #f8fafc !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

body.dark-theme #movementModal .modal-actions,
body.dark-theme #movementEditModal .modal-actions,
body.dark-theme .modal-card:has(#editMovementId) .modal-actions,
body.dark-theme .modal-card:has(#editMovementProductId) .modal-actions {
    background: transparent !important;
}

/* ===== DISPLAYSTOCK DARK MONTH CALENDAR ICON FIX 2026-06-03 ===== */
/* Делает видимой стандартную иконку календаря у input type="month/date" в тёмной теме */

body.dark-theme input[type="month"]::-webkit-calendar-picker-indicator,
body.dark-theme input[type="date"]::-webkit-calendar-picker-indicator,
body.dark-theme input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body.dark-theme #historyMonthInput::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.35) contrast(1.1) !important;
    opacity: 0.9 !important;
    cursor: pointer !important;
}

body.dark-theme input[type="month"]::-webkit-calendar-picker-indicator:hover,
body.dark-theme input[type="date"]::-webkit-calendar-picker-indicator:hover,
body.dark-theme input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
body.dark-theme #historyMonthInput::-webkit-calendar-picker-indicator:hover {
    opacity: 1 !important;
}

/* На всякий случай подчёркиваем, что само поле месяца в истории остаётся в тёмном стиле */
body.dark-theme #historyMonthInput {
    color-scheme: dark !important;
}

/* ===== DISPLAYSTOCK CUSTOM DARK MONTH CALENDAR ICON 2026-06-03 ===== */
/* Родная иконка input[type=month] в Яндекс/Chromium остаётся кликабельной, но рисуем свою светлую поверх фона */

body.dark-theme #historyMonthInput,
body.dark-theme input[type="month"] {
    color-scheme: dark !important;
    padding-right: 42px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 18px 18px !important;
}

/* Нативную иконку делаем невидимой, но область клика оставляем */
body.dark-theme #historyMonthInput::-webkit-calendar-picker-indicator,
body.dark-theme input[type="month"]::-webkit-calendar-picker-indicator {
    opacity: 0 !important;
    cursor: pointer !important;
    width: 34px !important;
    height: 100% !important;
}

/* Лёгкая подсветка при наведении на поле */
body.dark-theme #historyMonthInput:hover,
body.dark-theme input[type="month"]:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
}

/* ===== DISPLAYSTOCK MOBILE HEADER OVERFLOW FIX ===== */
@media (max-width: 640px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .pretty-app-header {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 8px 10px !important;
    }

    .header-user-card {
        flex: 1 1 132px !important;
        min-width: 0 !important;
        max-width: 168px !important;
    }

    .header-brand-card {
        flex: 1 1 160px !important;
        min-width: 0 !important;
        max-width: 210px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .header-brand-card h1 {
        font-size: 20px !important;
        letter-spacing: 0 !important;
    }

    .header-actions-card {
        flex: 0 1 auto !important;
        justify-self: auto !important;
        gap: 6px !important;
    }

    .theme-toggle-button {
        width: 48px !important;
        min-width: 48px !important;
    }

    .header-logout-card {
        min-width: 64px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .top-nav {
        padding: 10px 8px 12px !important;
    }

    .top-nav .nav-buttons {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
    }

    main {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    section.card,
    .card {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #inventoryLog,
    #inventoryScanTable,
    .inventory-log-table-wrap,
    .inventory-log-final-table {
        max-width: 100% !important;
    }

    #inventoryLog,
    #inventoryScanTable {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #inventoryLog table,
    #inventoryScanTable table {
        width: max-content !important;
        min-width: 100% !important;
    }
}

/* ===== END DISPLAYSTOCK MOBILE HEADER OVERFLOW FIX ===== */

/* ===== DISPLAYSTOCK TOP NAV NO JUMP FIX ===== */
html {
    scrollbar-gutter: stable;
}

body {
    overflow-y: scroll;
}

.top-nav,
.top-nav .nav-buttons {
    contain: layout style !important;
}

.top-nav .nav-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
}

.top-nav .nav-buttons > button,
.top-nav button[onclick^="showPage"] {
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    border-width: 1px !important;
    line-height: 1 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    transform: none !important;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease !important;
    will-change: auto !important;
}

.top-nav .nav-buttons > button:hover,
.top-nav .nav-buttons > button:focus,
.top-nav .nav-buttons > button:active,
.top-nav .nav-buttons > button.active,
.top-nav .nav-buttons > button.active-nav-button,
.top-nav .nav-buttons > button.ds-target-blue,
.top-nav .nav-buttons > button.ds-target-green,
.top-nav .nav-buttons > button.ds-target-yellow,
.top-nav .nav-buttons > button.ds-target-red,
.top-nav .nav-buttons > button.ui-btn-green-final,
.top-nav .nav-buttons > button.ui-btn-red-final,
.top-nav .nav-buttons > button.ui-btn-yellow-final,
.top-nav .nav-buttons > button.ds-dark-nav-neutral-button {
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 12px !important;
    border-width: 1px !important;
    line-height: 1 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    transform: none !important;
}

@media (max-width: 640px) {
    .top-nav .nav-buttons {
        gap: 8px !important;
    }

    .top-nav .nav-buttons > button,
    .top-nav button[onclick^="showPage"] {
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        padding: 0 10px !important;
        font-size: 14px !important;
    }
}

/* ===== END DISPLAYSTOCK TOP NAV NO JUMP FIX ===== */

/* ===== INVENTORY ROW QUICK ACTIONS LITE ===== */

#inventoryScanTable .inventory-row-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    min-width: 132px !important;
}

#inventoryScanTable .inventory-row-actions .small-btn {
    min-width: 36px !important;
    height: 32px !important;
    padding: 0 9px !important;
    line-height: 30px !important;
    white-space: nowrap !important;
}

#inventoryScanTable .inventory-row-actions .inventory-more-btn {
    width: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
}

.inventory-quick-action-menu {
    position: fixed !important;
    z-index: 999999 !important;
    min-width: 240px !important;
    padding: 12px !important;
    border: 1px solid rgba(148, 163, 184, 0.55) !important;
    border-radius: 8px !important;
    background: var(--card-bg, #ffffff) !important;
    color: var(--text-color, #111827) !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28) !important;
}

.inventory-quick-action-title {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin-bottom: 6px !important;
}

.inventory-quick-action-title span {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-weight: 700 !important;
}

.inventory-quick-action-close {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    line-height: 28px !important;
}

.inventory-quick-action-hint {
    margin-bottom: 10px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    opacity: 0.84 !important;
}

.inventory-quick-action-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
}

.inventory-quick-action-list .small-btn {
    width: 100% !important;
    min-height: 34px !important;
    padding: 7px 9px !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
    text-align: center !important;
    white-space: normal !important;
}

.inventory-quick-green {
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #ffffff !important;
}

.inventory-quick-green:hover {
    background: #15803d !important;
}

.inventory-quick-red {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.inventory-quick-red:hover {
    background: #b91c1c !important;
}

.inventory-quick-action-form {
    display: grid !important;
    gap: 8px !important;
}

.inventory-quick-action-form label {
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: inherit !important;
}

.inventory-quick-action-form input,
.inventory-quick-action-form textarea {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 9px 10px !important;
    border: 1px solid rgba(148, 163, 184, 0.55) !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
}

.inventory-quick-action-form textarea {
    resize: vertical !important;
    min-height: 74px !important;
}

.inventory-quick-action-error {
    padding: 8px 10px !important;
    border-radius: 8px !important;
    background: #fee2e2 !important;
    color: #991b1b !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

.inventory-quick-action-footer {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 2px !important;
}

.inventory-quick-action-footer .small-btn {
    width: 100% !important;
    min-height: 34px !important;
    margin: 0 !important;
}

body.dark-theme .inventory-quick-action-menu {
    background: rgba(15, 23, 42, 0.98) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.28) !important;
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.52) !important;
}

body.dark-theme .inventory-quick-action-hint {
    color: #bfdbfe !important;
}

body.dark-theme .inventory-quick-action-form input,
body.dark-theme .inventory-quick-action-form textarea {
    background: rgba(2, 6, 23, 0.82) !important;
    color: #e5efff !important;
    border-color: rgba(96, 165, 250, 0.32) !important;
}

body.dark-theme .inventory-quick-action-form input::placeholder,
body.dark-theme .inventory-quick-action-form textarea::placeholder {
    color: #64748b !important;
}

body.dark-theme .inventory-quick-action-error {
    background: rgba(127, 29, 29, 0.44) !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.32) !important;
}

@media (max-width: 640px) {
    #inventoryScanTable .inventory-row-actions {
        min-width: 124px !important;
        gap: 5px !important;
    }

    .inventory-quick-action-list,
    .inventory-quick-action-footer {
        grid-template-columns: 1fr !important;
    }
}

/* ===== END INVENTORY ROW QUICK ACTIONS LITE ===== */

/* ===== INVENTORY SUBMIT PROGRESS ===== */

.inventory-submit-progress {
    padding: 12px 14px !important;
    border: 1px solid rgba(37, 99, 235, 0.28) !important;
    border-radius: 8px !important;
    background: #eff6ff !important;
    color: #1e3a8a !important;
    line-height: 1.35 !important;
}

.inventory-submit-progress b {
    display: block !important;
    margin-bottom: 4px !important;
}

body.dark-theme .inventory-submit-progress {
    background: rgba(30, 64, 175, 0.24) !important;
    border-color: rgba(96, 165, 250, 0.34) !important;
    color: #dbeafe !important;
}

/* ===== END INVENTORY SUBMIT PROGRESS ===== */

/* ===== PRODUCT ORDER RECOMMENDATIONS ===== */

.product-order-controls {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) !important;
    gap: 10px 12px !important;
    align-items: end !important;
}

.product-order-controls label {
    display: grid !important;
    gap: 5px !important;
    margin: 0 !important;
    font-weight: 700 !important;
}

.product-order-controls select,
.product-order-controls input {
    width: 100% !important;
    min-height: 40px !important;
}

.product-order-wide-control {
    grid-column: span 2 !important;
}

.product-order-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    grid-column: span 2 !important;
}

.product-order-actions button {
    width: auto !important;
    min-height: 40px !important;
    padding: 8px 14px !important;
    white-space: nowrap !important;
}

.product-order-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 12px !important;
}

.product-order-table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.product-order-table th,
.product-order-table td {
    padding: 10px 12px !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28) !important;
    vertical-align: top !important;
}

.product-order-table th {
    text-align: left !important;
    font-weight: 700 !important;
}

.product-order-table .warehouse-stock-mini {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-top: 6px !important;
    font-size: 12px !important;
}

.product-order-table .warehouse-stock-mini span,
.order-priority-high,
.order-priority-medium,
.order-priority-low {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 24px !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
}

.order-priority-high {
    color: #991b1b !important;
    background: #fee2e2 !important;
}

.order-priority-medium {
    color: #92400e !important;
    background: #fef3c7 !important;
}

.order-priority-low {
    color: #166534 !important;
    background: #dcfce7 !important;
}

body.dark-theme .product-order-table th,
body.dark-theme .product-order-table td {
    border-bottom-color: rgba(96, 165, 250, 0.18) !important;
}

body.dark-theme .order-priority-high {
    color: #fecaca !important;
    background: rgba(127, 29, 29, 0.5) !important;
}

body.dark-theme .order-priority-medium {
    color: #fde68a !important;
    background: rgba(120, 53, 15, 0.48) !important;
}

body.dark-theme .order-priority-low {
    color: #bbf7d0 !important;
    background: rgba(20, 83, 45, 0.5) !important;
}

@media (max-width: 780px) {
    .product-order-controls {
        grid-template-columns: 1fr !important;
    }

    .product-order-wide-control,
    .product-order-actions {
        grid-column: span 1 !important;
    }

    .product-order-table {
        min-width: 900px !important;
    }
}

/* ===== END PRODUCT ORDER RECOMMENDATIONS ===== */
