/* === РЎРўРР›Р === */
:root {
    --primary: #2563EB;
    --primary-light: #EFF6FF;
    --bg: #F3F4F6;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-sec: #6B7280;
    --border: #E5E7EB;
    --radius: 12px;
    --warn-bg: #FEF2F2;
    --warn-text: #991B1B;
    --warn-border: #FCA5A5;
}

body.dark-mode {
    --bg: #0B0F1A;
    /* Р“Р»СѓР±РѕРєРёР№ РїРѕР»РЅРѕС‡РЅС‹Р№ С„РѕРЅ */
    --surface: #111827;
    /* Р¤РѕРЅ РїР°РЅРµР»РµР№ */
    --surface-light: #1F2937;
    /* Р¤РѕРЅ РєР°СЂС‚РѕС‡РµРє РІРЅСѓС‚СЂРё РїР°РЅРµР»РµР№ */
    --text-main: #F3F4F6;
    /* Р§РёСЃС‚С‹Р№ Р±РµР»С‹Р№ С‚РµРєСЃС‚ */
    --text-sec: #9CA3AF;
    /* РЎРµСЂС‹Р№ РїСЂРёРіР»СѓС€РµРЅРЅС‹Р№ С‚РµРєСЃС‚ */
    --border: #1F2937;
    /* Р¦РІРµС‚ РіСЂР°РЅРёС† */
    --primary: #6366F1;
    /* РРЅРґРёРіРѕ-Р°РєС†РµРЅС‚ РєР°Рє РЅР° СЃРєСЂРёРЅС€РѕС‚Рµ */
    --primary-light: rgba(99, 102, 241, 0.15);
    /* РџСЂРѕР·СЂР°С‡РЅР°СЏ РїРѕРґСЃРІРµС‚РєР° */
    --warn-bg: #2D1B1B;
    --warn-text: #F87171;
}

body.dark-mode .input-panel,
body.dark-mode .output-panel {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    box-shadow: none;
}

body.dark-mode .control-card,
body.dark-mode .tabs,
body.dark-mode .doc-summary,
body.dark-mode .zone-card {
    background: #151C2C;
    border: 1px solid #262E3F;
}

body.dark-mode .tab.active,
body.dark-mode .stepper,
body.dark-mode .step-btn,
body.dark-mode .step-val,
body.dark-mode input[type="number"],
body.dark-mode .zone-input {
    background: #1F2937;
    color: #FFFFFF;
    border: 1px solid #262E3F;
}

body.dark-mode .row-sec td {
    background: #1E293B !important;
    color: #818CF8;
    border-top: 1px solid #262E3F;
    padding: 12px 15px;
}

body.dark-mode .inv-table th {
    border-bottom: 1px solid #1F2937;
    color: var(--text-sec);
}

body.dark-mode .inv-table td {
    border-bottom: 1px solid #111827;
}

body.dark-mode .total-val,
body.dark-mode .doc-title,
body.dark-mode .lbl {
    color: #F3F4F6;
}

body.dark-mode .title-edit {
    border-bottom: 1px dashed #262E3F;
    color: var(--primary);
}

body.dark-mode .slider {
    background-color: #374151;
}

body.dark-mode input:checked+.slider {
    background-color: var(--primary);
}

body.dark-mode .group-header td {
    background-color: #111827 !important;
    color: #6366F1;
    border-bottom: 1px solid #1F2937;
}

body.dark-mode .info-card {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    color: #818CF8;
}

/* РСЃРїСЂР°РІР»РµРЅРёРµ Р±Р»РѕРєР° РіРѕСЂСЏС‡РµР№ РІРѕРґС‹ (РІС‹Р±РѕСЂ Р¶РёР»СЊС†РѕРІ) */
body.dark-mode #blk_res {
    background: #151C2C !important;
    border-color: #262E3F !important;
}

body.dark-mode #blk_res div {
    border-top-color: #262E3F !important;
}

/* РСЃРїСЂР°РІР»РµРЅРёРµ РїРѕР»РѕСЃС‹ РїСЂРѕРєСЂСѓС‚РєРё (Scrollbar) */
body.dark-mode {
    scrollbar-color: #374151 #0B0F1A;
    /* Р”Р»СЏ Firefox */
}

body.dark-mode *::-webkit-scrollbar {
    width: 8px;
}

body.dark-mode *::-webkit-scrollbar-track {
    background: #0B0F1A;
}

body.dark-mode *::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 10px;
    border: 2px solid #0B0F1A;
}

body.dark-mode *::-webkit-scrollbar-thumb:hover {
    background: #4B5563;
}

* {
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    font-size: 13px;
    line-height: 1.4;
}

@media screen and (max-width: 1550px) {
    body {
        -moz-transform: scale(0.9);
        -moz-transform-origin: top left;
        transform: scale(0.9);
        transform-origin: top left;
        width: 111.1vw;
        /* Force viewport width compensation (1/0.9) */
    }

    .input-panel {
        max-height: 115vh !important;
        /* Increase further to prevent cutoff in scaled coordinate system */
    }
}






.container {
    display: flex;
    gap: 20px;
    width: 100%;
    margin: 0;
    align-items: flex-start;
}

.input-panel {
    flex: 0 0 340px;
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 20px;
    max-height: 95vh;
    overflow-y: auto;
}

.output-panel {
    flex: 1;
    min-width: 0;
    width: 100%;
    background: var(--surface);
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: auto;
}

h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -0.02em;
    margin-top: 0;
}

h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    margin: 35px 0 15px 0;
    letter-spacing: 0.03em;
    border: none;
    padding: 0;
}

.control-item {
    margin-bottom: 20px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.lbl {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
}

.lbl-sub {
    font-size: 10px;
    color: var(--text-sec);
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    letter-spacing: 0.02em;
}

.val {
    font-weight: 700;
    color: var(--primary);
}

input[type=range] {
    width: 100%;
    cursor: pointer;
    accent-color: var(--primary);
    height: 6px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.control-card {
    background: #F9FAFB;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.stepper {
    display: inline-flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 4px;
    gap: 8px;
}


.step-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #495057;
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.step-btn:hover {
    background-color: #f1f3f5;
    border-color: #dee2e6;
    color: #212529;
}


.step-val {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #212529;
    min-width: 20px;
    text-align: center;
}



.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #E5E7EB;
    transition: .3s;
    border-radius: 34px;
    border: 1px solid transparent;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.tabs {
    display: flex;
    background: #F9FAFB;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.tab {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sec);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--text-main);
}

.tab.active {
    background: #fff;
    color: var(--primary);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab.multi-active {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.info-card {
    background: var(--primary-light);
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 11px;
    border: 1px solid #DBEAFE;
}

.doc-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #000;
    padding-bottom: 15px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.doc-title {
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1;
}

.doc-summary {
    font-size: 11px;
    color: var(--text-main);
    font-weight: 500;
    background: #F9FAFB;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.doc-summary b {
    color: var(--primary);
    font-weight: 700;
}

.sep {
    color: #D1D5DB;
}

.sku-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sku-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-sec);
    text-transform: uppercase;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.inv-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
    margin-top: 5px;
}

.inv-table th {
    text-align: left;
    padding: 8px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-sec);
    border-bottom: 1px solid #000;
}

.inv-table th:last-child {
    text-align: right;
    padding-right: 0;
}

.inv-table td {
    padding: 5px 6px;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: middle;
}

.col-img {
    width: 50px;
    text-align: center;
    vertical-align: middle;
    position: relative;
}

.img-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.prod-thumb {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    padding: 2px;
    border: 1px solid #eee;
    transition: all 0.2s;
}

.swap-cycle-btn {
    display: none;
    position: absolute;
    left: -26px;
    top: 50%;
    transform: translateY(-50%);
    background: #2563EB;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
    border: 2px solid #fff;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.swap-cycle-btn:hover {
    background: #1d4ed8;
    transform: translateY(-50%) scale(1.15);
}

.show-swap-ui .swap-cycle-btn,
.inv-table tr.active-row .swap-cycle-btn {
    display: flex;
    animation: popIn 0.2s forwards;
}

.swappable-cursor {
    cursor: pointer;
}

.swappable-cursor:hover .prod-thumb {
    border-color: var(--primary);
}

.show-swap-ui .prod-thumb,
.inv-table tr.active-row .swappable-cursor .prod-thumb {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }

    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

.col-idx {
    width: 30px;
    min-width: 30px;
    color: #9CA3AF;
    text-align: center;
    font-size: 10px;
}

.col-img {
    width: 45px;
    min-width: 45px;
    text-align: center;
}

.col-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 12px;
}

.inv-table th.col-name,
.inv-table td.col-name {
    width: 100%;
    max-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-sku {
    width: 110px;
    min-width: 110px;
    font-family: monospace;
    color: var(--text-sec);
    font-size: 11px;
    white-space: nowrap;
}

.inv-table td.col-art {
    width: 90px;
    min-width: 90px;
    font-size: 11px;
}

.col-brand {
    width: 75px;
    min-width: 75px;
    text-align: center;
    font-size: 11px;
}

.col-unit {
    width: 45px;
    min-width: 45px;
    text-align: center;
    font-size: 11px;
}

.col-qty {
    width: 60px;
    min-width: 60px;
    text-align: center;
    font-weight: 700;
}

.col-price {
    width: 85px;
    min-width: 85px;
    text-align: right;
    white-space: nowrap;
    font-size: 12px;
}

.col-sum {
    width: 95px;
    min-width: 95px;
    text-align: right;
    font-weight: 800;
    padding-right: 0;
    white-space: nowrap;
    font-size: 12px;
}

.row-sec td {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    padding: 8px 6px;
    border-top: 2px solid #fff;
}

.row-subtotal td {
    text-align: right;
    font-style: italic;
    color: var(--text-sec);
    padding-bottom: 10px;
    font-size: 11px;
}

.group-header td {
    background-color: #EFF6FF;
    color: #1e3a8a;
    font-weight: 800;
    font-size: 10px;
    text-transform: uppercase;
    padding-top: 8px;
    padding-bottom: 6px;
    border: none;
    cursor: pointer;
    vertical-align: middle;
}

.group-header td:last-child {
    text-align: right;
}

.group-header .col-sum {
    text-align: right;
}

.doc-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 2px solid #000;
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 15px;
}

.total-val {
    font-size: 24px;
    font-weight: 800;
    color: #111;
}

.footer-btns {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #000;
}

.btn-base {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-base:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

/* Р¦РІРµС‚Р° РєРЅРѕРїРѕРє РІ СЃРІРµС‚Р»РѕР№ С‚РµРјРµ */
.btn-tg {
    background-color: #229ED9;
}

.btn-tg:hover {
    background-color: #1c8dbf;
}

.btn-print {
    background-color: #111827;
}

.btn-print:hover {
    background-color: #000000;
}

/* Р¦РІРµС‚Р° РєРЅРѕРїРѕРє РІ С‚С‘РјРЅРѕР№ С‚РµРјРµ (Indigo style РєР°Рє РЅР° СЃРєСЂРёРЅС€РѕС‚Рµ) */
body.dark-mode .btn-tg {
    background-color: #374151;
    color: #F3F4F6;
}

body.dark-mode .btn-tg:hover {
    background-color: #4B5563;
}

body.dark-mode .btn-print {
    background-color: #6366F1;
    color: #FFFFFF;
}

body.dark-mode .btn-print:hover {
    background-color: #4F46E5;
}

.editable-val {
    cursor: text;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.3);
    min-width: 20px;
    display: inline-block;
    text-align: center;
    transition: 0.2s;
}

body.dark-mode .editable-val {
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.editable-val:focus {
    background: var(--primary-light);
    outline: none;
    border-bottom-color: var(--primary);
}

body.dark-mode .editable-val:focus {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
}

@media print {

    .hide-custom-eq-btn,
    .no-print {
        display: none !important;
    }

    .editable-val {
        border-bottom: none !important;
    }
}

@media screen and (max-width: 768px) {

    html,
    body {
        max-width: 100vw;
        overflow-x: hidden;
    }

    .site-header {
        position: relative !important;
        height: auto !important;
        padding: 12px !important;
        flex-wrap: wrap;
        gap: 12px;
    }

    .site-header-right {
        width: 100%;
        justify-content: space-between;
        gap: 5px;
    }

    .container {
        flex-direction: column;
        padding-top: 15px !important;
    }

    /* РџРµСЂРµРЅРѕСЃ С‚СѓРјР±Р»РµСЂРѕРІ "РђСЂС‚РёРєСѓР»С‹" РЅР° РЅРѕРІСѓСЋ СЃС‚СЂРѕРєСѓ */
    .header-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .sku-control {
        flex-wrap: wrap;
        gap: 10px;
    }

    .sku-control span[style*="margin-left: 15px"] {
        margin-left: 0 !important;
    }

    .header-auth-block span[style*="border-bottom"] {
        max-width: 85px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        vertical-align: bottom;
    }

    .input-panel {
        flex: none;
        width: 100%;
        position: static;
        max-height: none;
    }

    /* Р—Р°РґР°С‡Рё РјРѕР±РёР»СЊРЅРѕР№ С€Р°РїРєРё */
    .stout-logo-img {
        max-width: 100px;
        height: 30px;
    }

    .btn-header-blue {
        padding: 0;
        width: 38px;
        justify-content: center;
    }

    .btn-header-blue span {
        display: none;
    }

    .header-auth-block {
        padding-right: 5px;
    }

    .header-cloud-btns {
        padding-right: 5px;
        gap: 5px;
    }

    /* 1. РћРїРёСЃР°РЅРёРµ РѕР±СЉРµРєС‚Р° Рё РІРєР»Р°РґРєРё РІ СЃС‚РѕР»Р±РёРє (РєРѕРјРїР°РєС‚РЅРѕ) */
    .doc-summary {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        padding: 10px !important;
        font-size: 11px !important;
    }

    .doc-summary .sep {
        display: none !important;
    }

    .doc-summary span {
        display: block;
        width: 100%;
        line-height: 1.2;
    }

    .doc-summary span[style*="margin-left: auto"] {
        margin-left: 0 !important;
        margin-top: 4px !important;
        opacity: 0.7;
    }

    .main-view-tabs {
        flex-direction: column !important;
        height: auto !important;
        gap: 10px;
        margin-top: 20px;
    }

    .main-view-tabs .tab {
        width: 100%;
        padding: 14px !important;
        font-size: 15px !important;
    }

    /* 2. РџСЂРµРІСЂР°С‰Р°РµРј С‚Р°Р±Р»РёС†Сѓ РІ Р±Р»РѕС‡РЅС‹Рµ РєР°СЂС‚РѕС‡РєРё */
    .table-responsive {
        overflow: visible !important;
        border: none !important;
    }

    .inv-table,
    .inv-table tbody,
    .inv-table tr,
    .inv-table td,
    .inv-table th {
        display: block;
        width: 100%;
        border: none !important;
    }

    .inv-table thead {
        display: none;
    }

    .row-sec td,
    .group-header td,
    .row-subtotal td {
        text-align: left !important;
    }

    /* 3. CSS Grid РґР»СЏ СЃС‚СЂРѕРє С‚РѕРІР°СЂРѕРІ */
    .inv-table tr:not(.row-sec):not(.group-header):not(.row-subtotal) {
        display: grid;
        grid-template-columns: auto 1fr 55px;
        /* РђРІС‚Рѕ РїРѕРґ РєР°СЂС‚РёРЅРєСѓ, 1fr РїРѕРґ С‚РµРєСЃС‚, 55px РїРѕРґ РєРѕР»-РІРѕ */
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "img name  qty"
            "img sku   unit"
            "img price .";
        gap: 2px 10px;
        padding: 10px 0;
        border-bottom: 1px solid var(--border) !important;
        align-items: start;
    }

    /* РЎРєСЂС‹РІР°РµРј Р»РёС€РЅРµРµ */
    .col-idx,
    .col-brand,
    .col-sum {
        display: none !important;
    }

    /* РљР°СЂС‚РёРЅРєР° (РµСЃР»Рё РµСЃС‚СЊ) */
    .col-img {
        grid-area: img;
        padding: 0 !important;
    }

    .col-img .img-wrap,
    .col-img .prod-thumb {
        width: 48px;
        height: 48px;
        border-radius: 6px;
    }

    /* РќР°Р·РІР°РЅРёРµ Рё РђСЂС‚РёРєСѓР» */
    .col-name {
        grid-area: name;
        padding: 0 !important;
        font-size: 13px !important;
        font-weight: 600;
        line-height: 1.3;
        color: var(--text-main);
        margin-bottom: 2px;
        white-space: normal !important;
    }

    .col-sku {
        grid-area: sku;
        padding: 0 !important;
        font-size: 10px !important;
        color: #9CA3AF !important;
        display: block !important;
    }

    /* РҐР°Рє: Р”РѕР±Р°РІР»СЏРµРј СЃР»РѕРІРѕ РђР Рў, РµСЃР»Рё РІРЅСѓС‚СЂРё РЅРµ РїСѓСЃС‚Рѕ Рё РЅРµ РїСЂРѕС‡РµСЂРє */
    .col-sku:not(:empty)::before {
        content: "АРТ: ";
    }

    /* Р¦РµРЅР° (РЎРёРЅСЏСЏ STOUT) */
    .col-price {
        grid-area: price;
        padding: 0 !important;
        text-align: left !important;
        color: var(--primary) !important;
        font-size: 15px !important;
        font-weight: 800 !important;
        margin-top: 4px;
    }

    .col-price::after {
        content: " ₽";
    }

    /* РЈР±РёСЂР°РµРј РјРЅРѕР¶РёС‚РµР»СЊ X 1 РїРѕ РїСЂРѕСЃСЊР±Рµ */
    .mob-mult {
        display: none !important;
    }

    /* Р‘Р»РѕРє РєРѕР»РёС‡РµСЃС‚РІР° (РЎРµСЂС‹Р№ РєРѕРЅС‚РµР№РЅРµСЂ СЃРїСЂР°РІР°) */
    .col-qty {
        grid-area: qty;
        padding: 6px 0 0 0 !important;
        text-align: center !important;
        background: #F3F4F6;
        border-radius: 8px 8px 0 0;
        height: 100%;
        position: relative;
    }

    .qty-wrap {
        font-size: 14px !important;
        font-weight: 700 !important;
        justify-content: center;
    }

    .qty-wrap .opt-btn {
        position: absolute;
        right: 100%;
        top: 50%;
        transform: translateY(-50%);
        margin-right: 15px;
        font-size: 20px;
    }

    .col-unit {
        grid-area: unit;
        padding: 0 0 6px 0 !important;
        text-align: center !important;
        background: #F3F4F6;
        border-radius: 0 0 8px 8px;
        font-size: 10px !important;
        color: var(--text-sec);
        height: 100%;
        font-weight: 600;
    }

    body.dark-mode .col-qty,
    body.dark-mode .col-unit {
        background: #1F2937;
    }

    /* РС‚РѕРіРѕ Рё С„РёРЅР°Р»СЊРЅС‹Рµ РєРЅРѕРїРєРё */
    .row-subtotal td {
        text-align: right !important;
        font-size: 15px !important;
        font-weight: 800;
        padding: 15px 0 !important;
    }

    .footer-btns {
        flex-direction: column !important;
        gap: 12px !important;
        margin-top: 20px !important;
        border-top: none;
    }

    .footer-btns .btn-base {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 16px !important;
        font-size: 16px !important;
    }
}

.qty-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.warn-box {
    display: block;
    margin-top: 5px;
    background: var(--warn-bg);
    color: var(--warn-text);
    border: 1px solid var(--warn-border);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    width: 100%;
}

.print-header {
    display: none;
    font-family: Arial, sans-serif;
    color: #000;
    margin-bottom: 20px;
}

.ph-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 14px;
}

.ph-main {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 10px;
    line-height: 1.3;
}

.ph-logo {
    width: 80px;
    flex-shrink: 0;
}

.ph-logo img {
    width: 100%;
    height: auto;
}

.ph-addr {
    flex: 1.2;
}

.ph-bank {
    flex: 1;
}

.ph-line {
    margin-top: 10px;
    border: none;
    border-top: 3px solid #D4AF37;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@page {
    margin: 0;
    /* РЈР±РёСЂР°РµС‚ РјРµСЃС‚Рѕ РґР»СЏ СЃРёСЃС‚РµРјРЅС‹С… РєРѕР»РѕРЅС‚РёС‚СѓР»РѕРІ (URL, РґР°С‚Р°, СЃС‚СЂР°РЅРёС†С‹) */
}

@media print {
    tr {
        page-break-inside: avoid;
    }

    /* РџСЂРёРЅСѓРґРёС‚РµР»СЊРЅРѕ РІРѕР·РІСЂР°С‰Р°РµРј С‚Р°Р±Р»РёС‡РЅС‹Р№ РІРёРґ */
    .inv-table {
        display: table !important;
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .inv-table thead {
        display: table-header-group !important;
    }

    .inv-table tbody {
        display: table-row-group !important;
    }

    .inv-table tr {
        display: table-row !important;
    }

    .inv-table td,
    .inv-table th {
        display: table-cell !important;
    }

    /* РЈР±СЂР°РЅРѕ СЃР»РѕРІРѕ РЎРџР•Р¦РР¤РРљРђР¦РРЇ РїРѕ Р·Р°РїСЂРѕСЃСѓ */
    .doc-title::before {
        content: "";
    }

    .title-edit:empty::before {
        content: "" !important;
        /* РЈР±РёСЂР°РµРј РїРѕРґСЃРєР°Р·РєСѓ "Р’РІРµРґРёС‚Рµ РЅР°Р·РІР°РЅРёРµ" РЅР° Р±СѓРјР°РіРµ */
    }

    .title-edit {
        border: none !important;
        color: #000 !important;
        background: transparent !important;
    }

    /* РЎРєСЂС‹РІР°РµРј Р·Р°РјРѕС‡РєРё, РєРЅРѕРїРєРё Рё Р»РёС€РЅРёРµ С„РѕРЅС‹ */
    .locked-guest::after,
    .locked-pro::after {
        display: none !important;
    }

    .doc-summary {
        background: transparent !important;
        border: 1px solid #ccc !important;
    }

    .qty-wrap .opt-btn {
        display: none !important;
    }

    .swap-cycle-btn,
    .work-del-btn,
    .inv-table tr.hide-custom-work-btn,
    .hide-custom-work-btn {
        display: none !important;
    }

    .header-auth-block,
    .header-cloud-btns,
    .header-actions {
        display: none !important;
    }

    .site-header,
    .input-panel,
    .btn-print,
    .sku-control,
    .swap-cycle-btn,
    .main-view-tabs,
    .footer-btns {
        display: none !important;
    }

    .output-panel {
        box-shadow: none;
        width: 100%;
        padding: 0;
        border: none;
    }

    body {
        padding: 15mm 10mm !important;
        /* РђРєРєСѓСЂР°С‚РЅС‹Рµ РѕС‚СЃС‚СѓРїС‹ РґР»СЏ С‚РµРєСЃС‚Р° РЅР° Р»РёСЃС‚Рµ Рђ4 */
        background: white;
    }

    /* Р–РµСЃС‚РєРѕ СЃРєСЂС‹РІР°РµРј РєРѕР»РѕРЅРєРё, РєРѕС‚РѕСЂС‹Рµ РѕС‚РєР»СЋС‡РµРЅС‹ СЃРєСЂРёРїС‚РѕРј (РђСЂС‚РёРєСѓР»С‹) */
    .inv-table th[style*="display: none"],
    .inv-table td[style*="display: none"],
    .hidden-col {
        display: none !important;
    }

    .print-header {
        display: block !important;
    }

    .print-disclaimer {
        display: block !important;
    }

    .doc-title {
        font-size: 20px;
        margin-top: 0;
    }

    .price-edit {
        border-bottom: none;
        color: #000;
    }

    .print-hide {
        display: none !important;
    }

    .doc-footer {
        border-top: 3px solid #D4AF37 !important;
        padding-top: 15px !important;
    }
}

/* === РРЎРџР РђР’Р›Р•РќРќР«Р• РЎРўРР›Р Р”Р›РЇ Р—РћРќ === */
/* РЎС‚РёР»Рё РґР»СЏ СЂРµРґР°РєС‚РёСЂСѓРµРјРѕРіРѕ Р·Р°РіРѕР»РѕРІРєР° */

.title-edit {
    display: inline-block;
    min-width: 300px;
    width: 100%;
    text-align: left;
}

.title-edit:focus {
    border-bottom: 1px solid #2563EB;
    background: #EFF6FF;
}

.title-edit:empty::before {
    content: "Название объекта";
}

@media print {
    .title-edit {
        border-bottom: none;
        color: #000;
    }

    .title-edit:empty {
        display: none;
    }
}

.zone-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 10px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.zone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #F3F4F6;
}

.zone-title {
    font-weight: 700;
    font-size: 13px;
    color: #374151;
    min-width: 50px;
    outline: 1px dashed transparent;
}

.zone-title:focus {
    outline: 1px dashed #2563EB;
    background: #fff;
}

.zone-remove {
    color: #EF4444;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    opacity: 0.6;
    transition: 0.2s;
}

.zone-remove:hover {
    opacity: 1;
}

.zone-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.zone-row .stepper {
    padding: 2px;
    gap: 4px;
}

.zone-row .step-btn {
    width: 26px;
    height: 26px;
    font-size: 16px;
}

.zone-row .step-val {
    font-size: 11px;
    min-width: 15px;
}

.zone-input {
    width: 50px;
    padding: 4px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.btn-add-zone {
    width: 100%;
    padding: 8px;
    background: #F3F4F6;
    border: 1px dashed #9CA3AF;
    color: #4B5563;
    font-weight: 600;
    font-size: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-add-zone:hover {
    background: #E5E7EB;
    color: #111;
    border-color: #6B7280;
}

/* РЎС‚РёР»СЊ РєРЅРѕРїРєРё РґР»СЏ С‚С‘РјРЅРѕР№ С‚РµРјС‹ (РєР°Рє РЅР° СЃРєСЂРёРЅС€РѕС‚Рµ) */
body.dark-mode .btn-add-zone {
    background: #374151;
    border: 1px dashed #4B5563;
    color: #F3F4F6;
}

body.dark-mode .btn-add-zone:hover {
    background: #4B5563;
    border-color: #6366F1;
    color: #FFFFFF;
}

.tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    vertical-align: middle;
}

.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #DBEAFE;
    color: #2563EB;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    cursor: help;
    border: 1px solid #2563EB;
}

.info-icon:hover {
    background: #2563EB;
    color: white;
}

.tooltip-content {
    visibility: hidden;
    position: absolute;
    z-index: 100;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    background: #1F2937;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.4;
    opacity: 0;
    transition: 0.2s;
    pointer-events: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
    text-align: left;
    font-weight: 400;
}

.tooltip-wrapper:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1F2937 transparent transparent transparent;
}

/* Р•РґРёРЅС‹Р№ СЃС‚РёР»СЊ РґР»СЏ РєРЅРѕРїРѕРє-РёРєРѕРЅРѕРє РІ С€Р°РїРєРµ */
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.btn-ctrl {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid var(--border);
    background: #fff;
    color: #6B7280;
    padding: 0;
}

.btn-ctrl:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-ctrl svg {
    width: 20px;
    height: 20px;
}

/* Р¦РІРµС‚Р° РєРЅРѕРїРѕРє РґР»СЏ С‚РµРјРЅРѕР№ С‚РµРјС‹ */
body.dark-mode .btn-ctrl {
    background: #1F2937;
    border-color: #262E3F;
    color: #9CA3AF;
}

body.dark-mode .btn-ctrl:hover {
    border-color: #6366F1;
    color: #818CF8;
    background: rgba(99, 102, 241, 0.1);
}

/* Р¦РІРµС‚ РєРЅРѕРїРєРё СЃР±СЂРѕСЃР° РїСЂРё РЅР°РІРµРґРµРЅРёРё */
.btn-ctrl.btn-reset:hover {
    border-color: #EF4444;
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

.opt-btn {
    opacity: 0;
    transition: 0.2s;
    cursor: pointer;
    padding: 0 5px;
    font-size: 14px;
    display: inline-block;
}

.inv-table tr.active-row .opt-btn {
    opacity: 1;
}

tr[style*="opacity: 0.4"] .opt-btn {
    opacity: 1 !important;
    text-decoration: none !important;
    filter: none !important;
}

.tab.active.work-active {
    background: #FFEDD5;
    color: #ea580c;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.dark-mode .tab.active.work-active {
    background: #9A3412;
    color: #FFEDD5;
}

body.work-mode .col-img,
body.work-mode .col-sku,
body.work-mode .col-brand {
    display: none !important;
}

.price-edit {
    border-bottom: 1px dashed var(--primary);
    color: var(--primary);
    cursor: text;
    display: inline-block;
    min-width: 40px;
    transition: 0.2s;
}

.price-edit:hover,
.price-edit:focus {
    background: var(--primary-light);
    outline: none;
}

.work-del-btn {
    opacity: 0;
    transition: 0.2s;
    cursor: pointer;
    color: #EF4444;
    font-size: 14px;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
}

.inv-table tr.active-row .work-del-btn {
    opacity: 1;
}

@media print {
    .work-del-btn {
        display: none !important;
    }
}

/* === РЁРђРџРљРђ Р РЈРќРР¤РР¦РР РћР’РђРќРќР«Р• РљРќРћРџРљР === */
/* === РџР›РђР’РќРђРЇ РЎР–РРњРђР®Р©РђРЇРЎРЇ РЁРђРџРљРђ === */
.site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    width: 100%;
    background: var(--bg);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    transition: padding 0.3s ease, box-shadow 0.3s ease, background 0.3s ease !important;
}

.site-header-left img {
    transition: height 0.3s ease !important;
    height: 40px;
    /* РСЃС…РѕРґРЅС‹Р№ СЂР°Р·РјРµСЂ Р»РѕРіРѕС‚РёРїР° */
    display: block;
    object-fit: contain;
    max-width: 150px;
}

.container {
    padding-top: 0;
}

@media print {
    .container {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
}

.site-header-left {
    display: flex;
    align-items: center;
    min-width: 150px;
}

.stout-logo-img {
    height: 40px;
    display: block;
    object-fit: contain;
    max-width: 150px;
}

/* РРЅРІРµСЂС‚РёСЂСѓРµРј Р»РѕРіРѕС‚РёРї РІ С‚РµРјРЅРѕР№ С‚РµРјРµ (РµСЃР»Рё РѕРЅ С‡РµСЂРЅС‹Р№ РЅР° РїСЂРѕР·СЂР°С‡РЅРѕРј С„РѕРЅРµ) */
body.dark-mode .stout-logo-img {
    filter: brightness(0) invert(1);
}

.site-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.header-main-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
    max-height: 100px;
    overflow: hidden;
}

.header-auth-block {
    display: flex;
    align-items: center;
}

.header-cloud-btns {
    display: flex;
    gap: 10px;
    padding-right: 15px;
    border-right: 1px solid var(--border);
}

/* Р•РґРёРЅС‹Р№ СЃРїРѕРєРѕР№РЅС‹Р№ СЃС‚РёР»СЊ РґР»СЏ РєРЅРѕРїРѕРє РЎРѕС…СЂР°РЅРёС‚СЊ/Р—Р°РіСЂСѓР·РёС‚СЊ */
.btn-header-blue {
    background: #fff;
    color: #6B7280;
    border: 1px solid var(--border);
    padding: 0 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    transition: 0.2s;
}

.btn-header-blue:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* РСЃРїСЂР°РІР»РµРЅРёСЏ РґР»СЏ С‚РµРјРЅРѕР№ С‚РµРјС‹ */
body.dark-mode .site-header {
    background: #111827;
    border-color: #1F2937;
}

body.dark-mode .header-cloud-btns {
    border-color: #1F2937;
}

body.dark-mode .header-auth-block div[style*="border-right"] {
    border-color: #1F2937 !important;
}

body.dark-mode .btn-header-blue {
    background: #1F2937;
    border-color: #262E3F;
    color: #9CA3AF;
}

/* === Р‘Р›РћРљРР РћР’РљР === */
.locked-guest,
.locked-pro {
    opacity: 0.65;
    cursor: not-allowed !important;
    position: relative;
}

.locked-guest:not(#project_name_edit):not(#tab_works)::after,
.locked-pro:not(#project_name_edit):not(#tab_works)::after {
    content: "🔒";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    filter: grayscale(100%);
    opacity: 0.6;
    margin-left: 6px;
    font-size: 0.9em;
    display: inline-block;
    vertical-align: middle;
}

#tab_works {
    width: auto;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#project_name_edit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
}

.switch.locked-guest::after,
.switch.locked-pro::after {
    left: 50%;
}

.tab.locked-guest::after,
.tab.locked-pro::after {
    left: 90%;
    font-size: 12px;
}

.title-edit.locked-guest {
    pointer-events: auto;
    /* Р§С‚РѕР±С‹ СЃСЂР°Р±Р°С‚С‹РІР°Р» РєР»РёРє РґР»СЏ РјРѕРґР°Р»РєРё */
}

/* === РњРћР”РђР›Р¬РќРћР• РћРљРќРћ === */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal {
    background: var(--surface);
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

body.dark-mode .custom-modal {
    background: #1F2937;
    border: 1px solid #374151;
}

.custom-modal-overlay.active .custom-modal {
    transform: translateY(0);
}

.custom-modal-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.custom-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
}

.custom-modal-text {
    font-size: 13px;
    color: var(--text-sec);
    margin-bottom: 20px;
    line-height: 1.5;
}

.custom-modal-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: 0.2s;
}

.custom-modal-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.custom-modal-close {
    background: transparent;
    color: var(--text-sec);
    border: 1px solid var(--border);
    margin-top: 10px;
}

body.dark-mode .custom-modal-close {
    border-color: #374151;
}

.custom-modal-close:hover {
    background: var(--bg);
}

body.dark-mode .custom-modal-close:hover {
    background: #111827;
}

/* Unified Auth Modal Styles */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.auth-modal-content {
    background: var(--surface);
    color: var(--text-main);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
}

.auth-modal-title {
    margin: 0 0 20px 0;
    text-align: center;
    color: var(--text-main);
    font-size: 20px;
    font-weight: 700;
}

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 18px;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-sec);
    line-height: 1;
    transition: 0.2s;
}

.auth-modal-close:hover {
    color: var(--text-main);
}

/* Unified Input & Button Height/Radius */
.auth-input,
.auth-btn-base {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    font-size: 14px;
    box-sizing: border-box;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

/* Email Input */
.auth-input {
    padding: 0 15px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-main);
    cursor: text;
    margin-bottom: 12px;
}

.auth-input:focus {
    border-color: #3B82F6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Email Submit Button */
.btn-email-submit {
    background: #3B82F6;
    color: white;
    border: none;
}

.btn-email-submit:hover {
    background: #2563EB;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: var(--text-sec);
    font-size: 11px;
    font-weight: 700;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider-line {
    flex-grow: 1;
    height: 1px;
    background: var(--border);
}

/* Google Button */
.btn-google {
    background: #fff;
    border: 1px solid #D1D5DB;
    color: #374151;
    margin: 0 auto 15px auto;
    padding: 0;
    max-width: 240px;
}

.btn-google:hover {
    background: #F9FAFB;
    border-color: #C0C4CC;
}

body.dark-mode .btn-google {
    background: #1F2937;
    border-color: #374151;
    color: #F3F4F6;
}

body.dark-mode .btn-google:hover {
    background: #374151;
    border-color: #4B5563;
}

/* Telegram Widget Wrapper */
.tg-widget-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 46px;
    margin-bottom: 10px;
    /* Telegram widget is an iframe, we force centering and ensure wrapper matches height */
}

/* === РџР›РђРЁРљРђ РРўРћР“РћР’ Р’ РЁРђРџРљР• === */
.header-totals-block {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    /* РЈРіР»С‹ РІ РµРґРёРЅРѕРј СЃС‚РёР»Рµ СЃ РєРЅРѕРїРєР°РјРё */
    padding: 4px 12px;
    /* Р§СѓС‚СЊ РєРѕРјРїР°РєС‚РЅРµРµ РїРѕ РІС‹СЃРѕС‚Рµ */
    font-size: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-right: 0 !important;
    /* РџСЂРёР¶РёРјР°РµРј СЃС‚СЂРѕРіРѕ Рє РїСЂР°РІРѕРјСѓ РєСЂР°СЋ */
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* === РРЎРџР РђР’Р›Р•РќРР• Р’Р•Р РЎРўРљР РЁРђРџРљР === */
.site-header {
    height: auto !important;
    /* Р Р°Р·СЂРµС€Р°РµРј С€Р°РїРєРµ С‚СЏРЅСѓС‚СЊСЃСЏ РїРѕ РІС‹СЃРѕС‚Рµ */
    min-height: 70px;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

.site-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    /* РђРєРєСѓСЂР°С‚РЅС‹Р№ РѕС‚СЃС‚СѓРї РјРµР¶РґСѓ СЂСЏРґР°РјРё */
}

.header-right-top {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Р Р°РІРЅРѕРјРµСЂРЅС‹Рµ РѕС‚СЃС‚СѓРїС‹ РјРµР¶РґСѓ РіСЂСѓРїРїР°РјРё РєРЅРѕРїРѕРє */
}

/* РЎР±СЂР°СЃС‹РІР°РµРј СЃС‚Р°СЂС‹Рµ РѕС‚СЃС‚СѓРїС‹, С‡С‚РѕР±С‹ РЅРµ Р±С‹Р»Рѕ РїРµСЂРµРєРѕСЃРѕРІ */
.header-cloud-btns,
.header-actions,
.header-auth-block {
    margin: 0 !important;
}

/* РЎРєСЂС‹РІР°РµРј СЃСѓРјРјС‹ РЅР° РјРѕР±РёР»РєР°С… Рё РјРµРЅСЏРµРј РЅР°РїСЂР°РІР»РµРЅРёРµ РґР»СЏ Р°РґР°РїС‚РёРІРЅРѕСЃС‚Рё */
/* === РќРћР’РђРЇ Р›РРџРљРђРЇ РџРђРќР•Р›Р¬ Р’РљР›РђР”РћРљ Р РЎРЈРњРњ === */
/* --- РЎРћРЎРўРћРЇРќРР• РџР Р РџР РћРљР РЈРўРљР• (РЈР—РљРђРЇ РџРћР›РћРЎРђ) --- */
.site-header.scrolled {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
    background: var(--surface) !important;
}

.site-header.scrolled .site-header-left img {
    height: 20px !important;
    /* Р›РѕРіРѕС‚РёРї СЃР¶РёРјР°РµС‚СЃСЏ СЂРѕРІРЅРѕ РІ 2 СЂР°Р·Р° */
}

.site-header.scrolled .header-main-controls {
    opacity: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    pointer-events: none;
}

/* РќРµР№С‚СЂР°Р»РёР·СѓРµРј СЃС‚Р°СЂСѓСЋ РѕС€РёР±РєСѓ (РµСЃР»Рё РєРѕРЅС‚РµР№РЅРµСЂ РѕСЃС‚Р°Р»СЃСЏ РІ РєРѕРґРµ) */
.sticky-tabs-container {
    display: contents !important;
}

@media (max-width: 900px) {
    .site-header-right {
        flex-direction: row;
        gap: 10px;
    }

    .header-right-top {
        gap: 10px;
    }

    .header-totals-block {
        display: none !important;
    }

    .sticky-tabs-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .sticky-tabs-container .main-view-tabs {
        width: 100%;
    }
}

/* === РљР›РђРЎРЎР« Р”Р›РЇ РњРЈР›Р¬РўР-РЎРўР РђРќРР§РќРћР™ РџР•Р§РђРўР === */
@media screen {
    #print_bin {
        display: none !important;
    }
}

@media print {

    /* Р—Р°РґР°РµРј РіР»РѕР±Р°Р»СЊРЅС‹Рµ РѕС‚СЃС‚СѓРїС‹ РґР»СЏ РІСЃРµС… СЃС‚СЂР°РЅРёС† (РєСЂРѕРјРµ С‚РµС…, РіРґРµ РµСЃС‚СЊ СЃРІРѕРё @page) */
    @page {
        margin-top: 15mm;
        margin-bottom: 15mm;
    }

    /* === РЈР±РёСЂР°РµРј Р»РёС€РЅРёР№ РѕС‚СЃС‚СѓРї РЅР°Рґ Р»РѕРіРѕС‚РёРїРѕРј === */
    #print_bin>div,
    .output-panel,
    #print-area {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .print-header {
        margin-top: -10mm !important;
        /* РџСЂРёРЅСѓРґРёС‚РµР»СЊРЅРѕ РїРѕРґС‚СЏРіРёРІР°РµРј С€Р°РїРєСѓ РІРІРµСЂС… */
        padding-top: 0 !important;
    }

    /* Р—Р°С‰РёС‚Р° РѕС‚ РїСѓСЃС‚С‹С… Р»РёСЃС‚РѕРІ РІ РєРѕРЅС†Рµ РґРѕРєСѓРјРµРЅС‚Р° */
    html,
    body {
        height: auto !important;
        min-height: auto !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .hide-original-for-print {
        display: none !important;
    }

    #print_bin {
        display: block !important;
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
    }

    .print-page-break {
        page-break-before: always !important;
        break-before: page !important;
    }

    /* РЎРєСЂС‹РІР°РµРј РІСЃРµ РІРѕР·РјРѕР¶РЅС‹Рµ РєРЅРѕРїРєРё РґРѕР±Р°РІР»РµРЅРёСЏ */
    .hide-custom-work-btn,
    .hide-custom-eq-btn,
    .btn-add-zone,
    .no-print,
    [onclick*="addCustomEq"],
    [onclick*="addCustomWork"] {
        display: none !important;
    }

    /* Р Р°Р·СЂРµС€Р°РµРј РїРµСЂРµРЅРѕСЃ РґР»РёРЅРЅРѕРіРѕ С‚РµРєСЃС‚Р° */
    .col-name {
        white-space: normal !important;
        word-wrap: break-word !important;
        max-width: none !important;
    }

    .inv-table {
        table-layout: auto !important;
        width: 100% !important;
    }

    /* РџРѕРІС‚РѕСЂСЏС‚СЊ С€Р°РїРєСѓ С‚Р°Р±Р»РёС†С‹ РЅР° РЅРѕРІС‹С… СЃС‚СЂР°РЅРёС†Р°С… */
    thead {
        display: table-header-group !important;
    }

    tr {
        page-break-inside: avoid !important;
    }
}

/* === РЎРћРЎРўРћРЇРќРР• "РќР• РЎРћРҐР РђРќР•РќРћ" Р”Р›РЇ РљРќРћРџРљР === */
.btn-ctrl.btn-unsaved {
    border-color: #EF4444 !important;
    /* РљСЂР°СЃРЅС‹Р№ С†РІРµС‚ */
    color: #EF4444 !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5) !important;
    animation: pulse-red 2s infinite;
    /* Р›РµРіРєР°СЏ РїСѓР»СЊСЃР°С†РёСЏ */
}

.btn-ctrl.btn-unsaved:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
    }

    50% {
        box-shadow: 0 0 18px rgba(239, 68, 68, 0.8);
    }

    100% {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
    }
}

/* Фикс ширины таблицы без поломки внешнего вида артикулов */
.inv-table {
    width: 100% !important;
    max-width: 100% !important;
}

/* Разрешаем переноситься только длинным названиям оборудования */
.col-name {
    white-space: normal !important;
}

/* Все технические колонки и артикулы СТРОГО в одну строку */
.col-id,
.col-art,
.col-qty,
.col-price,
.col-sum {
    white-space: nowrap !important;
}

/* ЖЕСТКАЯ ФИКСАЦИЯ КОЛОНОК ДЛЯ ИСКЛЮЧЕНИЯ ПРЫЖКОВ ВЕРСТКИ ПРИ ЗАМЕНЕ */
@media (min-width: 768px) {
    .inv-table td.col-brand {
        width: 85px;
        min-width: 85px;
        max-width: 85px;
        text-align: center;
    }

    .inv-table td.col-unit {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
        text-align: center;
    }

    .inv-table td.col-qty {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        text-align: center;
    }

    .inv-table td.col-price {
        width: 110px;
        min-width: 110px;
        max-width: 110px;
        text-align: right;
    }

    .inv-table td.col-sum {
        width: 120px;
        min-width: 120px;
        max-width: 120px;
        text-align: right;
    }

    /* Запрещаем перенос слов в бренде и цифрах, чтобы ячейки не росли в высоту */
    .inv-table td.col-brand,
    .inv-table td.col-price,
    .inv-table td.col-sum {
        white-space: nowrap;
    }
}

/* ЖЕСТКАЯ ФИКСАЦИЯ КОЛОНОК ДЛЯ ИСКЛЮЧЕНИЯ ПРЫЖКОВ ВЕРСТКИ ПРИ ЗАМЕНЕ */
@media (min-width: 768px) {
    .inv-table td.col-brand {
        width: 85px;
        min-width: 85px;
        max-width: 85px;
        text-align: center;
    }

    .inv-table td.col-unit {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
        text-align: center;
    }

    .inv-table td.col-qty {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        text-align: center;
    }

    .inv-table td.col-price {
        width: 110px;
        min-width: 110px;
        max-width: 110px;
        text-align: right;
    }

    .inv-table td.col-sum {
        width: 120px;
        min-width: 120px;
        max-width: 120px;
        text-align: right;
    }

    /* Запрещаем перенос слов в бренде и цифрах, чтобы ячейки не росли в высоту */
    .inv-table td.col-brand,
    .inv-table td.col-price,
    .inv-table td.col-sum {
        white-space: nowrap;
    }
}