* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(0, 122, 255, 0.18), transparent 35%),
        linear-gradient(135deg, #f7f9fc, #eef3f8);
    color: #111827;
    min-height: 100vh;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    padding: 36px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
    animation: fadeUp 0.7s ease forwards;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 34px;
}

.brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, #111827, #374151);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -1px;
}

.brand h1 {
    font-size: 28px;
    line-height: 1.1;
}

.brand p {
    margin-top: 6px;
    color: #6b7280;
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    font-size: 15px;
    outline: none;
    background: #ffffff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.auth-form input:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
    transform: translateY(-1px);
}

.auth-form button {
    margin-top: 8px;
    padding: 15px 18px;
    border: none;
    border-radius: 16px;
    background: #111827;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.auth-form button:hover {
    background: #000000;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.22);
}

.error-message {
    min-height: 20px;
    color: #dc2626;
    font-size: 14px;
    text-align: center;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

/*dashboard css для удобства поиска отдельных страниц*/

.dashboard-page {
    display: flex;
    background:
        radial-gradient(circle at top right, rgba(0, 122, 255, 0.14), transparent 32%),
        linear-gradient(135deg, #f8fafc, #eef3f8);
}

.sidebar {
    padding: 28px;
    backdrop-filter: blur(22px);
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-logo h2 {
    font-size: 22px;
}

.sidebar-logo p {
    margin-top: 4px;
    color: #6b7280;
    font-size: 14px;
}

.sidebar-nav {
    gap: 8px;
    margin-top: 32px;
}

.sidebar-nav a:hover {
    transform: translateX(4px);
}

.logout-btn {
    margin-top: auto;
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: 16px;
    background: #111827;
    color: #ffffff;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.22);
}

.dashboard-content {
    width: 100%;
    padding: 42px;
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 42px;
    letter-spacing: -1px;
}

.dashboard-header p {
    margin-top: 8px;
    color: #6b7280;
    font-size: 16px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 22px;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.12);
}

.card-label {
    display: inline-block;
    margin-bottom: 16px;
    color: #007aff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.dashboard-card h2 {
    font-size: 30px;
    margin-bottom: 8px;
}

.dashboard-card p {
    color: #6b7280;
    line-height: 1.6;
}

.status-badge {
    display: inline-block;
    margin-top: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0, 122, 255, 0.1);
    color: #007aff !important;
    font-weight: 600;
}

.telegram-card {
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.telegram-btn {
    padding: 15px 22px;
    border-radius: 16px;
    background: #111827;
    color: white;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.telegram-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.22);
}

.manager-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.manager-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border-radius: 20px;
    background: #f8fafc;
    text-decoration: none;
    color: #111827;
    transition: background 0.25s ease, transform 0.25s ease;
}

.manager-item:hover {
    background: #eef3f8;
    transform: translateX(4px);
}

.manager-item h3 {
    margin-bottom: 4px;
}

.manager-item p {
    font-size: 14px;
}

.manager-item span {
    color: #007aff;
    font-weight: 600;
}

@media (max-width: 900px) {
    .dashboard-page {
        flex-direction: column;
    }

    .sidebar {
        gap: 24px;
}

}

/*inventory css для удобства поиска отдельных страниц*/

.inventory-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-bottom: 22px;
}

.inventory-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.inventory-table-wrapper {
    overflow-x: auto;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.inventory-table th {
    text-align: left;
    padding: 16px;
    color: #6b7280;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
}

.inventory-table td {
    padding: 18px 16px;
    color: #111827;
    border-bottom: 1px solid #eef2f7;
    font-size: 15px;
}

.inventory-table tr {
    transition: background 0.25s ease;
}

.inventory-table tr:hover {
    background: #f8fafc;
}

.stock-good {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
    font-weight: 700;
}

.stock-low {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
    font-weight: 700;
}

.stock-critical {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    font-weight: 700;
}

.price-text {
    font-weight: 700;
}

.margin-text {
    color: #007aff;
    font-weight: 700;
}

@media (max-width: 1200px) {
    .inventory-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .inventory-top {
        flex-direction: column;
        align-items: flex-start;
    }
}

.inventory-actions {
    gap: 12px;
}

@media (max-width: 900px) {
    .inventory-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .inventory-actions .telegram-btn {
        text-align: center;
    }
}

/*sale и add-sale css для удобства поиска*/

.sale-form-card {
    max-width: 760px;
}

.sale-form {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.sale-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.sale-form input,
.sale-form select {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    font-size: 15px;
    outline: none;
    background: #ffffff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.sale-form input:focus,
.sale-form select:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.form-actions {
    grid-column: 1 / -1;
    gap: 12px;
    align-items: center;
}

.form-main-btn {
    border: none;
    cursor: pointer;
    font-size: 15px;
}

.secondary-btn {
    padding: 15px 22px;
    border-radius: 16px;
    background: #eef3f8;
    color: #111827;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.25s ease, transform 0.25s ease;
}

.secondary-btn:hover {
    background: #e5eaf1;
    transform: translateY(-2px);
}

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

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .telegram-btn,
    .form-actions .secondary-btn {
        text-align: center;
    }
}

/*edit-sale css для удобства поиска*/

.table-actions {
    gap: 8px;
}

/*orders и add-order css для удобства поиска*/

.order-form-card {
    max-width: 1000px;
}

.order-positions-block {
    grid-column: 1 / -1;
    margin-top: 10px;
}

.order-positions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.order-position {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    padding: 18px;
    margin-bottom: 14px;
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.delete-position-btn {
    padding: 14px 16px;
    border: none;
    border-radius: 16px;
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.delete-position-btn:hover {
    background: rgba(220, 38, 38, 0.16);
    transform: translateY(-2px);
}

@media (max-width: 1200px) {
    .order-position {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .order-positions-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .order-position {
        grid-template-columns: 1fr;
    }
}

/*edit-order css для удобства поиска*/

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.edit-btn,
.delete-btn {
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: transform 0.25s ease, background 0.25s ease;
}

.edit-btn {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
}

.edit-btn:hover {
    background: rgba(0, 122, 255, 0.16);
    transform: translateY(-2px);
}

.delete-btn {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.delete-btn:hover {
    background: rgba(220, 38, 38, 0.16);
    transform: translateY(-2px);
}

/* place-order css для удобства поиска*/

.order-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    align-items: start;
}

.order-main-card,
.price-card {
    min-height: 500px;
}

.order-request-form {
    grid-template-columns: repeat(2, 1fr);
}

.full-width {
    grid-column: 1 / -1;
}

.selected-products-block {
    grid-column: 1 / -1;
    margin-top: 12px;
}

.selected-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.order-total {
    padding: 12px 16px;
    border-radius: 16px;
    background: #f8fafc;
    display: flex;
    gap: 8px;
    align-items: center;
    color: #6b7280;
}

.order-total strong {
    color: #111827;
    font-size: 18px;
}

.selected-products {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-order-text {
    padding: 18px;
    border-radius: 18px;
    background: #f8fafc;
    color: #6b7280;
}

.selected-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.selected-product-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
    color: #111827;
}

.selected-product-info p {
    color: #6b7280;
    font-size: 14px;
}

.selected-product-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-product-controls input {
    width: 80px;
    padding: 10px;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
}

.selected-product-controls strong {
    min-width: 100px;
    color: #111827;
}

.price-search {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    font-size: 15px;
    outline: none;
    background: #ffffff;
    margin-bottom: 18px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.price-search:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.price-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 650px;
    overflow-y: auto;
    padding-right: 4px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    transition: transform 0.25s ease, background 0.25s ease;
}

.price-item:hover {
    background: #eef3f8;
    transform: translateY(-2px);
}

.price-item-info span {
    display: inline-block;
    margin-bottom: 6px;
    color: #007aff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.price-item-info h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: #111827;
}

.price-item-info p {
    color: #111827;
    font-weight: 700;
}

.price-item-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 120px;
}

.price-quantity {
    width: 100%;
    padding: 10px;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
}

.add-product-btn {
    padding: 11px 14px;
    border: none;
    border-radius: 12px;
    background: #111827;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.add-product-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.2);
}

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

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

    .selected-products-header,
    .selected-product-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .selected-product-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .price-item {
        flex-direction: column;
    }

    .price-item-actions {
        width: 100%;
    }
}

/*admin-orders css для удобства поиска*/

.status-select {
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid #dbe2ea;
    background: #ffffff;
    font-weight: 600;
    color: #111827;
    outline: none;
}

.status-select:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

/*place-order css для удобства поиска*/

/* Категории прайса */

/* ===== Категории прайса ===== */

.price-header {
    gap: 16px;
}

.category-list {
    gap: 18px;
}

.category-card {
    min-height: 170px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.category-card h3 {
    font-size: 24px;
    color: #111827;
    margin-bottom: 8px;
}

.category-card p {
    color: #6b7280;
    font-size: 15px;
    line-height: 1.5;
}

/* ===== Категории прайса ===== */

/* ===== Категории прайса ===== */

.price-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.price-header p {
    margin-top: 6px;
    color: #6b7280;
    line-height: 1.5;
}

.category-back-btn {
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.category-card {
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    background: #f8fafc;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    background: #ffffff;
}

.category-image-wrap {
    width: 100%;
    height: 110px;
    background: #eef2f7;
    overflow: hidden;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-card-content {
    padding: 14px;
}

.category-card-content h3 {
    font-size: 19px;
    line-height: 1.2;
    color: #111827;
    margin-bottom: 6px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    min-height: 46px;
}

.category-card-content p {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
}

@media (max-width: 1200px) {
    .category-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .category-list {
        grid-template-columns: 1fr;
    }

    .category-back-btn {
        width: 100%;
        text-align: center;
    }

    .category-image-wrap {
        height: 150px;
    }

    .category-card-content h3 {
        font-size: 24px;
    }

    .category-card-content p {
        font-size: 15px;
    }
}

/*admin-orders css для удобства поиска*/

/* ===== Модальное окно заявки ===== */

.is-hidden {
    display: none !important;
}

.admin-order-row {
    cursor: pointer;
}

.admin-order-row:hover {
    background: #f8fafc;
}

.order-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 24px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-modal {
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.25);
    animation: fadeUp 0.25s ease forwards;
}

.order-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.order-modal-header h2 {
    font-size: 32px;
    color: #111827;
}

.modal-close-btn {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.modal-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.22);
}

.order-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 26px;
}

.order-modal-info {
    padding: 18px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.order-modal-info span {
    display: block;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.order-modal-info strong {
    color: #111827;
    font-size: 17px;
    line-height: 1.4;
}

.order-modal-info.full-width {
    grid-column: 1 / -1;
}

.modal-products-block {
    padding-top: 8px;
}

.modal-products-block h3 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #111827;
}

.modal-products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-product-item {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.modal-product-item h4 {
    font-size: 17px;
    color: #111827;
    margin-bottom: 4px;
}

.modal-product-item p {
    color: #6b7280;
    font-size: 14px;
}

.modal-product-item strong {
    color: #111827;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .order-modal {
        padding: 22px;
    }

    .order-modal-header {
        flex-direction: column;
    }

    .order-modal-grid {
        grid-template-columns: 1fr;
    }

    .modal-close-btn {
        width: 100%;
    }

    .modal-product-item {
        flex-direction: column;
    }
}

/*chat и admin-chat css для удобства поиска*/

/* ===== Чат ===== */

.chat-card {
    min-height: 650px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    height: 520px;
    overflow-y: auto;
    padding: 18px;
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    justify-content: flex-start;
}

.chat-message.is-own {
    justify-content: flex-end;
}

.chat-message-bubble {
    max-width: 70%;
    padding: 14px 16px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.chat-message.is-own .chat-message-bubble {
    background: #111827;
    color: #ffffff;
}

.chat-message-text {
    font-size: 15px;
    line-height: 1.5;
}

.chat-message-meta {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.chat-message.is-own .chat-message-meta {
    color: rgba(255, 255, 255, 0.7);
}

.chat-form {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.chat-form input {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    font-size: 15px;
    outline: none;
}

.chat-form input:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.chat-form button {
    border: none;
    cursor: pointer;
}

.chat-admin-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 22px;
}

.chat-users-card {
    min-height: 650px;
}

.chat-users-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-user-item {
    width: 100%;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #f8fafc;
    text-align: left;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.chat-user-item:hover,
.chat-user-item.is-active {
    background: #111827;
    color: #ffffff;
    transform: translateY(-2px);
}

.chat-user-item strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.chat-user-item span {
    color: #6b7280;
    font-size: 14px;
}

.chat-user-item:hover span,
.chat-user-item.is-active span {
    color: rgba(255, 255, 255, 0.75);
}

.chat-active-header {
    margin-bottom: 18px;
}

@media (max-width: 1000px) {
    .chat-admin-layout {
        grid-template-columns: 1fr;
    }

    .chat-form {
        flex-direction: column;
    }

    .chat-form button {
        width: 100%;
        text-align: center;
    }

    .chat-message-bubble {
        max-width: 90%;
    }
}

.admin-product-decision {
    flex-direction: column;
}

.admin-product-controls {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 16px;
}

.admin-product-controls label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.admin-product-controls input,
.admin-product-controls select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    font-size: 14px;
    outline: none;
    background: #ffffff;
}

.admin-product-controls button {
    grid-column: 1 / -1;
    border: none;
    cursor: pointer;
}

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

/* ===== Мои заявки: компактный список + модальное окно ===== */

.client-orders-list {
    gap: 14px;
}

.client-order-summary-card {
    padding: 20px;
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    transition: background 0.25s ease, transform 0.25s ease;
}

.client-order-summary-card:hover {
    background: #eef3f8;
    transform: translateY(-2px);
}

.client-open-order-btn {
    border: none;
    cursor: pointer;
}

.client-modal-product-item {
    align-items: flex-start;
}

.client-modal-product-item.is-removed {
    opacity: 0.65;
}

.client-modal-product-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.client-product-status {
    white-space: nowrap;
}

.status-approved {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.status-declined {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}

.status-changed {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.status-pending {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
}

.warning-text {
    color: #d97706 !important;
    font-weight: 700;
}

.danger-text {
    font-weight: 700;
}

@media (max-width: 900px) {
    .client-order-summary-card,
    .client-order-summary-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .client-open-order-btn {
        width: 100%;
        text-align: center;
    }

    .client-modal-product-side {
        width: 100%;
        align-items: flex-start;
    }
}

/* ===== Ответы клиентов в админке ===== */

.notification-summary-card {
    position: relative;
}

.client-answer-badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.client-answer-new {
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.08);
}

.client-answer-approved {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.client-answer-declined {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}

.client-answer-waiting {
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
}

.client-answer-default {
    background: #eef3f8;
    color: #6b7280;
}

.client-product-status {
    display: inline-block;
    margin-left: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.client-cancel-order-btn {
    padding: 15px 22px;
    border-radius: 16px;
    font-size: 15px;
    cursor: pointer;
}

.client-order-actions {
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== Сравнение цены продажи с актуальным прайсом ===== */

.price-compare-warning {
    color: #d97706 !important;
    font-weight: 700;
}

.actual-price-cell {
    gap: 4px;
}

/* ===== Компактные таблицы без вылезания за рамки ===== */

.inventory-table-wrapper {
    width: 100%;
    overflow: hidden;
}

.compact-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.compact-table th,
.compact-table td {
    padding: 18px 10px;
    vertical-align: middle;
}

.compact-table th {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 800;
    text-transform: uppercase;
}

.compact-table td {
    color: #111827;
}

/* Цены не переносятся */
.compact-table .price-text,
.compact-table .margin-text {
    font-weight: 800;
}

/* Модель аккуратно переносится */
.stock-table td:nth-child(1),
.sales-table td:nth-child(2) {
    word-break: normal;
    overflow-wrap: break-word;
}

/* Ячейка актуальной цены из прайса */
.actual-price-cell {
    gap: 4px;
}

/* Действия — вертикально, чтобы не ломали строку */
.compact-table .table-actions {
    flex-direction: column;
    gap: 7px;
}

.compact-table .edit-btn,
.compact-table .delete-btn {
    padding: 10px 13px;
    border-radius: 13px;
    font-size: 13px;
    line-height: 1;
}

/* ===== Ширины колонок склада ===== */

/* ===== Ширины колонок продаж ===== */

/* Чтобы кнопки в продажах не вылезали */
.sales-table td:nth-child(10) .table-actions {
    align-items: stretch;
}

.sales-table td:nth-child(10) .edit-btn,
.sales-table td:nth-child(10) .delete-btn {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    max-width: 130px;
}

/* На маленьких экранах всё равно разрешаем прокрутку */

.compact-table td {
    font-size: 15px;
    line-height: 1.25;
}

/* Название модели — максимум 2 строки */
.compact-table td:nth-child(1),
.sales-table td:nth-child(2) {
    overflow: hidden;
}

.compact-table td:nth-child(1),
.sales-table td:nth-child(2) {
    display: table-cell;
}

.compact-table td:nth-child(1) {
    max-width: 220px;
}

.sales-table td:nth-child(2) {
    max-width: 210px;
}

/* Текст внутри ячейки цены в прайсе */
.actual-price-cell {
    max-width: 130px;
    min-width: 115px;
}

.actual-price-cell span {
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.25;
}

/* Кнопки в таблице */
.compact-table .table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.compact-table .edit-btn,
.compact-table .delete-btn {
    white-space: nowrap;
}

/* Ширины колонок склада */

.stock-table th:nth-child(2),
.stock-table td:nth-child(2) {
    width: 9%;
}

.stock-table th:nth-child(3),
.stock-table td:nth-child(3) {
    width: 8%;
}

.stock-table th:nth-child(4),
.stock-table td:nth-child(4) {
    width: 11%;
}

.stock-table th:nth-child(5),
.stock-table td:nth-child(5) {
    width: 12%;
}

.stock-table th:nth-child(6),
.stock-table td:nth-child(6) {
    width: 12%;
}

/* Ширины колонок продаж */

/* Чтобы длинные значения не ломали таблицу */
.compact-table td {
    overflow-wrap: normal;
}

.compact-table .price-text,
.compact-table .margin-text {
    white-space: nowrap;
}

/* Мобильная версия */
@media (max-width: 1100px) {
    .inventory-table-wrapper {
        overflow-x: auto;
    }

    .compact-table {
        min-width: 1150px;
    }
}

/* ===== Исправление ширины колонки "Действия" ===== */

.compact-table th,
.compact-table td {
    box-sizing: border-box;
}

/* Чуть уменьшаем несколько колонок склада */
.stock-table th:nth-child(1),
.stock-table td:nth-child(1) {
    width: 17%;
}

.stock-table th:nth-child(7),
.stock-table td:nth-child(7) {
    width: 12%;
}

.stock-table th:nth-child(8),
.stock-table td:nth-child(8) {
    width: 8%;
}

/* Расширяем колонку "Действия" */
.stock-table th:nth-child(9),
.stock-table td:nth-child(9) {
    width: 12%;
}

/* Чтобы слово "Действия" не обрезалось */
.stock-table th:nth-child(9) {
    white-space: nowrap;
    font-size: 13px;
    letter-spacing: 0;
}

/* Кнопка удаления аккуратно внутри колонки */
.stock-table td:nth-child(9) .table-actions {
    align-items: flex-start;
}

.stock-table td:nth-child(9) .delete-btn {
    padding: 11px 15px;
    max-width: 100%;
}

/* ===== Цвет цены в прайсе относительно закупочной цены ===== */

.price-compare-good {
    color: #16a34a !important;
    font-weight: 800;
}

.price-compare-danger {
    color: #dc2626 !important;
    font-weight: 800;
}

.price-compare-neutral {
    color: #111827 !important;
    font-weight: 800;
}

.actual-price-cell {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.actual-price-cell strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
    white-space: nowrap;
}

.actual-price-cell span {
    display: none;
}

/* ===== Таблица заказов в стиле склада и продаж ===== */

.orders-table .table-actions {
    gap: 7px;
}

/* Ширины колонок заказов */

.orders-table .actual-price-cell {
    gap: 0;
}

/* ===== Исправление таблицы заказов ===== */

.orders-table .price-text,
.orders-table .margin-text {
    white-space: nowrap;
    font-weight: 800;
}

.orders-table td:nth-child(3) {
    word-break: normal;
    overflow-wrap: break-word;
}

.orders-table .table-actions {
    gap: 7px;
}

.orders-table .edit-btn,
.orders-table .delete-btn {
    display: inline-flex;
    justify-content: center;
}

.orders-table .actual-price-cell {
    flex-direction: column;
    gap: 0;
}

.orders-table .actual-price-cell strong {
    white-space: nowrap;
}

/* Ширины колонок заказов */

/* ===== Финальная аккуратная таблица заказов ===== */

.orders-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.orders-table th,
.orders-table td {
    box-sizing: border-box;
    padding: 18px 12px;
    vertical-align: middle;
}

.orders-table th {
    color: #6b7280;
    font-size: 12.5px;
    line-height: 1.15;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.orders-table td {
    color: #111827;
    font-size: 15px;
    line-height: 1.25;
}

/* Числовые колонки */
.orders-table td:nth-child(4),
.orders-table td:nth-child(5),
.orders-table td:nth-child(6),
.orders-table td:nth-child(7),
.orders-table td:nth-child(8),
.orders-table td:nth-child(9) {
    font-weight: 800;
}

/* Дата */

/* Поставщик */

/* Модель */
.orders-table th:nth-child(3),
.orders-table td:nth-child(3) {
    overflow-wrap: break-word;
}

/* Кол-во */

/* Закупочная цена */

/* Цена продажи */

/* Цена в прайсе */

/* Сумма закупки */

/* Потенциал продажи */

/* Действия */

/* Чтобы цены не переносились */
.orders-table .price-text,
.orders-table .margin-text,
.orders-table .actual-price-cell strong {
    white-space: nowrap;
}

/* Цена в прайсе */
.orders-table .actual-price-cell {
    display: flex;
    align-items: flex-start;
}

.orders-table .actual-price-cell strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}

/* Кнопки действий компактно */
.orders-table .table-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.orders-table .edit-btn,
.orders-table .delete-btn {
    width: 100%;
    max-width: 118px;
    padding: 10px 11px;
    border-radius: 13px;
    font-size: 12.5px;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

/* Чтобы заголовки не слипались */
.orders-table th:nth-child(2),
.orders-table td:nth-child(2) {
    padding-right: 18px;
}

.orders-table th:nth-child(3),
.orders-table td:nth-child(3) {
    padding-left: 18px;
}

/* На маленьких экранах разрешаем прокрутку */
@media (max-width: 1200px) {
    .inventory-table-wrapper {
        overflow-x: auto;
    }

    .orders-table {
        min-width: 1120px;
    }
}

/* ===== Ровные кнопки действий в заказах и продажах ===== */

/* Общая ячейка действий */
.orders-table td:nth-child(10),
.sales-table td:nth-child(10) {
    overflow: visible;
}

/* Контейнер кнопок */
.orders-table .table-actions,
.sales-table .table-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

/* Сами кнопки */
.orders-table .edit-btn,
.orders-table .delete-btn,
.sales-table .edit-btn,
.sales-table .delete-btn {
    width: 125px;
    min-width: 125px;
    max-width: 125px;

    height: 42px;
    padding: 0 12px;

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

    box-sizing: border-box;
    border-radius: 14px;

    font-size: 14px;
    font-weight: 800;
    line-height: 1;

    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

/* Чтобы ссылка "Редактировать" выглядела как нормальная кнопка */
.orders-table .edit-btn,
.sales-table .edit-btn {
    text-decoration: none;
}

/* Колонка действий в продажах */
.sales-table th:nth-child(10),
.sales-table td:nth-child(10) {
    width: 16%;
}

/* Колонки продаж, чтобы всё красиво влезало */
.sales-table th:nth-child(1),
.sales-table td:nth-child(1) {
    width: 7%;
}

.sales-table th:nth-child(2),
.sales-table td:nth-child(2) {
    width: 15%;
}

.sales-table th:nth-child(3),
.sales-table td:nth-child(3) {
    width: 6%;
}

.sales-table th:nth-child(4),
.sales-table td:nth-child(4) {
    width: 10%;
}

.sales-table th:nth-child(5),
.sales-table td:nth-child(5) {
    width: 10%;
}

.sales-table th:nth-child(6),
.sales-table td:nth-child(6) {
    width: 10%;
}

.sales-table th:nth-child(7),
.sales-table td:nth-child(7) {
    width: 9%;
}

.sales-table th:nth-child(8),
.sales-table td:nth-child(8) {
    width: 8%;
}

.sales-table th:nth-child(9),
.sales-table td:nth-child(9) {
    width: 9%;
}

/* Колонка действий в заказах */
.orders-table th:nth-child(10),
.orders-table td:nth-child(10) {
    width: 13%;
}

/* Колонки заказов, чтобы кнопки не сжимались */
.orders-table th:nth-child(1),
.orders-table td:nth-child(1) {
    width: 8%;
}

.orders-table th:nth-child(2),
.orders-table td:nth-child(2) {
    width: 10%;
}

.orders-table th:nth-child(3),
.orders-table td:nth-child(3) {
    width: 15%;
}

.orders-table th:nth-child(4),
.orders-table td:nth-child(4) {
    width: 6%;
}

.orders-table th:nth-child(5),
.orders-table td:nth-child(5) {
    width: 10%;
}

.orders-table th:nth-child(6),
.orders-table td:nth-child(6) {
    width: 10%;
}

.orders-table th:nth-child(7),
.orders-table td:nth-child(7) {
    width: 9%;
}

.orders-table th:nth-child(8),
.orders-table td:nth-child(8) {
    width: 10%;
}

.orders-table th:nth-child(9),
.orders-table td:nth-child(9) {
    width: 9%;
}

/* ===== Выполненные заказы клиента ===== */

.client-orders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== Заказы: компактная строка + модальное окно ===== */

.orders-summary-table {
    width: 100%;
    table-layout: fixed;
}

.orders-summary-table th,
.orders-summary-table td {
    padding: 20px 12px;
    vertical-align: middle;
    box-sizing: border-box;
}

.orders-summary-table th {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 800;
    text-transform: uppercase;
}

.orders-summary-table td {
    color: #111827;
    font-size: 15px;
    line-height: 1.25;
}

.orders-summary-table .price-text {
    white-space: nowrap;
    font-weight: 800;
}

.orders-summary-table th:nth-child(1),
.orders-summary-table td:nth-child(1) {
    width: 13%;
}

.orders-summary-table th:nth-child(2),
.orders-summary-table td:nth-child(2) {
    width: 18%;
}

.orders-summary-table th:nth-child(3),
.orders-summary-table td:nth-child(3) {
    width: 10%;
}

.orders-summary-table th:nth-child(4),
.orders-summary-table td:nth-child(4) {
    width: 10%;
}

.orders-summary-table th:nth-child(5),
.orders-summary-table td:nth-child(5) {
    width: 17%;
}

.orders-summary-table th:nth-child(6),
.orders-summary-table td:nth-child(6) {
    width: 17%;
}

.orders-summary-table th:nth-child(7),
.orders-summary-table td:nth-child(7) {
    width: 15%;
}

.order-summary-row {
    cursor: pointer;
    transition: background 0.2s ease;
}

.order-summary-row:hover {
    background: #f8fafc;
}

.order-position-card {
    align-items: flex-start;
}

.order-position-card h4 {
    margin-bottom: 10px;
}

.order-position-card p {
    margin-top: 6px;
    color: #6b7280;
}

.order-position-card p strong {
    color: #111827;
}

.order-position-totals {
    min-width: 220px;
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;

    display: flex;
    flex-direction: column;
    gap: 6px;
}

.order-position-totals span {
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.order-position-totals strong {
    color: #111827;
    font-size: 17px;
    margin-bottom: 8px;
}

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

    .order-position-totals {
        width: 100%;
        min-width: auto;
    }
}

/* ===== Таблица позиций внутри модального окна заказа ===== */

.modal-order-table-wrapper {
    margin-top: 18px;
    overflow-x: auto;
}

.order-modal-positions-table {
    width: 100%;
    min-width: 920px;
    table-layout: fixed;
}

.order-modal-positions-table th,
.order-modal-positions-table td {
    padding: 16px 10px;
    vertical-align: middle;
    box-sizing: border-box;
}

.order-modal-positions-table th {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 800;
    text-transform: uppercase;
}

.order-modal-positions-table td {
    color: #111827;
    font-size: 14px;
    line-height: 1.25;
}

.order-modal-positions-table .price-text,
.order-modal-positions-table .margin-text {
    white-space: nowrap;
    font-weight: 800;
}

.order-modal-positions-table td:nth-child(1) {
    overflow-wrap: break-word;
}

.order-modal-positions-table th:nth-child(1),
.order-modal-positions-table td:nth-child(1) {
    width: 24%;
}

.order-modal-positions-table th:nth-child(2),
.order-modal-positions-table td:nth-child(2) {
    width: 8%;
}

.order-modal-positions-table th:nth-child(3),
.order-modal-positions-table td:nth-child(3) {
    width: 12%;
}

.order-modal-positions-table th:nth-child(4),
.order-modal-positions-table td:nth-child(4) {
    width: 12%;
}

.order-modal-positions-table th:nth-child(5),
.order-modal-positions-table td:nth-child(5) {
    width: 12%;
}

.order-modal-positions-table th:nth-child(6),
.order-modal-positions-table td:nth-child(6) {
    width: 12%;
}

.order-modal-positions-table th:nth-child(7),
.order-modal-positions-table td:nth-child(7) {
    width: 13%;
}

.order-modal-positions-table th:nth-child(8),
.order-modal-positions-table td:nth-child(8) {
    width: 7%;
}

.order-modal-positions-table .actual-price-cell {
    display: flex;
    align-items: flex-start;
}

.order-modal-positions-table .actual-price-cell strong {
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
}

/* ===== Автокорзина дозакупки ===== */

.auto-restock-description {
    margin-top: 8px;
    color: #6b7280;
}

.auto-order-profile {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.auto-order-profile label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #374151;
    font-weight: 700;
}

.auto-order-profile input {
    width: 100%;
    height: 54px;
    padding: 0 18px;
    border: 1px solid #dce3ea;
    border-radius: 16px;
    background: #fff;
    color: #111827;
    font-size: 16px;
    outline: none;
}

.auto-order-profile .full-width {
    grid-column: 1 / -1;
}

.auto-restock-item {
    align-items: center;
}

.auto-restock-item p {
    color: #6b7280;
}

.auto-restock-ordered-text {
    color: #d97706 !important;
    font-weight: 800;
}

.auto-restock-controls {
    align-items: flex-end;
}

.auto-restock-quantity-badge {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.auto-restock-price {
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.auto-restock-reset-btn {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
}

#autoRestockSubmitBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

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

    .auto-restock-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .auto-restock-controls {
        width: 100%;
        min-width: auto;
        align-items: flex-start;
    }
}

/* ===== Фиксируем высоту модулей и включаем прокрутку внутри ===== */

/* Чтобы сама страница не разрасталась бесконечно */
.dashboard-page {
    min-height: 100vh;
}

/* Карточка склада не растягивается от количества строк */
.inventory-card {
    overflow: hidden;
}

/* Таблица склада прокручивается внутри своего блока */
.inventory-card .inventory-table-wrapper {
    max-height: 430px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

/* Шапка таблицы остаётся сверху при прокрутке */
.inventory-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #ffffff;
}

/* Автокорзина тоже не растягивает страницу */

/* Верхняя часть автокорзины остаётся обычной */
.auto-restock-card .inventory-top,
.auto-restock-card .auto-order-profile,
.auto-restock-card .selected-products-header,
.auto-restock-card .form-actions {
    flex-shrink: 0;
}

/* Список позиций автокорзины прокручивается внутри */

/* Красивее скролл внутри модулей */
.inventory-table-wrapper::-webkit-scrollbar,
#autoRestockCartItems::-webkit-scrollbar {
    width: 8px;
}

.inventory-table-wrapper::-webkit-scrollbar-track,
#autoRestockCartItems::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 999px;
}

.inventory-table-wrapper::-webkit-scrollbar-thumb,
#autoRestockCartItems::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.inventory-table-wrapper::-webkit-scrollbar-thumb:hover,
#autoRestockCartItems::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Чтобы строки таблицы выглядели аккуратно внутри прокрутки */
.inventory-table tbody tr {
    background: #ffffff;
}

/* Для маленьких экранов оставляем нормальную прокрутку */
@media (max-width: 1100px) {
    .inventory-card .inventory-table-wrapper {
        overflow-x: auto;
    }
}

/* ===== Жёсткая фиксация высоты склада и автокорзины ===== */

/* Страница больше не должна растягиваться из-за таблиц */

/* Карточка склада фиксированной высоты */
.inventory-card:has(.stock-table) {
    overflow: hidden;
}

/* Верх карточки склада не прокручивается */
.inventory-card:has(.stock-table) .inventory-top {
    flex-shrink: 0;
}

/* Прокручивается только таблица склада */
.inventory-card:has(.stock-table) .inventory-table-wrapper {
    max-height: 310px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 6px;
}

/* Шапка таблицы остаётся сверху */
.stock-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #ffffff;
}

/* Автокорзина тоже не растягивает страницу */

/* Прокручивается только список позиций автокорзины */

/* Если в автокорзине много полей, не даём ей раздувать страницу */

/* Красивый скролл внутри таблицы и автокорзины */
.inventory-card:has(.stock-table) .inventory-table-wrapper::-webkit-scrollbar,
#autoRestockCartItems::-webkit-scrollbar {
    width: 8px;
}

.inventory-card:has(.stock-table) .inventory-table-wrapper::-webkit-scrollbar-track,
#autoRestockCartItems::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 999px;
}

.inventory-card:has(.stock-table) .inventory-table-wrapper::-webkit-scrollbar-thumb,
#autoRestockCartItems::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.inventory-card:has(.stock-table) .inventory-table-wrapper::-webkit-scrollbar-thumb:hover,
#autoRestockCartItems::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== Финальная компоновка склада и автокорзины ===== */

/* Убираем слишком жёсткое растягивание старых правил */
.inventory-card:has(.stock-table) {
    max-height: none !important;
}

/* Карточка склада становится компактной */
.stock-inventory-card {
    max-height: 470px !important;
    overflow: hidden !important;
}

/* Верх склада остаётся видимым */
.stock-inventory-card .inventory-top {
    flex-shrink: 0;
}

/* Прокручивается только таблица склада */

/* Шапка таблицы склада фиксируется */
.stock-inventory-card .stock-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #ffffff;
}

/* Автокорзина должна начинаться сразу после склада */

/* Поля автокорзины не должны раздувать карточку */
.auto-order-profile {
    margin-top: 18px !important;
    margin-bottom: 18px !important;
}

/* Список товаров автокорзины прокручивается внутри */
#autoRestockCartItems {
    max-height: 210px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 6px;
}

/* Делаем карточки автокорзины компактнее */
.auto-restock-item {
    padding: 16px 18px !important;
}

.auto-restock-item h3 {
    font-size: 18px !important;
    margin-top: 4px !important;
}

.auto-restock-item p {
    margin-top: 4px !important;
    font-size: 14px !important;
}

.auto-restock-controls {
    min-width: 220px !important;
}

/* Кнопка отправки не должна увеличивать блок */
.auto-restock-card .form-actions {
    margin-top: 16px !important;
}

/* Красивый скролл */
.stock-inventory-card .inventory-table-wrapper::-webkit-scrollbar,
#autoRestockCartItems::-webkit-scrollbar {
    width: 8px;
}

.stock-inventory-card .inventory-table-wrapper::-webkit-scrollbar-track,
#autoRestockCartItems::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 999px;
}

.stock-inventory-card .inventory-table-wrapper::-webkit-scrollbar-thumb,
#autoRestockCartItems::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.stock-inventory-card .inventory-table-wrapper::-webkit-scrollbar-thumb:hover,
#autoRestockCartItems::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== Удобная автокорзина: данные слева, товары справа ===== */

.auto-restock-card {
    margin-top: 24px !important;
}

.auto-restock-top {
    margin-bottom: 22px;
}

.auto-restock-layout {
    gap: 24px;
}

/* Левая панель с данными заявки */
.auto-restock-profile-panel {
    padding: 22px;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.auto-restock-profile-panel h3 {
    margin-top: 8px;
    margin-bottom: 18px;
    color: #111827;
    font-size: 22px;
}

.auto-restock-profile-panel .auto-order-profile {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    margin: 0 !important;
}

.auto-restock-profile-panel .auto-order-profile label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #374151;
    font-weight: 800;
}

.auto-restock-profile-panel .auto-order-profile input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border: 1px solid #dce3ea;
    border-radius: 15px;
    background: #fff;
    color: #111827;
    font-size: 15px;
    outline: none;
}

.auto-restock-submit-fixed {
    width: 100%;
    margin-top: 18px;
}

/* Правая панель с товарами */
.auto-restock-cart-panel {
    min-width: 0;
    padding: 22px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.auto-restock-cart-header {
    flex-shrink: 0;
}

/* Теперь прокрутка находится сразу возле списка товаров */
#autoRestockCartItems.auto-restock-scroll-list {
    max-height: 390px !important;
    min-height: 220px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 8px;
}

/* Более компактные карточки внутри автокорзины */
.auto-restock-scroll-list .auto-restock-item {
    padding: 16px 18px !important;
    border-radius: 18px;
}

.auto-restock-scroll-list .auto-restock-item h3 {
    font-size: 18px !important;
    margin-top: 5px !important;
    margin-bottom: 4px !important;
}

.auto-restock-scroll-list .auto-restock-item p {
    margin-top: 4px !important;
    font-size: 14px !important;
}

/* Красивый скролл именно у списка товаров */
#autoRestockCartItems.auto-restock-scroll-list::-webkit-scrollbar {
    width: 8px;
}

#autoRestockCartItems.auto-restock-scroll-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 999px;
}

#autoRestockCartItems.auto-restock-scroll-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

#autoRestockCartItems.auto-restock-scroll-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Планшеты и маленькие экраны */
@media (max-width: 1100px) {

    #autoRestockCartItems.auto-restock-scroll-list {
        max-height: 320px !important;
    }
}

/* ===== Аккуратная цена за штуку в автокорзине ===== */

.auto-restock-scroll-list .auto-restock-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 22px !important;
    align-items: center !important;
}

.auto-restock-scroll-list .auto-restock-controls {
    min-width: 390px !important;
    display: grid !important;
    grid-template-columns: auto 110px 110px !important;
    align-items: center !important;
    gap: 18px !important;
}

.auto-restock-scroll-list .auto-restock-controls strong {
    white-space: nowrap !important;
    text-align: right;
    font-size: 20px;
}

.auto-restock-scroll-list .auto-restock-price {
    white-space: nowrap !important;
    text-align: right;
    color: #6b7280;
    font-size: 14px !important;
    font-weight: 800;
    line-height: 1.2;
}

.auto-restock-scroll-list .auto-restock-quantity-badge {
    white-space: nowrap !important;
    justify-content: center;
}

@media (max-width: 900px) {
    .auto-restock-scroll-list .auto-restock-item {
        grid-template-columns: 1fr !important;
    }

    .auto-restock-scroll-list .auto-restock-controls {
        width: 100% !important;
        min-width: 0 !important;
        grid-template-columns: 1fr !important;
        justify-items: flex-start;
    }

    .auto-restock-scroll-list .auto-restock-controls strong,
    .auto-restock-scroll-list .auto-restock-price {
        text-align: left;
    }
}

/* ===== Админ: пользователи и учётность клиентов ===== */

.admin-users-card {
    margin-bottom: 28px;
}

.admin-users-table tbody tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

.admin-users-table tbody tr:hover {
    background: #f8fafc;
}

.admin-user-accounting-card {
    margin-top: 28px;
}

.admin-user-summary {
    margin-top: 24px;
}

.admin-accounting-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
    margin-bottom: 22px;
}

.admin-tab-btn {
    border: none;
    border-radius: 16px;
    padding: 14px 20px;
    background: #eef4ff;
    color: #007aff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.admin-tab-btn.is-active {
    background: #0b1220;
    color: #ffffff;
}

.admin-accounting-content {
    margin-top: 12px;
}

.admin-accounting-table-wrapper {
    max-height: 520px;
    overflow-y: auto;
    overflow-x: auto;
}

/* ===== Админ: уведомления о дозакупке ===== */

.restock-notifications-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 22px;
}

.restock-notification-card {
    padding: 22px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.restock-notification-card.restock-status-new {
    border-color: rgba(0, 122, 255, 0.35);
    background: #f8fbff;
}

.restock-notification-card.restock-status-closed {
    opacity: 0.65;
}

.restock-notification-main {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.restock-notification-topline {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.restock-notification-topline span:last-child {
    color: #6b7280;
    font-size: 14px;
}

.restock-notification-card h3 {
    color: #111827;
    font-size: 24px;
    margin-bottom: 10px;
}

.restock-notification-card p {
    color: #6b7280;
    margin-top: 6px;
}

.restock-notification-card p strong {
    color: #111827;
}

.restock-notification-price {
    min-width: 190px;
    padding: 18px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.restock-notification-price span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.restock-notification-price strong {
    color: #111827;
    font-size: 24px;
}

.restock-notification-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-top: 18px;
}

.restock-notification-grid div {
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
}

.restock-notification-grid span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.restock-notification-grid strong {
    color: #111827;
    font-size: 18px;
}

.restock-notification-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

@media (max-width: 1100px) {
    .restock-notification-main {
        flex-direction: column;
    }

    .restock-notification-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Кнопка "Написать" в уведомлениях склада ===== */

.restock-notification-actions .write-chat-btn {
    min-width: 150px;
    justify-content: center;
    font-weight: 800;
    background: #0b1220;
    color: #ffffff;
    border-color: #0b1220;
}

.restock-notification-actions .write-chat-btn:hover {
    transform: translateY(-1px);
    background: #111827;
}

/* ===== Красные счётчики новых сообщений ===== */

[data-chat-badge] {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.chat-unread-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;

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

    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;

    font-size: 12px;
    font-weight: 900;
    line-height: 1;

    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.28);
}

.chat-unread-badge.is-hidden {
    display: none;
}

/* ===== Непрочитанные сообщения в списке клиентов админа ===== */

.chat-user-item {
    gap: 12px;
}

.chat-user-info {
    gap: 4px;
}

.chat-user-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.chat-user-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.chat-user-info strong,
.chat-user-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-user-unread-badge {
    width: 36px;
    height: 36px;
    min-width: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: #ff4b4b;
    color: #ffffff;

    font-size: 18px;
    font-weight: 800;
    line-height: 1;

    box-shadow: 0 8px 18px rgba(255, 75, 75, 0.28);
    flex-shrink: 0;
}

.chat-user-item.is-active .chat-user-unread-badge {
    background: #ff4b4b;
    color: #ffffff;
}

/* ===== Исправление цвета цифры в бейдже клиента ===== */

.chat-user-item .chat-user-unread-badge,
.chat-user-item.is-active .chat-user-unread-badge,
.chat-user-unread-badge {
    color: #ffffff !important;
    background: #ff4b4b !important;
}

.chat-user-item .chat-user-unread-badge {
    width: 36px;
    height: 36px;
    min-width: 36px;

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

    border-radius: 50%;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;

    box-shadow: 0 8px 18px rgba(255, 75, 75, 0.28);
}

/* ===== Красный счётчик изменений в «Мои заявки» ===== */

[data-my-orders-badge] {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.my-orders-unread-badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;
    min-width: 22px;

    border-radius: 50%;
    background: #ff4d4f !important;
    color: #ffffff !important;

    font-size: 16px;
    font-weight: 700;
    line-height: 1;

    margin-left: 10px;
    padding: 0;

    box-shadow: 0 10px 24px rgba(255, 77, 79, 0.22);
    flex-shrink: 0;
}

.my-orders-unread-badge.is-hidden {
    display: none !important;
}

/* ===== Все уведомления в меню справа ===== */

.sidebar-nav a[data-chat-badge],
.sidebar-nav a[data-my-orders-badge] {
    width: 100%;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Сами красные кружки всегда прижаты вправо */
.sidebar-nav a .chat-unread-badge,
.sidebar-nav a .my-orders-unread-badge {
    margin-left: auto !important;
    flex-shrink: 0;
}

/* Одинаковый размер всех уведомлений */
.sidebar-nav a .chat-unread-badge,
.sidebar-nav a .my-orders-unread-badge {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;

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

    border-radius: 50%;
    background: #ff4d4f !important;
    color: #ffffff !important;

    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 1;

    padding: 0 !important;
    box-shadow: 0 10px 24px rgba(255, 77, 79, 0.22);
}

.sidebar-nav a .chat-unread-badge.is-hidden,
.sidebar-nav a .my-orders-unread-badge.is-hidden {
    display: none !important;
}

/* ===== Красный значок изменения заявки ===== */

.my-order-card-with-badge,
.order-card,
.request-card,
.my-order-card {
    position: relative;
}

/* ===== Красный значок изменения конкретной заявки ===== */

.client-order-summary-card,
.my-order-card-with-badge {
    position: relative;
}

.order-admin-change-badge {
    position: absolute;
    top: 22px;
    right: 22px;

    width: 30px;
    height: 30px;
    min-width: 30px;

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

    border-radius: 50%;
    background: #ff4d4f !important;
    color: #ffffff !important;

    font-size: 18px;
    font-weight: 900;
    line-height: 1;

    box-shadow: 0 10px 24px rgba(255, 77, 79, 0.22);
    z-index: 20;
}

/* ===== Кнопки действий в учётности ===== */

.inventory-actions {
    gap: 10px;
}

.edit-btn.inventory-action-btn {
    background: #e8f2ff;
    color: #007aff;
}

.delete-btn.inventory-action-btn {
    background: #fde8e8;
    color: #dc2626;
}

/* ===== Верхние кнопки учётности ===== */

.inventory-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 14px !important;
    flex-wrap: wrap;
}

/* ===== Кнопки в строках таблицы учётности ===== */

/* ===== Кнопки в строках таблицы учётности ===== */

.inventory-row-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.inventory-row-btn {
    width: 130px;
    height: 34px;

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

    border: none;
    border-radius: 12px;

    font-size: 13px;
    font-weight: 800;
    line-height: 1;

    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    padding: 0 10px;
}

.inventory-edit-btn {
    background: #eaf3ff;
    color: #007aff;
}

.inventory-delete-btn {
    background: #fde8e8;
    color: #dc2626;
}

.inventory-row-btn:hover {
    opacity: 0.9;
}

/* ===== Колонка действий в учётности ===== */

#inventoryTableBody td:last-child {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

#inventoryTableBody td:last-child .inventory-row-actions {
    justify-content: center;
}

/* ===== Кнопки действий в заказах ===== */

.orders-row-actions {
    gap: 6px;
}

/* Колонка действий в заказах */

/* ===== Кнопки действий в заказах ===== */

.orders-row-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.orders-row-btn {
    width: 130px !important;
    height: 34px !important;

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

    border: none;
    border-radius: 12px;

    font-size: 13px !important;
    font-weight: 800;
    line-height: 1;

    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    padding: 0 10px !important;

    text-decoration: none !important;
}

.orders-row-btn:link,
.orders-row-btn:visited,
.orders-row-btn:hover,
.orders-row-btn:active,
.orders-row-btn:focus {
    text-decoration: none !important;
}

.orders-edit-btn {
    background: #eaf3ff !important;
    color: #007aff !important;
}

.orders-delete-btn {
    background: #fde8e8 !important;
    color: #dc2626 !important;
}

.orders-row-btn:hover {
    opacity: 0.9;
}

#ordersTableBody td:last-child {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

.finance-summary-grid {
    gap: 16px;
}

.finance-summary-card strong {
    font-size: 24px;
}

.accounting-admin-panel {
    margin-top: 26px;
}

.accounting-admin-panel label {
    gap: 8px;
}

.accounting-form {
    gap: 14px;
}

/* ===== Accounting page ===== */

.accounting-page {
    min-height: 100vh;
}

.accounting-card {
    border-radius: 34px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

.accounting-header {
    gap: 24px;
    margin-bottom: 30px;
}

.accounting-header h1 {
    margin: 12px 0 8px;
    font-size: 38px;
    font-weight: 900;
    color: #111827;
}

.accounting-header p {
    margin: 0;
    font-size: 18px;
    color: #6b7280;
}

.accounting-dark-btn {
    height: 58px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 18px;
    background: #0b1220;
    color: #ffffff !important;
    font-size: 17px;
    font-weight: 800;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
}

.accounting-dark-btn:hover {
    opacity: 0.92;
}

/* ===== Admin panel ===== */

.accounting-admin-panel {
    gap: 18px;
}

.accounting-client-select label,
.accounting-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;

    font-size: 15px;
    font-weight: 800;
    color: #374151;
}

.accounting-admin-panel select,
.accounting-admin-panel input {
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    background: #ffffff;
    font-size: 16px;
    color: #111827;
    outline: none;
}

.accounting-form {
    gap: 14px;
}

/* ===== Summary cards ===== */

.finance-summary-grid {
    gap: 16px;
}

.finance-summary-card {
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    background: #f8fafc;
}

.finance-summary-card span {
    display: block;
    margin-bottom: 14px;
    font-weight: 800;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.finance-summary-card strong {
    font-size: 28px;
    font-weight: 900;
    color: #0f172a;
}

/* ===== DDS table ===== */

.accounting-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin: 12px 0 18px;
}

.accounting-section-header h2 {
    margin: 10px 0 0;
    font-size: 30px;
    font-weight: 900;
    color: #111827;
}

.accounting-table-wrapper {
    max-height: 420px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    background: #ffffff;
}

.accounting-table {
    border-collapse: collapse;
}

.accounting-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
}

.accounting-table th {
    padding: 18px 20px;
    text-align: left;

    font-size: 14px;
    font-weight: 900;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;

    border-bottom: 1px solid #e5e7eb;
}

.accounting-table td {
    padding: 18px 20px;
    font-size: 17px;
    color: #111827;
    border-bottom: 1px solid #eef2f7;
}

.accounting-table tbody tr:last-child td {
    border-bottom: none;
}

.finance-operation-order {
    color: #0f172a !important;
    font-weight: 900;
}

.finance-operation-payment {
    color: #16a34a !important;
    font-weight: 900;
}

.finance-operation-withdrawal {
    color: #dc2626 !important;
    font-weight: 900;
}

/* ===== Client view ===== */

body:not(.is-admin) .accounting-admin-panel {
    display: none;
}

/* ===== Responsive ===== */

@media (max-width: 1200px) {
    .finance-summary-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .accounting-admin-panel {
        grid-template-columns: 1fr;
    }

    .accounting-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {

    .accounting-header h1 {
        font-size: 30px;
    }

}

/* ===== Кнопка выхода в боковом меню ===== */

/* ===== Сайдбар ===== */

.sidebar {
    width: 310px;
    min-width: 310px;
    background: #f8fafc;
    border-right: 1px solid #d9e2ec;
    min-height: 100vh;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-nav a {
    text-decoration: none;
    color: #4b5563;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.35;
    padding: 6px 10px;
    border-radius: 12px;
    transition: 0.2s ease;
}

.sidebar-nav a:hover {
    background: #eef2f7;
    color: #111827;
}

.sidebar-nav a.active {
    color: #111827;
    font-weight: 600;
}

/* ===== Бухгалтерия: карты клиента ===== */

.payment-methods-list {
    gap: 12px;
}

.payment-method-item {
    gap: 16px;
}

/* ===== Финальная бухгалтерия: аккуратный адаптив ===== */

.accounting-page {
    background: #eef3f8;
}

/* Верх бухгалтерии */

.accounting-header {
    gap: 24px;
}

.accounting-header > div {
    min-width: 0;
}

.accounting-header h1 {
    font-size: clamp(32px, 3vw, 44px);
}

.accounting-dark-btn {
    min-width: 180px;
    max-width: 240px;
    flex-shrink: 0;
}

/* Админская панель */

.accounting-admin-panel {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) !important;
    gap: 18px;
    margin-bottom: 28px;
}

.accounting-client-select {
    min-width: 0;
}

.accounting-client-select label,
.accounting-form label {
    min-width: 0;
}

.accounting-admin-panel select,
.accounting-admin-panel input {
    width: 100%;
    min-width: 0;
    height: 54px;
    box-sizing: border-box;
}

/* 
   Главное исправление:
   форма админа больше не пытается уместить кнопку в одну строку.
*/

.accounting-form {
    width: 100%;
    min-width: 0;

    display: grid !important;
    grid-template-columns:
        minmax(145px, 0.8fr)
        minmax(180px, 1fr)
        minmax(145px, 0.8fr)
        minmax(220px, 1.4fr) !important;

    gap: 14px;
    align-items: end;
    margin-top: 0 !important;
}

.accounting-form .accounting-dark-btn {
    grid-column: 1 / -1;
    justify-self: end;

    width: 180px;
    min-width: 180px;
    max-width: 180px;
}

/* Блок способов оплаты */

.payment-methods-list {
    gap: 10px;
}

.payment-method-item {
    width: 100%;
    min-width: 0;
    gap: 16px;
}

.payment-method-item strong {
    min-width: 0;
}

/* Карточки финансов */

.finance-summary-grid {
    width: 100%;
    min-width: 0;
    gap: 16px;
}

.finance-summary-card span {
    font-size: 14px;
    line-height: 1.35;
}

.finance-summary-card strong {
    font-size: clamp(22px, 1.45vw, 28px);
}

/* Таблица ДДС */

/* Средние экраны */

@media (max-width: 1500px) {
    .accounting-admin-panel {
        grid-template-columns: 1fr !important;
    }

    .accounting-form {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .accounting-form .accounting-dark-btn {
        grid-column: 1 / -1;
        justify-self: end;
    }

}

/* Планшеты */

@media (max-width: 1100px) {
    .accounting-page {
        padding: 24px !important;
    }

    .accounting-card {
        padding: 26px;
    }

    .accounting-form {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .payment-method-form .accounting-dark-btn,
    .accounting-form .accounting-dark-btn {
        width: 100%;
        max-width: none;
        justify-self: stretch;
    }

    .finance-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Телефон */

@media (max-width: 760px) {
    .accounting-page {
        padding: 18px !important;
    }

    .accounting-card {
        padding: 22px;
        border-radius: 26px;
    }

    .accounting-header {
        flex-direction: column;
    }

    .accounting-header .accounting-dark-btn {
        width: 100%;
        max-width: none;
    }

    .accounting-form {
        grid-template-columns: 1fr !important;
    }

    .finance-summary-grid {
        grid-template-columns: 1fr !important;
    }

    .finance-summary-card strong {
        white-space: normal;
    }
}

/* ===== FIX бухгалтерии после добавления карт ===== */

/* Общая область бухгалтерии */

.accounting-card {
    margin: 0 auto !important;
    padding: 34px !important;
}

.accounting-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 24px !important;
    flex-wrap: wrap !important;
}

.accounting-header h1 {
    font-size: 46px !important;
    line-height: 1.05 !important;
}

.accounting-header .accounting-dark-btn {
    width: auto !important;
    min-width: 210px !important;
    max-width: 240px !important;
}

/* Админская панель операций */

.accounting-admin-panel {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 24px !important;
    margin: 28px 0 !important;
    border-radius: 26px !important;
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
    overflow: visible !important;
}

.accounting-admin-panel .accounting-client-select {
    width: 100% !important;
    max-width: 460px !important;
    margin-bottom: 18px !important;
}

.accounting-admin-panel label {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    min-width: 0 !important;
    color: #374151 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

.accounting-admin-panel input,
.accounting-admin-panel select {
    width: 100% !important;
    min-width: 0 !important;
    height: 54px !important;
    padding: 0 18px !important;
    border: 1px solid #dbe2ea !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 16px !important;
    outline: none !important;
    box-sizing: border-box !important;
}

/* Важно: исправляем только форму админской операции */

.accounting-admin-panel .accounting-form {
    width: 100% !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns:
        minmax(150px, 190px)
        minmax(190px, 230px)
        minmax(150px, 190px)
        minmax(240px, 1fr)
        minmax(150px, 170px) !important;
    gap: 14px !important;
    align-items: end !important;
    margin: 0 !important;
}

.accounting-admin-panel .accounting-form .accounting-dark-btn {
    grid-column: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 54px !important;
    padding: 0 18px !important;
    border-radius: 18px !important;
}

/* Блок карт — только для клиента */

.payment-methods-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.payment-method-item {
    gap: 14px !important;
}

/* Карточки сумм */

.finance-summary-grid {
    display: grid !important;
    gap: 16px !important;
    margin: 28px 0 34px !important;
}

.finance-summary-card {
    min-width: 0 !important;
}

.finance-summary-card strong {
    overflow-wrap: anywhere !important;
}

/* Таблица */

.accounting-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
}

/* Адаптив */

@media (max-width: 1500px) {
    .accounting-admin-panel .accounting-form {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .accounting-admin-panel .accounting-form .accounting-dark-btn {
        grid-column: 1 / -1 !important;
        justify-self: end !important;
        width: 180px !important;
        max-width: 180px !important;
    }

    .finance-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 1000px) {
    .accounting-admin-panel .accounting-form {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .accounting-admin-panel .accounting-form .accounting-dark-btn {
        width: 100% !important;
        max-width: none !important;
    }

    .finance-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 700px) {
    .accounting-page {
        padding: 20px !important;
    }

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

    .accounting-header h1 {
        font-size: 34px !important;
    }

    .accounting-header .accounting-dark-btn {
        width: 100% !important;
        max-width: none !important;
    }

    .accounting-admin-panel .accounting-form {
        grid-template-columns: 1fr !important;
    }

    .finance-summary-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===== Стрелки select в бухгалтерии чуть левее ===== */

.accounting-admin-panel select,
.accounting-client-select select,
#accountingClientSelect,
#transactionType,
#transactionMethod {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;

    padding-right: 54px !important;

    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23111827' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-size: 14px 14px !important;
    background-position: right 10px center !important;
}

.accounting-admin-panel select::-ms-expand,
.accounting-client-select select::-ms-expand {
    display: none;
}

/* ===== Выравнивание сумм в карточках бухгалтерии ===== */

/* ===== Компактные карточки бухгалтерии с выравниванием ===== */

.finance-summary-grid {
    align-items: stretch;
    gap: 14px !important;
}

.finance-summary-card {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;

    min-height: 125px !important;
    padding: 18px 20px !important;
}

.finance-summary-card span,
.finance-summary-card .card-label {
    display: block !important;
    min-height: 40px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}

.finance-summary-card strong {
    display: block !important;
    margin-top: 10px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    font-variant-numeric: tabular-nums;
    font-size: 22px !important;
}

/* ===== Редактирование операций ДДС ===== */

.accounting-row-actions {
    flex-direction: column;
    align-items: flex-start;
}

.accounting-row-actions .edit-btn,
.accounting-row-actions .delete-btn {
    width: 125px;
    text-align: center;
}

.accounting-edit-modal {
    max-width: 760px;
}

.accounting-edit-form {
    margin-top: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.accounting-edit-form .form-actions {
    grid-column: 1 / -1;
}

.accounting-edit-form .delete-btn {
    border: none;
}

@media (max-width: 800px) {
    .accounting-edit-form {
        grid-template-columns: 1fr;
    }

    .accounting-row-actions .edit-btn,
    .accounting-row-actions .delete-btn {
        width: 100%;
    }
}

/* ===== Отступ стрелки select в модальном окне редактирования ДДС ===== */

.accounting-edit-modal select,
#editTransactionType,
#editTransactionMethod {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;

    padding-right: 38px !important;

    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23111827' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-size: 14px 14px !important;
    background-position: right 10px center !important;
}

.accounting-edit-modal select::-ms-expand {
    display: none;
}

/* ===== Скрываем админский блок бухгалтерии от клиента ===== */

body:not(.is-admin) #adminAccountingPanel,
body:not(.is-admin) .accounting-admin-panel {
    display: none !important;
}

/* У админа показываем */
body.is-admin #adminAccountingPanel.accounting-admin-panel {
    display: block !important;
}

/* ===== Фикс кнопки "Добавить карту" в бухгалтерии ===== */

/* На маленьких экранах кнопка уходит под поле красиво */

/* ===== ДДС: сумма и ₽ не переносятся ===== */

.accounting-table {
    table-layout: fixed !important;
}

.accounting-table th:nth-child(4),
.accounting-table td:nth-child(4) {
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.accounting-table td.finance-operation-order,
.accounting-table td.finance-operation-payment,
.accounting-table td.finance-operation-withdrawal {
    white-space: nowrap !important;
    line-height: 1.2 !important;
}

/* ===== Карты клиента: ввод на странице, список в модальном окне ===== */

.payment-method-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;

    padding: 18px 20px !important;
    border-radius: 18px !important;
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
}

.payment-method-item strong {
    color: #111827;
    font-size: 17px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {

    .payment-method-item {
        flex-direction: column;
        align-items: stretch !important;
    }
}

/* ===== Select способа оплаты на странице оформления заказа ===== */

#orderPaymentMethod {
    background: #ffffff;
}

/* ===== Стрелка select "Способ оплаты" с отступом 10px ===== */

#orderPaymentMethod {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;

    width: 100%;
    padding: 15px 40px 15px 16px; /* справа запас под стрелку */
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    background-color: #ffffff;

    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23111827' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 14px 14px;

    /* вот здесь отступ стрелки от правого края */
    background-position: right 10px center;

    color: #111827;
    font-size: 15px;
    outline: none;
}

#orderPaymentMethod:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

/* ===== Способ оплаты в заявках ===== */

/* ===== Оплата картами при оформлении заказа ===== */

.card-payment-settings {
    margin-top: -4px;
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.card-payment-summary {
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
}

.card-payment-modal {
    max-width: 820px;
}

.card-payment-total-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.card-payment-total-box div {
    padding: 18px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.card-payment-total-box span {
    display: block;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.card-payment-total-box strong {
    color: #111827;
    font-size: 24px;
}

.card-payment-methods-list {
    display: flex;
    flex-direction: column;
    gap: 12px;

    max-height: 420px;
    overflow-y: auto;
    padding-right: 6px;
}

.card-payment-method-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 16px;
    align-items: center;

    padding: 18px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.card-payment-method-item strong {
    color: #111827;
    font-size: 18px;
}

.card-payment-method-item p {
    margin-top: 5px;
    color: #6b7280;
    font-size: 14px;
}

.card-payment-amount-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid #dbe2ea;
    border-radius: 15px;
    background: #ffffff;
    font-size: 16px;
    outline: none;
}

.card-payment-amount-input:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.card-payment-modal-actions {
    margin-top: 22px;
}

@media (max-width: 800px) {
    .card-payment-settings {
        flex-direction: column;
        align-items: stretch;
    }

    .card-payment-total-box {
        grid-template-columns: 1fr;
    }

    .card-payment-method-item {
        grid-template-columns: 1fr;
    }
}

/* ===== Кнопка выбора карт как "Отправить заказ" ===== */

#openCardPaymentModalBtn {
    min-width: 260px !important;
    height: 60px !important;
    border-radius: 18px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    text-align: center !important;
    justify-content: center !important;
}

.card-payment-settings {
    align-items: center !important;
}

/* ===== Детализация оплаты картами в заявке админа ===== */

.modal-payment-method-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;

    width: fit-content;
    max-width: 100%;

    padding: 0;
    border: none;
    background: transparent;

    color: #111827;
    font: inherit;
    font-weight: 800;
    text-align: left;

    cursor: default;
}

.modal-payment-method-btn.is-clickable {
    padding: 8px 12px;
    border-radius: 999px;

    background: rgba(0, 122, 255, 0.1);
    color: #007aff;

    cursor: pointer;
}

.modal-payment-method-btn.is-clickable:hover {
    background: rgba(0, 122, 255, 0.16);
}

.order-payment-details-modal {
    max-width: 720px;
}

.order-payment-details-summary {
    margin-bottom: 18px;
    padding: 18px 20px;

    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.order-payment-details-summary span {
    display: block;
    margin-bottom: 6px;

    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.order-payment-details-summary strong {
    color: #111827;
    font-size: 26px;
}

.order-payment-details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;

    max-height: 420px;
    overflow-y: auto;
    padding-right: 6px;
}

.order-payment-detail-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 16px;
    align-items: center;

    padding: 18px 20px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.order-payment-detail-item span {
    display: block;
    margin-bottom: 6px;

    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.order-payment-detail-item strong {
    color: #111827;
    font-size: 17px;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .order-payment-detail-item {
        grid-template-columns: 1fr;
    }
}

/* ===== Админ: карты клиента на странице пользователей ===== */

.admin-user-payment-methods {
    margin: 26px 0;
    padding: 24px;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.admin-user-payment-methods-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.admin-user-card-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;

    padding: 18px 20px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.admin-user-card-item span {
    display: block;
    margin-bottom: 5px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-user-card-item strong {
    color: #111827;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.admin-card-modal {
    max-width: 640px;
}

.admin-card-form {
    margin-top: 20px;
    grid-template-columns: 1fr;
}

.admin-card-form .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.admin-card-form input {
    width: 100%;
    height: 56px;
    padding: 0 18px;
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    font-size: 16px;
    box-sizing: border-box;
}

@media (max-width: 800px) {
    .admin-user-card-item {
        grid-template-columns: 1fr;
    }

    .admin-card-form .form-actions {
        flex-direction: column;
    }

    .admin-card-form .form-actions button {
        width: 100%;
    }
}

/* ===== Админ: карты клиента в модальном окне ===== */

.admin-payment-methods-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-payment-methods-short-info {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.admin-payment-methods-short-info span {
    color: #6b7280;
    font-size: 15px;
    font-weight: 800;
}

.admin-cards-list-modal {
    max-width: 820px;
}

.admin-cards-list-top-actions {
    justify-content: flex-end;
    margin-bottom: 18px;
}

.admin-cards-list-modal .admin-user-payment-methods-list {
    max-height: 460px;
    overflow-y: auto;
    padding-right: 6px;
}

.admin-cards-list-modal .admin-user-card-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;

    padding: 18px 20px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.admin-cards-list-modal .admin-user-card-item + .admin-user-card-item {
    margin-top: 12px;
}

.admin-cards-list-modal .admin-user-card-item span {
    display: block;
    margin-bottom: 5px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-cards-list-modal .admin-user-card-item strong {
    color: #111827;
    font-size: 18px;
    overflow-wrap: anywhere;
}

@media (max-width: 800px) {
    .admin-payment-methods-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-payment-methods-actions button {
        width: 100%;
    }

    .admin-cards-list-modal .admin-user-card-item {
        grid-template-columns: 1fr;
    }

    .admin-cards-list-modal .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-cards-list-modal .table-actions button {
        width: 100%;
    }
}

.admin-user-payment-methods > .admin-user-payment-methods-list {
    display: none !important;
}

.admin-cards-list-modal .admin-user-payment-methods-list {
    display: flex !important;
    flex-direction: column !important;
}

/* ===== Страница Имейки ===== */

.imei-orders-list {
    gap: 22px;
}

.imei-order-card {
    padding: 22px;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.imei-product-row {
    gap: 16px;
}

.imei-product-row span {
    display: block;
    margin-bottom: 4px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.imei-inputs-list {
    gap: 12px;
}

.imei-input-row {
    gap: 14px;
}

.imei-input-row input,
.imei-input-row select {
    width: 100%;
    height: 54px;
    padding: 0 18px;
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    background: #ffffff;
    color: #111827;
    font-size: 17px;
    box-sizing: border-box;
}

.imei-input-row input:focus,
.imei-input-row select:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

@media (max-width: 800px) {

    .imei-product-row {
        grid-template-columns: 1fr;
    }

    .imei-input-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Имейки: заявки без товаров на основной странице ===== */

.imei-orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.imei-order-card-button {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;

    padding: 22px 24px;
    border-radius: 22px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;

    text-align: left;
    cursor: pointer;
    transition: 0.18s ease;
}

.imei-order-card-button:hover {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.08);
    transform: translateY(-1px);
}

.imei-order-card-button.is-complete {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.imei-order-main h3 {
    margin: 8px 0 6px;
    color: #111827;
    font-size: 24px;
}

.imei-order-main p {
    color: #6b7280;
    font-size: 15px;
}

.imei-order-short-info {
    display: grid;
    grid-template-columns: repeat(3, 130px);
    gap: 12px;
}

.imei-order-short-info div {
    padding: 14px 16px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.imei-order-short-info span,
.order-products-modal-info span,
.imei-product-row span {
    display: block;
    margin-bottom: 6px;

    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.imei-order-short-info strong,
.order-products-modal-info strong {
    color: #111827;
    font-size: 17px;
}

/* ===== Модальное окно товаров заявки ===== */

.order-products-modal {
    max-width: 980px;
}

.order-products-modal-info {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.order-products-modal-info div {
    padding: 16px 18px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.order-products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;

    max-height: 460px;
    overflow-y: auto;
    padding-right: 6px;
}

/* ===== Строки товаров внутри модалки ===== */

.imei-product-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px 130px;
    gap: 16px;
    align-items: center;

    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;

    text-align: left;
    cursor: pointer;
    transition: 0.18s ease;
}

.imei-product-row:hover {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.08);
}

.imei-product-row.is-complete {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.imei-product-row strong {
    color: #111827;
    font-size: 16px;
}

/* ===== Модальное окно IMEI ===== */

#imeiModal {
    z-index: 10020;
}

#orderProductsModal {
    z-index: 10010;
}

.imei-modal {
    max-width: 760px;
}

.imei-help-box {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.imei-help-box strong {
    display: block;
    margin-bottom: 6px;
    color: #111827;
}

.imei-help-box span {
    color: #6b7280;
}

.imei-inputs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 430px;
    overflow-y: auto;
    padding-right: 6px;
}

.imei-input-row {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.imei-input-row span {
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.imei-input-row input {
    width: 100%;
    height: 54px;
    padding: 0 18px;
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    background: #ffffff;
    color: #111827;
    font-size: 17px;
    box-sizing: border-box;
}

.imei-input-row input:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.imei-modal-actions {
    margin-top: 22px;
}

@media (max-width: 1050px) {
    .imei-order-card-button {
        grid-template-columns: 1fr;
    }

    .imei-order-short-info {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .order-products-modal-info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .imei-order-short-info,
    .order-products-modal-info,
    .imei-product-row,
    .imei-input-row {
        grid-template-columns: 1fr;
    }
}

#shippingOrdersList {
    flex-wrap: wrap;
    gap: 15px;
}

.shipping-order-card {
    flex: 1 1 calc(50% - 15px);
}

/* Карточки заявок на отправку */
.shipping-order-card {
    margin-bottom: 15px;
}

.shipping-order-card h3 {
    margin: 0 0 5px;
    font-size: 18px;
}
.shipping-order-card p {
    margin: 0 0 10px;
    color: #555;
    font-size: 14px;
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.modal h3 {
    margin-top: 0;
}
.modal-product-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
}
.modal-close-btn {
    background: #f2f2f2;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    float: right;
    border-radius: 6px;
}
.modal-close-btn:hover {
    background: #e0e0e0;
}

/* ===== Компактная кнопка "Закрыть" в стиле основной кнопки ===== */

.modal-close-btn,
.order-modal-header .modal-close-btn {
    min-width: 96px !important;
    height: 42px !important;

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

    padding: 11px 18px !important;
    border: none !important;
    border-radius: 14px !important;

    background: #111827 !important;
    color: #ffffff !important;

    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-decoration: none !important;

    cursor: pointer !important;
    opacity: 1 !important;

    box-shadow: none !important;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease !important;
}

.modal-close-btn::before,
.order-modal-header .modal-close-btn::before {
    content: none !important;
    display: none !important;
}

.modal-close-btn:hover,
.order-modal-header .modal-close-btn:hover {
    background: #000000 !important;
    color: #ffffff !important;

    transform: translateY(-2px) !important;
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.22) !important;
}

.modal-close-btn:active,
.order-modal-header .modal-close-btn:active {
    transform: translateY(0) !important;
    box-shadow: none !important;
}

.order-modal-header .modal-close-btn {
    margin-left: auto !important;
    flex-shrink: 0 !important;
}

/* ===== Ожидают отправки: аккуратные карточки в 2 колонки ===== */

#shippingOrdersList {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;

    padding: 24px !important;
    border-radius: 28px !important;
}

/* Карточка */
.shipping-order-card {
    min-height: 112px !important;

    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 140px !important;
    align-items: center !important;
    gap: 18px !important;

    padding: 18px 22px !important;

    border: 1px solid #e5e7eb !important;
    border-radius: 20px !important;

    background: #ffffff !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05) !important;

    cursor: pointer !important;
    text-align: left !important;

    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease,
        background 0.22s ease !important;
}

.shipping-order-card:hover {
    background: #f8fafc !important;
    border-color: #d1d5db !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08) !important;
}

/* Левая часть */
.shipping-card-left {
    min-width: 0 !important;
}

.shipping-card-number {
    display: block !important;
    margin-bottom: 8px !important;

    color: #007aff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

.shipping-card-left h3 {
    margin: 0 0 8px 0 !important;

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

    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.shipping-card-meta {
    margin: 0 !important;

    color: #6b7280 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;

    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Правая часть */
.shipping-card-right {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 12px !important;

    min-width: 120px !important;
    text-align: right !important;
}

.shipping-card-metric {
    width: 100% !important;
}

.shipping-card-metric span {
    display: block !important;
    margin-bottom: 3px !important;

    color: #6b7280 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.shipping-card-metric strong {
    display: block !important;

    color: #111827 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

/* Мобильная версия */
@media (max-width: 1000px) {
    #shippingOrdersList {
        grid-template-columns: 1fr !important;
        padding: 20px !important;
    }
}

@media (max-width: 640px) {
    .shipping-order-card {
        grid-template-columns: 1fr !important;
        align-items: flex-start !important;
    }

    .shipping-card-right {
        width: 100% !important;
        align-items: flex-start !important;
        text-align: left !important;
        gap: 10px !important;
    }
}

/* ===== Способ оплаты в автокорзине ===== */

.auto-card-payment-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 14px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.auto-card-payment-settings.is-hidden {
    display: none !important;
}

.auto-card-payment-settings .secondary-btn {
    width: 100%;
    text-align: center;
    border: none;
    cursor: pointer;
}

.auto-card-payment-settings .card-payment-summary {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
}

/* ===== Красивый select способа оплаты в автокорзине ===== */

.auto-restock-profile-panel .auto-order-profile select,
#autoOrderPaymentMethod {
    width: 100% !important;
    height: 50px !important;

    padding: 0 44px 0 16px !important;

    border: 1px solid #dce3ea !important;
    border-radius: 15px !important;

    background-color: #ffffff !important;
    color: #111827 !important;

    font-size: 15px !important;
    font-weight: 500 !important;

    outline: none !important;
    cursor: pointer !important;

    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;

    background-image:
        linear-gradient(45deg, transparent 50%, #6b7280 50%),
        linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position:
        calc(100% - 22px) 21px,
        calc(100% - 15px) 21px;
    background-size:
        7px 7px,
        7px 7px;
    background-repeat: no-repeat;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease !important;
}

.auto-restock-profile-panel .auto-order-profile select:hover,
#autoOrderPaymentMethod:hover {
    border-color: #cbd5e1 !important;
}

.auto-restock-profile-panel .auto-order-profile select:focus,
#autoOrderPaymentMethod:focus {
    border-color: #007aff !important;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12) !important;
    transform: translateY(-1px) !important;
}

.auto-restock-profile-panel .auto-order-profile select option,
#autoOrderPaymentMethod option {
    color: #111827;
    background: #ffffff;
}

/* ===== Автокорзина: поле суммы как в оформлении заказа ===== */

#autoCardPaymentMethodsList .card-payment-method-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 180px !important;
    gap: 16px !important;
    align-items: center !important;

    padding: 18px !important;
    border-radius: 20px !important;
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
}

#autoCardPaymentMethodsList .card-payment-method-item strong {
    color: #111827 !important;
    font-size: 18px !important;
    font-weight: 800 !important;
}

#autoCardPaymentMethodsList .card-payment-method-item p {
    margin-top: 5px !important;
    color: #6b7280 !important;
    font-size: 14px !important;
}

/* Контейнер суммы справа */
.auto-card-payment-amount-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 7px !important;
}

.auto-card-payment-amount-wrap span {
    color: #6b7280 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
}

/* Сам инпут — как в оформлении заказа */
.auto-card-payment-amount-input,
#autoCardPaymentMethodsList .auto-card-payment-amount-input {
    width: 100% !important;
    height: 52px !important;

    padding: 0 16px !important;

    border: 1px solid #dbe2ea !important;
    border-radius: 15px !important;

    background: #ffffff !important;
    color: #111827 !important;

    font-size: 16px !important;
    font-weight: 500 !important;
    text-align: left !important;

    outline: none !important;

    appearance: auto !important;
    -webkit-appearance: auto !important;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease !important;
}

.auto-card-payment-amount-input:focus,
#autoCardPaymentMethodsList .auto-card-payment-amount-input:focus {
    border-color: #007aff !important;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12) !important;
}

.auto-card-payment-amount-input::placeholder {
    color: #9ca3af !important;
    font-weight: 500 !important;
}

/* Стрелочки number input для Chrome / Edge */
.auto-card-payment-amount-input::-webkit-outer-spin-button,
.auto-card-payment-amount-input::-webkit-inner-spin-button {
    -webkit-appearance: inner-spin-button !important;
    opacity: 1 !important;
    margin: 0 !important;
}

/* Мобильная версия */
@media (max-width: 800px) {
    #autoCardPaymentMethodsList .card-payment-method-item {
        grid-template-columns: 1fr !important;
    }

    .auto-card-payment-amount-wrap {
        width: 100% !important;
    }
}

/* ===== Автокорзина: высокая прокрутка товаров без растягивания страницы ===== */

/* Сам блок автокорзины не обрезает левую форму */
.auto-restock-card {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Левая и правая части стоят рядом и тянутся по высоте */
.auto-restock-layout {
    display: grid !important;
    grid-template-columns: 360px minmax(0, 1fr) !important;
    gap: 24px !important;
    align-items: stretch !important;
}

/* Левая форма с данными клиента всегда видимая */
.auto-restock-profile-panel {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Правая панель корзины фиксируется по высоте */
.auto-restock-cart-panel {
    height: 640px !important;
    max-height: 640px !important;
    min-height: 640px !important;

    display: flex !important;
    flex-direction: column !important;

    overflow: hidden !important;
}

/* Шапка правой панели не прокручивается */
.auto-restock-cart-header {
    flex: 0 0 auto !important;
    margin-bottom: 16px !important;
}

/* Список товаров занимает всё оставшееся место и прокручивается */
#autoRestockCartItems,
#autoRestockCartItems.auto-restock-scroll-list {
    flex: 1 1 auto !important;

    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    padding-right: 8px !important;
}

/* Карточки товаров внутри списка не растягивают страницу */
#autoRestockCartItems .auto-restock-item {
    flex-shrink: 0 !important;
}

/* Мобильная версия */
@media (max-width: 1100px) {
    .auto-restock-layout {
        grid-template-columns: 1fr !important;
    }

    .auto-restock-cart-panel {
        height: 460px !important;
        max-height: 460px !important;
        min-height: 460px !important;
    }
}

/* ===== Компактные товары в корзине дозакупки ===== */

/* Сама строка товара */
#autoRestockCartItems .auto-restock-item,
#autoRestockCartItems.auto-restock-scroll-list .auto-restock-item {
    min-height: 0 !important;

    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 320px !important;
    align-items: center !important;
    gap: 16px !important;

    padding: 12px 14px !important;
    margin-bottom: 10px !important;

    border-radius: 16px !important;
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;

    box-shadow: none !important;
}

/* Левая часть */
#autoRestockCartItems .auto-restock-item .selected-product-info {
    min-width: 0 !important;
}

/* Категория / позиция */
#autoRestockCartItems .auto-restock-item .card-label {
    margin-bottom: 5px !important;

    color: #007aff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    letter-spacing: 0.04em !important;
}

/* Название товара */
#autoRestockCartItems .auto-restock-item h3 {
    margin: 0 0 5px 0 !important;

    color: #111827 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Мелкая информация под названием */
#autoRestockCartItems .auto-restock-item p {
    margin: 2px 0 0 0 !important;

    color: #6b7280 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
}

/* Выделение "Нужно докупить" */
#autoRestockCartItems .auto-restock-item p strong {
    color: #111827 !important;
    font-weight: 800 !important;
}

/* Правая часть */
#autoRestockCartItems .auto-restock-controls,
#autoRestockCartItems.auto-restock-scroll-list .auto-restock-controls {
    min-width: 0 !important;
    width: 100% !important;

    display: grid !important;
    grid-template-columns: 105px 90px 92px !important;
    align-items: center !important;
    justify-content: end !important;
    gap: 10px !important;
}

/* Бейдж "К отправке" */
#autoRestockCartItems .auto-restock-quantity-badge {
    min-height: 34px !important;

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

    padding: 7px 9px !important;
    border-radius: 999px !important;

    background: rgba(0, 122, 255, 0.1) !important;
    color: #007aff !important;

    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
}

/* Сумма */
#autoRestockCartItems .auto-restock-controls strong {
    color: #111827 !important;

    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;

    text-align: right !important;
    white-space: nowrap !important;
}

/* Цена за штуку */
#autoRestockCartItems .auto-restock-price {
    color: #6b7280 !important;

    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;

    text-align: right !important;
    white-space: nowrap !important;
}

/* Кнопка "Сделать активной", если появляется */
#autoRestockCartItems .auto-restock-reset-btn {
    grid-column: 1 / -1 !important;

    min-height: 34px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;

    font-size: 12px !important;
    font-weight: 800 !important;
}

/* Мобильная версия */
@media (max-width: 900px) {
    #autoRestockCartItems .auto-restock-item,
    #autoRestockCartItems.auto-restock-scroll-list .auto-restock-item {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    #autoRestockCartItems .auto-restock-controls,
    #autoRestockCartItems.auto-restock-scroll-list .auto-restock-controls {
        grid-template-columns: 1fr !important;
        justify-content: stretch !important;
    }

    #autoRestockCartItems .auto-restock-controls strong,
    #autoRestockCartItems .auto-restock-price {
        text-align: left !important;
    }
}

/* ===== Фикс бейджа "К отправке" в автокорзине ===== */

#autoRestockCartItems .auto-restock-quantity-badge,
#autoRestockCartItems.auto-restock-scroll-list .auto-restock-quantity-badge {
    min-width: 128px !important;
    width: auto !important;
    max-width: none !important;

    padding: 8px 12px !important;

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

    white-space: nowrap !important;
    overflow: visible !important;

    box-sizing: border-box !important;
    line-height: 1.1 !important;
}

/* ===== IMEI в заказах клиента ===== */

.order-imeis-list {
    gap: 12px;
}

.order-imei-item {
    justify-content: space-between;
    gap: 16px;
}

@media (max-width: 700px) {
    .order-imei-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== IMEI в верхнем блоке модального окна заказа ===== */

.order-modal-imeis-info {
    position: relative;
}

.order-info-imei-btn {
    width: 100%;

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

    min-height: 34px;
    padding: 7px 12px;

    border: none;
    border-radius: 12px;

    background: rgba(0, 122, 255, 0.1);
    color: #007aff;

    font-size: 14px;
    font-weight: 800;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.22s ease,
        transform 0.22s ease;
}

.order-info-imei-btn:hover:not(:disabled) {
    background: rgba(0, 122, 255, 0.16);
    transform: translateY(-1px);
}

.order-info-imei-btn:disabled,
.order-info-imei-btn.is-disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: default;
    transform: none;
}

/* Если раньше добавлял кнопку IMEI в таблицу — можно оставить, но она больше не нужна */

/* Модальное окно IMEI */
.order-imeis-modal {
    max-width: 680px;
}

.order-imeis-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-imei-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;

    padding: 16px 18px;
    border-radius: 18px;

    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.order-imei-item span {
    display: block;
    margin-bottom: 4px;

    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.order-imei-item p {
    margin: 0;

    color: #111827;
    font-size: 14px;
    font-weight: 700;
}

.order-imei-item strong {
    color: #111827;
    font-size: 17px;
    font-weight: 800;
    word-break: break-word;
}

@media (max-width: 700px) {
    .order-imei-item {
        grid-template-columns: 1fr;
    }
}

/* ===== Модальное окно товара склада и IMEI ===== */

.inventory-clickable-row {
    cursor: pointer;
}

.inventory-clickable-row:hover {
    background: #f8fafc;
}

.inventory-product-modal {
    max-width: 1040px;
}

.inventory-product-info-grid {
    margin-bottom: 28px;
}

.inventory-imeis-list {
    gap: 12px;
}

.inventory-imei-item {
    gap: 18px;
}

#inventoryModalActualPrice.price-compare-good {
    color: #16a34a;
}

#inventoryModalActualPrice.price-compare-danger {
    color: #dc2626;
}

#inventoryModalActualPrice.price-compare-neutral {
    color: #6b7280;
}

/* ===== Кликабельный блок IMEI в модальном окне склада ===== */

.inventory-imeis-click-card {
    cursor: pointer;
    transition:
        background 0.22s ease,
        border-color 0.22s ease,
        transform 0.22s ease;
}

.inventory-imeis-click-card:hover:not(.is-disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.inventory-imeis-click-card.is-disabled {
    cursor: default;
}

.inventory-imeis-open-btn {
    width: 100%;

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

    min-height: 36px;
    padding: 8px 12px;

    border: none;
    border-radius: 12px;

    background: rgba(0, 122, 255, 0.1);
    color: #007aff;

    font-size: 13px;
    font-weight: 800;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.22s ease,
        transform 0.22s ease;
}

.inventory-imeis-open-btn:hover:not(:disabled) {
    background: rgba(0, 122, 255, 0.16);
    transform: translateY(-1px);
}

.inventory-imeis-open-btn:disabled,
.inventory-imeis-open-btn.is-disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: default;
    transform: none;
}

.inventory-imeis-modal {
    max-width: 760px;
}

.inventory-imeis-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.inventory-imei-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 16px 18px;
    border-radius: 18px;

    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.inventory-imei-item span {
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.inventory-imei-item strong {
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    word-break: break-word;
    text-align: right;
}

@media (max-width: 800px) {
    .inventory-imeis-list {
        grid-template-columns: 1fr;
    }

    .inventory-imei-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .inventory-imei-item strong {
        text-align: left;
    }
}

/* ===== IMEI при добавлении продажи ===== */

.sale-imeis-block {
    position: relative;
    gap: 12px;
}

.sale-imeis-block h3 {
    margin: 0;

    color: #111827;
    font-size: 20px;
    font-weight: 800;
}

.sale-imeis-hint {
    margin: 0;

    color: #6b7280;
    font-size: 14px;
    line-height: 1.4;
}

.sale-imeis-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.sale-imei-field {
    gap: 7px;
}

@media (max-width: 800px) {
    .sale-imeis-fields {
        grid-template-columns: 1fr;
    }
}

/* ===== Компактный ввод IMEI при добавлении продажи ===== */

.sale-imeis-block {
    padding: 0 !important;
    margin: 0 !important;

    border: none !important;
    border-radius: 0 !important;

    background: transparent !important;
    box-shadow: none !important;

    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.sale-imeis-block.is-hidden {
    display: none !important;
}

/* Убираем большую шапку внутри блока IMEI */
.sale-imeis-block > .card-label,
.sale-imeis-block h3,
.sale-imeis-hint {
    display: none !important;
}

/* Поля IMEI в один столбец, как обычный input формы */
.sale-imeis-fields {
    display: block !important;
}

.sale-imei-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;

    margin: 0 !important;
}

.sale-imei-field span {
    color: #111827 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}

/* Сам input IMEI — как поле количества */
.sale-imei-input {
    width: 100% !important;
    outline: none !important;
    box-shadow: none !important;
    transition:
        border-color 0.22s ease,
        box-shadow 0.22s ease !important;
}

.sale-imei-input:focus {
    border-color: #007aff !important;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12) !important;
}

.sale-imei-input::placeholder {
    color: #6b7280 !important;
    font-weight: 500 !important;
}

/* ===== Выпадающие подсказки IMEI при продаже ===== */

.sale-imei-suggestions {
    position: fixed !important;
    z-index: 999999 !important;

    max-height: 240px !important;
    overflow-y: auto !important;

    padding: 8px !important;

    border: 1px solid #dbe2ea !important;
    border-radius: 16px !important;

    background: #ffffff !important;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18) !important;
}

.sale-imei-suggestion-item {
    width: 100% !important;

    display: flex !important;
    align-items: center !important;

    padding: 11px 12px !important;

    border: none !important;
    border-radius: 12px !important;

    background: transparent !important;
    color: #111827 !important;

    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: left !important;

    cursor: pointer !important;
}

.sale-imei-suggestion-item:hover {
    background: #f3f6fa !important;
}

.sale-imei-suggestion-empty {
    padding: 12px !important;

    color: #6b7280 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

/* ===== Кликабельная строка продажи ===== */

/* ===== Модальное окно продажи ===== */

/* ===== Кликабельный IMEI в модальном окне продажи ===== */

.sale-imeis-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition:
        background 0.22s ease,
        transform 0.22s ease;
}

.sale-imeis-open-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.sale-imeis-open-btn:disabled,
.sale-imeis-open-btn.is-disabled {
    transform: none;
}

.sale-imeis-modal-list {
    gap: 12px;
}

.sale-imei-modal-item {
    gap: 18px;
}

@media (max-width: 800px) {
    .sale-imeis-modal-list {
        grid-template-columns: 1fr;
    }

    .sale-imei-modal-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .sale-imei-modal-item strong {
        text-align: left;
    }
}

/* ===== Мульти-продажа ===== */

.multi-sale-card {
    max-width: 1120px;
}

.multi-sale-main-grid {
    gap: 20px;
}

.sale-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 26px 0 18px;
}

.sale-items-header h3 {
    margin: 6px 0 0;
    color: #111827;
    font-size: 28px;
    font-weight: 900;
}

.sale-items-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sale-item-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.sale-item-card-header h4 {
    margin: 4px 0 0;
    color: #111827;
    font-size: 22px;
    font-weight: 900;
}

.sale-item-remove-btn {
    min-height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 14px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.sale-item-grid {
    gap: 18px;
}

.sale-item-imeis-block {
    margin-top: 20px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.sale-item-imeis-block.is-hidden {
    display: none !important;
}

.sale-item-imeis-top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.sale-item-imeis-top h4 {
    margin: 4px 0 0;
    color: #111827;
    font-size: 20px;
    font-weight: 900;
}

.sale-item-imeis-hint {
    max-width: 360px;
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.4;
}

.sale-item-imeis-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.sale-imei-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sale-imei-field span {
    color: #111827;
    font-size: 14px;
    font-weight: 800;
}

.sale-imei-input {
    width: 100%;
    outline: none;
}

.sale-imei-input:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.sale-imei-input.imei-input-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.sale-imei-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 50;
    max-height: 220px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
}

.sale-imei-suggestions.is-hidden {
    display: none !important;
}

.sale-imei-suggestion-item {
    width: 100%;
    display: block;
    padding: 11px 12px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.sale-imei-suggestion-item:hover {
    background: #f3f6fa;
}

.sale-imei-suggestion-empty {
    padding: 12px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
}

.sale-total-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.sale-total-panel div {
    padding: 18px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.sale-total-panel span {
    display: block;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.sale-total-panel strong {
    color: #111827;
    font-size: 22px;
    font-weight: 900;
}

.form-actions {
    display: flex;
    gap: 14px;
    margin-top: 28px;
}

/* ===== Продажи: таблица и модалки ===== */

.sale-clickable-row {
    cursor: pointer;
    transition: background 0.2s ease;
}

.sale-clickable-row:hover {
    background: #f8fafc;
}

.sale-details-modal {
    max-width: 1120px;
}

.sale-imeis-click-card {
    cursor: pointer;
    transition:
        background 0.22s ease,
        border-color 0.22s ease,
        transform 0.22s ease;
}

.sale-imeis-click-card:hover:not(.is-disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.sale-imeis-click-card.is-disabled {
    cursor: default;
}

.sale-imeis-open-btn {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: none;
    border-radius: 14px;
    background: rgba(0, 122, 255, 0.11);
    color: #007aff;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

.sale-imeis-open-btn:hover:not(:disabled) {
    background: rgba(0, 122, 255, 0.18);
}

.sale-imeis-open-btn:disabled,
.sale-imeis-open-btn.is-disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: default;
}

.sale-imeis-details-modal {
    max-width: 760px;
}

.sale-imeis-modal-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.sale-imei-modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.sale-imei-modal-item span {
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.sale-imei-modal-item strong {
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    word-break: break-word;
    text-align: right;
}

@media (max-width: 900px) {
    .multi-sale-main-grid,
    .sale-item-grid,
    .sale-item-imeis-fields,
    .sale-total-panel,
    .sale-imeis-modal-list {
        grid-template-columns: 1fr;
    }

    .sale-items-header,
    .sale-item-imeis-top {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Возвращаем красивый вид инпутов в новой продаже ===== */

.multi-sale-card label,
.sale-item-card label {
    display: flex !important;
    flex-direction: column !important;
    gap: 9px !important;

    color: #1f2937 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
}

.multi-sale-card input,
.multi-sale-card select,
.sale-item-card input,
.sale-item-card select {
    width: 100% !important;
    height: 56px !important;

    padding: 0 18px !important;

    border: 1px solid #dbe2ea !important;
    border-radius: 16px !important;

    background: #ffffff !important;
    color: #111827 !important;

    font-size: 16px !important;
    font-weight: 500 !important;

    outline: none !important;
    box-shadow: none !important;

    transition:
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        background 0.22s ease !important;
}

.multi-sale-card input:focus,
.multi-sale-card select:focus,
.sale-item-card input:focus,
.sale-item-card select:focus {
    border-color: #007aff !important;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12) !important;
}

.multi-sale-card input::placeholder,
.sale-item-card input::placeholder {
    color: #6b7280 !important;
    font-weight: 500 !important;
}

/* Дата и клиент сверху */
.multi-sale-main-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px !important;
    margin-bottom: 32px !important;
}

/* Карточка товара */
.sale-item-card {
    padding: 26px 28px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 24px !important;
    background: #f8fafc !important;
}

/* Сетка внутри карточки товара */
.sale-item-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px !important;
    align-items: end !important;
}

/* Блок актуальной цены / сравнения */
.sale-item-price-diff {
    min-height: 56px !important;

    display: flex !important;
    align-items: center !important;

    color: #16a34a !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
}

/* Поля IMEI тоже в старом стиле */
.sale-imei-input {
    height: 56px !important;
    padding: 0 18px !important;

    border: 1px solid #dbe2ea !important;
    border-radius: 16px !important;

    background: #ffffff !important;
    color: #111827 !important;

    font-size: 16px !important;
    font-weight: 500 !important;
}

/* Убираем браузерный серый вид у select */
.sale-item-model,
.multi-sale-card select,
.sale-item-card select {
    appearance: none !important;
    -webkit-appearance: none !important;

    background-image:
        linear-gradient(45deg, transparent 50%, #111827 50%),
        linear-gradient(135deg, #111827 50%, transparent 50%) !important;
    background-position:
        calc(100% - 22px) 50%,
        calc(100% - 16px) 50% !important;
    background-size:
        6px 6px,
        6px 6px !important;
    background-repeat: no-repeat !important;

    padding-right: 46px !important;
}

/* Мобильная версия */
@media (max-width: 900px) {
    .multi-sale-main-grid,
    .sale-item-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===== Исправление подсказок IMEI в мульти-продаже ===== */

.sale-item-card .sale-imei-field {
    position: relative !important;
    overflow: visible !important;
}

.sale-item-card .sale-imei-suggestions {
    position: absolute !important;

    left: 0 !important;
    right: 0 !important;
    top: calc(100% + 8px) !important;

    z-index: 999999 !important;

    display: block;

    max-height: 240px !important;
    overflow-y: auto !important;

    padding: 8px !important;

    border: 1px solid #dbe2ea !important;
    border-radius: 16px !important;

    background: #ffffff !important;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18) !important;
}

.sale-item-card .sale-imei-suggestions.is-hidden {
    display: none !important;
}

.sale-item-card .sale-imei-suggestion-item {
    width: 100% !important;

    display: block !important;

    padding: 12px 14px !important;

    border: none !important;
    border-radius: 12px !important;

    background: transparent !important;
    color: #111827 !important;

    font-size: 15px !important;
    font-weight: 800 !important;
    text-align: left !important;

    cursor: pointer !important;
}

.sale-item-card .sale-imei-suggestion-item:hover {
    background: #f3f6fa !important;
}

.sale-item-card .sale-imei-suggestion-empty {
    padding: 12px !important;

    color: #6b7280 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

/* Чтобы подсказку не обрезали родительские блоки */
.sale-item-card,
.sale-item-imeis-block,
.sale-item-imeis-fields,
.sale-items-container,
.multi-sale-card {
    overflow: visible !important;
}

/* ===== Добавление заказа с IMEI ===== */

.add-order-card {
    max-width: 1220px;
}

.add-order-main-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px !important;
    margin-bottom: 32px !important;
}

.add-order-card label,
.order-item-card label {
    display: flex !important;
    flex-direction: column !important;
    gap: 9px !important;

    color: #1f2937 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
}

.add-order-card input,
.order-item-card input {
    width: 100% !important;
    height: 56px !important;

    padding: 0 18px !important;

    border: 1px solid #dbe2ea !important;
    border-radius: 16px !important;

    background: #ffffff !important;
    color: #111827 !important;

    font-size: 16px !important;
    font-weight: 500 !important;

    outline: none !important;

    transition:
        border-color 0.22s ease,
        box-shadow 0.22s ease !important;
}

.add-order-card input:focus,
.order-item-card input:focus {
    border-color: #007aff !important;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12) !important;
}

.order-items-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
    margin: 26px 0 18px !important;
}

.order-items-header h3 {
    margin: 6px 0 0 !important;
    color: #111827 !important;
    font-size: 28px !important;
    font-weight: 900 !important;
}

.order-items-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
}

.order-item-card {
    border: 1px solid #e5e7eb !important;
    background: #f8fafc !important;
}

.order-item-card-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
}

.order-item-card-header h4 {
    margin: 4px 0 0 !important;
    color: #111827 !important;
    font-weight: 900 !important;
}

.order-item-remove-btn {
    border: none !important;
    background: #fee2e2 !important;
    color: #dc2626 !important;
    font-weight: 900 !important;
    cursor: pointer !important;
}

.order-item-grid {
    display: grid !important;
    gap: 16px !important;
    align-items: end !important;
}

.order-imei-checkbox-label {
    gap: 10px !important;
    border-radius: 16px !important;
}

.order-item-imeis-block {
    margin-top: 20px !important;
    padding: 20px !important;

    border-radius: 20px !important;
    border: 1px solid #e5e7eb !important;

    background: #ffffff !important;
}

.order-item-imeis-block.is-hidden {
    display: none !important;
}

.order-item-imeis-block h4 {
    margin: 6px 0 8px !important;
    color: #111827 !important;
    font-size: 22px !important;
    font-weight: 900 !important;
}

.order-item-imeis-hint {
    margin: 0 0 16px !important;
    color: #6b7280 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
}

.order-item-imeis-fields {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

.order-item-imei-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.order-item-imei-field span {
    color: #111827 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

.order-item-imei-input {
    width: 100% !important;
    height: 54px !important;

    padding: 0 18px !important;

    border: 1px solid #dbe2ea !important;
    border-radius: 16px !important;

    background: #ffffff !important;
    color: #111827 !important;

    font-size: 16px !important;
    font-weight: 600 !important;

    outline: none !important;
}

.order-item-imei-input:focus {
    border-color: #007aff !important;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12) !important;
}

.order-total-panel {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
    margin-top: 26px !important;
}

.order-total-panel div {
    padding: 18px !important;
    border-radius: 18px !important;
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
}

.order-total-panel span {
    display: block !important;
    margin-bottom: 8px !important;
    color: #6b7280 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
}

.order-total-panel strong {
    color: #111827 !important;
    font-size: 22px !important;
    font-weight: 900 !important;
}

@media (max-width: 800px) {
    .add-order-main-grid,
    .order-item-grid,
    .order-item-imeis-fields,
    .order-total-panel {
        grid-template-columns: 1fr !important;
    }

    .order-items-header,
    .order-item-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

/* ===== IMEI заказа через модальное окно ===== */

.order-imei-toggle-row {
    gap: 14px !important;
    flex-wrap: wrap !important;
}

.order-imei-checkbox-label {
    gap: 10px !important;
    cursor: pointer !important;
}

.order-imei-edit-btn {
    border: none !important;
    background: rgba(0, 122, 255, 0.11) !important;
    color: #007aff !important;
    cursor: pointer !important;
}

.order-imei-edit-btn:hover {
    background: rgba(0, 122, 255, 0.18) !important;
}

.order-imei-edit-btn.is-hidden {
    display: none !important;
}

.order-imeis-entry-modal {
    max-width: 860px !important;
}

.order-imeis-entry-fields {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

.order-imei-modal-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.order-imei-modal-field span {
    color: #111827 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
}

.order-imei-modal-input {
    width: 100% !important;
    height: 56px !important;

    padding: 0 18px !important;

    border: 1px solid #dbe2ea !important;
    border-radius: 16px !important;

    background: #ffffff !important;
    color: #111827 !important;

    font-size: 16px !important;
    font-weight: 600 !important;

    outline: none !important;
}

.order-imei-modal-input:focus {
    border-color: #007aff !important;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12) !important;
}

.order-imei-modal-input.imei-input-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12) !important;
}

.order-imeis-entry-actions {
    margin-top: 24px !important;
}

@media (max-width: 800px) {
    .order-imeis-entry-fields {
        grid-template-columns: 1fr !important;
    }

    .order-imei-toggle-row {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

/* ===== Компактная позиция заказа + красивая строка IMEI ===== */

/* Сама карточка позиции меньше */
.order-item-card {
    padding: 20px 22px !important;
    border-radius: 22px !important;
}

/* Шапка позиции компактнее */
.order-item-card-header {
    margin-bottom: 16px !important;
}

.order-item-card-header h4 {
    font-size: 22px !important;
}

/* Кнопка удаления меньше */
.order-item-remove-btn {
    min-height: 42px !important;
    padding: 0 18px !important;
    border-radius: 14px !important;

    font-size: 14px !important;
}

/* Сетка полей компактнее */
.order-item-grid {
    grid-template-columns: 1.25fr 0.85fr 0.9fr 1fr 1fr !important;
    gap: 14px !important;
}

/* Названия полей меньше */
.order-item-card label {
    gap: 7px !important;
    font-size: 15px !important;
}

/* Инпуты позиции меньше */
.order-item-card input {
    height: 50px !important;
    padding: 0 15px !important;

    border-radius: 15px !important;

    font-size: 15px !important;
}

/* Строка с IMEI меньше и красивее */
.order-imei-toggle-row {
    width: fit-content !important;

    margin-top: 16px !important;
    padding: 10px 14px !important;

    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;

    border-radius: 16px !important;
    border: 1px solid #dbe2ea !important;

    background: #ffffff !important;
}

/* Лейбл галочки компактный */
.order-imei-checkbox-label {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 9px !important;

    width: auto !important;

    padding: 0 !important;
    margin: 0 !important;

    border: none !important;
    background: transparent !important;
}

/* Сама галочка меньше */
.order-imei-checkbox-label input {
    width: 17px !important;
    height: 17px !important;
    min-width: 17px !important;

    padding: 0 !important;
    margin: 0 !important;

    accent-color: #007aff !important;
}

/* Текст рядом с галочкой */
.order-imei-checkbox-label span {
    color: #111827 !important;

    font-size: 14px !important;
    font-weight: 900 !important;

    white-space: nowrap !important;
}

/* Статус IMEI как маленькая плашка */
.order-imei-status {
    padding: 7px 11px !important;

    border-radius: 999px !important;

    background: #f3f6fa !important;
    color: #6b7280 !important;

    font-size: 13px !important;
    font-weight: 900 !important;

    white-space: nowrap !important;
}

/* Статус: заполнено */
.order-imei-status-good {
    background: #dcfce7 !important;
    color: #16a34a !important;
}

/* Статус: не заполнено */
.order-imei-status-warning {
    background: #fef3c7 !important;
    color: #d97706 !important;
}

/* Кнопка "Ввести IMEI" компактнее */
.order-imei-edit-btn {
    min-height: 36px !important;

    padding: 0 14px !important;

    border-radius: 12px !important;

    font-size: 13px !important;
    font-weight: 900 !important;
}

/* Чтобы карточка не была слишком высокой */
.order-items-container {
    gap: 16px !important;
}

/* Адаптация */
@media (max-width: 1100px) {
    .order-item-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .order-imei-toggle-row {
        width: 100% !important;
    }
}

@media (max-width: 700px) {
    .order-item-grid {
        grid-template-columns: 1fr !important;
    }

    .order-imei-toggle-row {
        align-items: flex-start !important;
        flex-direction: column !important;
    }
}

/* ===== Скрыть надпись "IMEI не требуются" ===== */

.order-imei-status {
    display: none !important;
}

/* Показывать статус только когда IMEI включены */
.order-imei-status-good,
.order-imei-status-warning {
    display: inline-flex !important;
    align-items: center !important;
}

/* ===== Аккуратные кнопки на странице учётности ===== */

/* ===== Компактные кнопки разделов на странице учётности ===== */

.inventory-page-actions {
    width: auto !important;
    max-width: none !important;
    margin-left: auto !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
}

.inventory-page-actions-row {
    width: auto !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
}

.inventory-page-action-btn {
    width: auto !important;
    min-width: 112px !important;
    max-width: none !important;
    min-height: 44px !important;
    height: 44px !important;

    padding: 0 15px !important;

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

    border-radius: 14px !important;
    background: #111827 !important;
    color: #ffffff !important;

    text-decoration: none !important;
    text-align: center !important;
    white-space: nowrap !important;

    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    box-sizing: border-box !important;
    box-shadow: none !important;
}

.inventory-page-action-btn:hover {
    background: #000000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.18) !important;
}

.inventory-page-back-btn {
    width: auto !important;
    min-width: 150px !important;
    justify-self: auto !important;
}

@media (max-width: 1350px) {
    .stock-inventory-card > .inventory-top {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .inventory-page-actions {
        margin-left: 0 !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }

    .inventory-page-actions-row {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}

@media (max-width: 900px) {
    .inventory-page-actions,
    .inventory-page-actions-row {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .inventory-page-action-btn,
    .inventory-page-back-btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* ===== Прижимаем кнопки ближе к заголовку склада ===== */

.stock-inventory-card > .inventory-top {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    gap: 14px !important;
}

/* Убираем отталкивание кнопок вправо */
.stock-inventory-card .inventory-page-actions {
    margin-left: 0 !important;
    width: auto !important;
    max-width: none !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
}

/* Первый ряд кнопок */
.stock-inventory-card .inventory-page-actions-row {
    width: auto !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
}

/* Сами кнопки компактнее */
.stock-inventory-card .inventory-page-action-btn {
    width: auto !important;
    min-width: 105px !important;
    height: 42px !important;
    min-height: 42px !important;

    padding: 0 14px !important;
    border-radius: 14px !important;

    font-size: 14px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}

/* Назад в кабинет тоже в одну строку */
.stock-inventory-card .inventory-page-back-btn {
    min-width: 145px !important;
}

/* На средних экранах можно переносить */
@media (max-width: 1300px) {
    .stock-inventory-card > .inventory-top {
        flex-direction: column !important;
        gap: 18px !important;
    }

    .stock-inventory-card .inventory-page-actions,
    .stock-inventory-card .inventory-page-actions-row {
        flex-wrap: wrap !important;
    }
}

/* ===== Выравниваем кнопки напротив заголовка "Остатки техники на складе" ===== */

.stock-inventory-card .inventory-page-actions {
    margin-top: 29px !important;
}

/* ===== Страница поступлений: кнопка добавления + модальное окно ===== */

.receipts-page-actions {
    gap: 10px;
}

.receipts-page-actions .telegram-btn,
.receipts-page-actions .secondary-btn {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.receipt-modal {
    max-width: 820px;
}

.receipt-modal-form {
    margin-top: 0;
}

.receipt-modal-actions {
    margin-top: 12px;
}

@media (max-width: 1100px) {
    .receipts-history-top {
        flex-direction: column !important;
    }

    .receipts-page-actions {
        margin-left: 0;
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .receipts-page-actions,
    .receipts-page-actions .telegram-btn,
    .receipts-page-actions .secondary-btn {
        width: 100%;
    }
}

/* ===== Кнопки на странице поступлений ===== */

.receipts-page-actions {
    margin-left: auto !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
}

.receipt-action-btn {
    width: auto !important;
    min-width: 190px !important;
    height: 46px !important;
    min-height: 46px !important;

    padding: 0 18px !important;
    border: none !important;
    border-radius: 15px !important;

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

    background: #111827 !important;
    color: #ffffff !important;

    text-decoration: none !important;
    text-align: center !important;
    white-space: nowrap !important;

    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    cursor: pointer !important;
    box-sizing: border-box !important;
}

.receipt-action-btn:hover {
    background: #000000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.2) !important;
}

@media (max-width: 900px) {
    .receipts-page-actions {
        width: 100% !important;
        margin-left: 0 !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .receipt-action-btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* ===== Компактные кнопки на странице поступлений ===== */

.receipts-history-top {
    align-items: flex-start !important;
}

.receipts-history-top .receipts-page-actions {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
}

.receipts-history-top .receipt-action-btn {
    width: auto !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #111827 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    text-align: center !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

.receipts-history-top .receipt-action-btn:hover {
    background: #000000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.18) !important;
}

@media (max-width: 900px) {
    .receipts-history-top {
        flex-direction: column !important;
    }

    .receipts-history-top .receipts-page-actions {
        width: 100% !important;
        margin-top: 16px !important;
        margin-left: 0 !important;
        justify-content: flex-start !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .receipts-history-top .receipt-action-btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* ===== Возвращаем нормальный размер кнопок на странице поступлений ===== */

.receipts-history-top .receipts-page-actions {
    margin-top: 30px !important;
    gap: 12px !important;
}

.receipts-history-top .receipt-action-btn {
    min-width: 210px !important;
    height: 46px !important;
    min-height: 46px !important;

    padding: 0 20px !important;
    border-radius: 15px !important;

    font-size: 15px !important;
    font-weight: 800 !important;
}

/* ===== Одинаковые кнопки действий на странице поступлений ===== */

.receipts-table .table-actions,
#receiptsTableBody .table-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
}

.receipts-table .edit-btn,
.receipts-table .delete-btn,
#receiptsTableBody .edit-btn,
#receiptsTableBody .delete-btn {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;

    height: 40px !important;
    min-height: 40px !important;

    padding: 0 14px !important;
    border-radius: 14px !important;

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

    box-sizing: border-box !important;

    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    text-align: center !important;
    white-space: nowrap !important;
}

/* ===== Делаем строки поступлений компактнее ===== */

#receiptsTableBody td {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    vertical-align: middle !important;
}

#receiptsTableBody .table-actions {
    gap: 6px !important;
}

#receiptsTableBody .edit-btn,
#receiptsTableBody .delete-btn {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
}

/* ===== Кнопки на странице продаж напротив заголовка ===== */

.sales-history-top {
    align-items: flex-start !important;
}

.sales-history-top .sales-page-actions {
    margin-top: 30px !important;
    margin-left: auto !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
}

.sales-history-top .sales-action-btn {
    width: auto !important;
    min-width: 165px !important;
    height: 46px !important;
    min-height: 46px !important;

    padding: 0 18px !important;

    border: none !important;
    border-radius: 15px !important;

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

    background: #111827 !important;
    color: #ffffff !important;

    text-decoration: none !important;
    text-align: center !important;
    white-space: nowrap !important;

    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    cursor: pointer !important;
    box-sizing: border-box !important;
}

.sales-history-top .sales-action-btn:hover {
    background: #000000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.2) !important;
}

@media (max-width: 1100px) {
    .sales-history-top {
        flex-direction: column !important;
    }

    .sales-history-top .sales-page-actions {
        width: 100% !important;
        margin-top: 16px !important;
        margin-left: 0 !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}

@media (max-width: 900px) {
    .sales-history-top .sales-page-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .sales-history-top .sales-action-btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* ===== Кнопки на странице заказов напротив заголовка ===== */

.orders-history-top {
    align-items: flex-start !important;
}

.orders-history-top .orders-page-actions {
    margin-top: 30px !important;
    margin-left: auto !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
}

.orders-history-top .orders-action-btn {
    width: auto !important;
    min-width: 165px !important;
    height: 46px !important;
    min-height: 46px !important;

    padding: 0 18px !important;

    border: none !important;
    border-radius: 15px !important;

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

    background: #111827 !important;
    color: #ffffff !important;

    text-decoration: none !important;
    text-align: center !important;
    white-space: nowrap !important;

    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    cursor: pointer !important;
    box-sizing: border-box !important;
}

.orders-history-top .orders-action-btn:hover {
    background: #000000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.2) !important;
}

@media (max-width: 1100px) {
    .orders-history-top {
        flex-direction: column !important;
    }

    .orders-history-top .orders-page-actions {
        width: 100% !important;
        margin-top: 16px !important;
        margin-left: 0 !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}

@media (max-width: 900px) {
    .orders-history-top .orders-page-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .orders-history-top .orders-action-btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* ===== Кнопки на странице расходов напротив заголовка ===== */

/* ===== Фиксированная высота списка заказа ===== */

#selectedProducts.selected-products {
    max-height: 360px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;

    padding-right: 8px !important;
}

/* Чтобы карточки внутри списка не растягивали страницу */
#selectedProducts .selected-product-item {
    flex-shrink: 0 !important;
}

/* Красивый скролл внутри списка заказа */
#selectedProducts::-webkit-scrollbar {
    width: 8px;
}

#selectedProducts::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 999px;
}

#selectedProducts::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

#selectedProducts::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== Фикс ширины бухгалтерии и защиты от растягивания страницы ===== */

html,
body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.dashboard-page {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

.accounting-page {
    flex: 1 1 auto !important;
    width: calc(100vw - 310px) !important;
    max-width: calc(100vw - 310px) !important;
    min-width: 0 !important;

    padding: 34px 42px !important;
    box-sizing: border-box !important;

    overflow-x: hidden !important;
}

.accounting-card {
    width: 100% !important;
    max-width: 1180px !important;
    min-width: 0 !important;

    margin-left: auto !important;
    margin-right: auto !important;

    box-sizing: border-box !important;
    overflow: hidden !important;
}

.accounting-admin-panel,
.accounting-payment-methods,
.finance-summary-grid,
.accounting-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.finance-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.accounting-table-wrapper {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

.accounting-table {
    width: 100% !important;
    min-width: 980px !important;
}

/* чтобы длинные тексты не раздвигали таблицу */
.accounting-table th,
.accounting-table td {
    overflow-wrap: break-word !important;
    word-break: normal !important;
}

@media (max-width: 1300px) {
    .accounting-page {
        width: 100% !important;
        max-width: 100% !important;
        padding: 24px !important;
    }

    .finance-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    .accounting-page {
        padding: 18px !important;
    }

    .finance-summary-grid {
        grid-template-columns: 1fr !important;
    }

    .accounting-table {
        min-width: 860px !important;
    }
}

/* ===== Страница оплат заказов ===== */

.payment-orders-history-top {
    align-items: flex-start !important;
}

.payment-orders-history-top .payment-orders-page-actions {
    margin-top: 30px !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
}

.payment-orders-action-btn {
    width: auto !important;
    min-width: 135px !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 0 18px !important;
    border: none !important;
    border-radius: 15px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #111827 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    text-align: center !important;
    white-space: nowrap !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

.payment-orders-action-btn:hover {
    background: #000000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.2) !important;
}

.payment-orders-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.payment-order-card {
    width: 100%;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    background: #f8fafc;
    color: #111827;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    text-align: left;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.payment-order-card:hover {
    background: #eef3f8;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.payment-order-card.is-partial {
    background: rgba(245, 158, 11, 0.08);
}

.payment-order-card-main h3 {
    margin-top: 8px;
    margin-bottom: 6px;
    color: #111827;
    font-size: 22px;
}

.payment-order-card-main p {
    color: #6b7280;
    font-size: 14px;
}

.payment-order-card-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    gap: 10px;
    min-width: 720px;
}

.payment-order-card-metrics div {
    padding: 14px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.payment-order-card-metrics span {
    display: block;
    margin-bottom: 6px;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.payment-order-card-metrics strong {
    color: #111827;
    font-size: 15px;
    white-space: nowrap;
}

.payment-order-modal {
    max-width: 980px;
}

.payment-order-form-block {
    margin-top: 24px;
    padding: 20px;
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.payment-order-form-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.payment-order-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 800;
}

.payment-order-form-grid input,
.payment-order-form-grid select {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid #dbe2ea;
    border-radius: 15px;
    background: #ffffff;
    color: #111827;
    font-size: 15px;
    outline: none;
}

.payment-order-modal-actions {
    margin-top: 16px !important;
}

.payment-order-product-item {
    align-items: center;
}

.payment-order-payments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-order-payment-item {
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.payment-order-payment-item strong {
    color: #111827;
}

.payment-order-payment-item p,
.payment-order-payment-item span {
    margin-top: 4px;
    color: #6b7280;
    font-size: 14px;
}

@media (max-width: 1300px) {
    .payment-order-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .payment-order-card-metrics {
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .payment-orders-history-top {
        flex-direction: column !important;
    }

    .payment-orders-history-top .payment-orders-page-actions {
        width: 100% !important;
        margin-top: 16px !important;
        margin-left: 0 !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}

@media (max-width: 900px) {
    .payment-orders-history-top .payment-orders-page-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .payment-orders-action-btn {
        width: 100% !important;
        min-width: 0 !important;
    }

    .payment-order-card-metrics,
    .payment-order-form-grid {
        grid-template-columns: 1fr;
    }

    .payment-order-payment-item {
        flex-direction: column;
    }
}

/* ===== Исправляем статус на странице оплат заказов ===== */

.payment-order-card-metrics div {
    min-width: 0 !important;
    overflow: hidden !important;
}

.payment-order-card-metrics div:first-child {
    min-width: 150px !important;
}

.payment-order-card-metrics div:first-child strong {
    display: block !important;
    max-width: 100% !important;

    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;

    font-size: 14px !important;
    line-height: 1.2 !important;
}

/* ===== Карты в модальном окне оплаты заявки ===== */

/* ===== Модалка выбора карт при оплате заявки ===== */

.payment-order-card-select-block {
    margin-top: 16px;
    padding: 16px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;

    display: flex;
    align-items: center;
    gap: 18px;
}

.payment-order-card-select-block .telegram-btn {
    min-width: 240px;
}

.payment-order-card-summary {
    color: #6b7280;
    font-size: 15px;
    font-weight: 700;
}

.payment-cards-overlay {
    z-index: 99999;
    background: rgba(15, 23, 42, 0.72);
}

.payment-cards-modal {
    max-width: 760px;
}

.payment-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-card-choice-item {
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    align-items: center;
    gap: 14px;
}

.payment-card-choice-item strong {
    color: #111827;
    font-size: 17px;
}

.payment-card-choice-item p {
    margin-top: 4px;
    color: #6b7280;
    font-size: 14px;
}

.payment-card-choice-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    background: #ffffff;
    color: #111827;
    font-size: 15px;
    outline: none;
}

@media (max-width: 900px) {
    .payment-order-card-select-block {
        flex-direction: column;
        align-items: stretch;
    }

    .payment-order-card-select-block .telegram-btn {
        width: 100%;
        min-width: 0;
    }

    .payment-card-choice-item {
        grid-template-columns: 1fr;
    }
}

/* ===== Админские уведомления в меню ===== */

.sidebar-nav a[data-admin-badge] {
    gap: 12px;
}

/* ===== Бейджи в боковом меню для админа ===== */

.sidebar-nav a[data-admin-badge] {
    width: 100%;
    gap: 12px;
    box-sizing: border-box;
}

.admin-menu-badge {
    margin-left: auto;
    flex-shrink: 0;

    width: 36px;
    height: 36px;

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

    border-radius: 50%;
    background: #ff4d4f;
    color: #ffffff;

    font-size: 18px;
    font-weight: 800;
    line-height: 1;

    box-shadow: 0 8px 20px rgba(255, 77, 79, 0.28);
}

.admin-menu-badge.is-hidden {
    display: none !important;
}

/* ===== Маленькие красные бейджи в меню ===== */

.sidebar-nav a[data-admin-badge] {
    gap: 10px;
}

.sidebar-nav .admin-menu-badge {
    min-width: 22px !important;
}

.sidebar-nav a[data-admin-badge] {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-nav .admin-menu-badge {
    margin-left: auto !important;
    flex-shrink: 0 !important;

    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;

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

    border-radius: 50% !important;
    background: #ff4d4f !important;
    color: #ffffff !important;

    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    box-shadow: 0 5px 12px rgba(255, 77, 79, 0.22) !important;
}

.sidebar-nav .admin-menu-badge.is-hidden {
    display: none !important;
}

/* ===== Выравниваем бейдж чатов под админские кружки ===== */

.sidebar-nav a[data-chat-badge] {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-nav .chat-unread-badge {
    margin-left: auto !important;
    flex-shrink: 0 !important;

    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    padding: 0 !important;

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

    border-radius: 50% !important;
    background: #ff4d4f !important;
    color: #ffffff !important;

    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    box-shadow: 0 5px 12px rgba(255, 77, 79, 0.22) !important;
}

.sidebar-nav .chat-unread-badge.is-hidden {
    display: none !important;
}

.sidebar-nav a[data-chat-badge] > .chat-unread-badge {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;

    padding: 0 !important;

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

    border-radius: 50% !important;
    background: #ff4d4f !important;
    color: #ffffff !important;

    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    box-shadow: 0 5px 12px rgba(255, 77, 79, 0.22) !important;
}

/* ===== Маленький бейдж "Мои заявки" ===== */

.sidebar-nav a[data-my-orders-badge] > .my-orders-unread-badge {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;

    padding: 0 !important;
    margin-left: auto !important;

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

    border-radius: 50% !important;
    background: #ff4d4f !important;
    color: #ffffff !important;

    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    box-shadow: 0 5px 12px rgba(255, 77, 79, 0.22) !important;
}

.sidebar-nav a[data-my-orders-badge] > .my-orders-unread-badge.is-hidden {
    display: none !important;
}

.sidebar-nav .chat-unread-badge,
.sidebar-nav .my-orders-unread-badge,
.sidebar-nav .admin-menu-badge {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    padding: 0 !important;

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

    border-radius: 50% !important;

    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

/* ===== Мои заявки: фиксированная карточка и прокрутка списка ===== */

.my-orders-card {
    height: calc(100vh - 210px) !important;
    min-height: 620px !important;

    display: flex !important;
    flex-direction: column !important;

    overflow: hidden !important;
}

.my-orders-card .inventory-top {
    flex-shrink: 0 !important;
}

#myOrdersList.client-orders-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    padding-right: 8px !important;
}

/* Красивый скролл внутри списка заявок */

#myOrdersList.client-orders-list::-webkit-scrollbar {
    width: 8px;
}

#myOrdersList.client-orders-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 999px;
}

#myOrdersList.client-orders-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

#myOrdersList.client-orders-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (max-width: 900px) {
    .my-orders-card {
        height: calc(100vh - 260px) !important;
        min-height: 460px !important;
    }
}

/* ===== Админ-заявки: сумма в одну строку ===== */

#adminOrdersTableBody .admin-order-sum-cell {
    white-space: nowrap !important;
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
}

/* Заголовок колонки "Сумма" тоже держим в одну строку */
.inventory-table th:nth-child(5) {
    white-space: nowrap !important;
    min-width: 140px !important;
}

/* ===== Склад: аккуратные заголовки цен без расширения страницы ===== */

.stock-table th.stock-price-head {
    white-space: normal !important;
    line-height: 1.05 !important;
    font-size: 13px !important;
    letter-spacing: 0.03em !important;
}

.stock-table th.stock-price-head span {
    display: block !important;
}

/* ===== Расходы: стиль как у складских остатков ===== */

.expenses-stock-style-card {
    overflow: hidden !important;
}

.expenses-stock-style-card .inventory-top {
    gap: 24px !important;
}

.expenses-stock-style-card .inventory-table-wrapper {
    margin-top: 22px !important;
}

.expenses-table {
    width: 100% !important;
    table-layout: fixed !important;
}

.expenses-table th,
.expenses-table td {
    vertical-align: middle !important;
}

.expenses-table th:nth-child(1),
.expenses-table td:nth-child(1) {
    width: 16%;
}

.expenses-table th:nth-child(2),
.expenses-table td:nth-child(2) {
    width: 18%;
}

.expenses-table th:nth-child(3),
.expenses-table td:nth-child(3) {
    width: 16%;
    white-space: nowrap !important;
}

.expenses-table th:nth-child(4),
.expenses-table td:nth-child(4) {
    width: 30%;
}

.expenses-table th:nth-child(5),
.expenses-table td:nth-child(5) {
    width: 20%;
}

.expenses-table .table-actions {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

/* Чтобы кнопки наверху выглядели как на складе */
.expenses-stock-actions .inventory-page-action-btn {
    white-space: nowrap !important;
}

/* ===== Расходы: кнопки справа как на складе ===== */

.expenses-stock-style-card .inventory-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px !important;
    width: 100% !important;
}

.expenses-stock-style-card .inventory-top > div:first-child {
    flex: 0 0 auto !important;
}

.expenses-stock-actions {
    margin-left: auto !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
}

.expenses-stock-actions .inventory-page-actions-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
}

.expenses-stock-actions .inventory-page-action-btn,
.expenses-stock-actions .inventory-page-back-btn {
    white-space: nowrap !important;
}

/* ===== Расходы: кнопки действий ровно под заголовком ===== */

.expenses-table th:nth-child(5),
.expenses-table td:nth-child(5) {
    text-align: center !important;
    vertical-align: middle !important;
}

.expenses-table td:nth-child(5) .table-actions {
    width: 100% !important;

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

    gap: 6px !important;
}

/* Одинаковый размер кнопок */
.expenses-table td:nth-child(5) .edit-btn,
.expenses-table td:nth-child(5) .delete-btn {
    width: 115px !important;
    height: 34px !important;

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

    padding: 0 !important;
    box-sizing: border-box !important;

    text-align: center !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    border-radius: 14px !important;
}

/* ===== Admin order: JD price-list check info ===== */

/* ===== Админ: регистрация пользователей ===== */

.admin-create-user-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0;
    padding: 20px;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px solid #e5eefb;
}

.admin-create-user-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 800;
    color: #5b6b82;
    font-size: 13px;
    text-transform: uppercase;
}

.admin-create-user-form input,
.admin-create-user-form select {
    width: 100%;
    border: 1px solid #dbe7f5;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 700;
    background: #ffffff;
    color: #071225;
}

.admin-create-user-form .form-actions {
    align-self: end;
}

.user-access-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef6ff;
    color: #007aff;
    font-weight: 800;
    white-space: nowrap;
}

.admin-user-row.is-inactive {
    opacity: 0.55;
}

.admin-user-actions {
    justify-content: flex-start;
}

@media (max-width: 1200px) {
    .admin-create-user-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .admin-create-user-form {
        grid-template-columns: 1fr;
    }
}

/* ===== Права доступа: пользователь внутреннего рынка ===== */

body.is-internal-market-only #balance,
body.is-internal-market-only #debt,
body.is-internal-market-only #telegram,
body.is-internal-market-only #managers {
    display: none !important;
}

body.is-region-user .sidebar-nav a[href*="internal-market.html"],
body.is-region-user .sidebar a[href*="internal-market.html"],
body.is-region-user aside a[href*="internal-market.html"] {
    display: none !important;
}

/* ===== Убираем мигание меню при загрузке для пользователя внутреннего рынка ===== */

html.preload-internal-market-only .sidebar-nav a[href*="#balance"],
html.preload-internal-market-only .sidebar-nav a[href*="#debt"],
html.preload-internal-market-only .sidebar-nav a[href*="#telegram"],
html.preload-internal-market-only .sidebar-nav a[href*="#managers"],
html.preload-internal-market-only .sidebar-nav a[href*="balance"],
html.preload-internal-market-only .sidebar-nav a[href*="debt"],
html.preload-internal-market-only .sidebar-nav a[href*="telegram"],
html.preload-internal-market-only .sidebar-nav a[href*="managers"] {
    display: none !important;
}

/* ===== Подписка внутреннего рынка ===== */
.subscription-card {
    border: 1px solid #dbeafe !important;
    background: linear-gradient(135deg, #ffffff, #f8fbff) !important;
}

.subscription-card h2 {
    margin-bottom: 6px !important;
}

.subscription-warning-text {
    margin-top: 8px !important;
    font-weight: 800 !important;
}

.subscription-card.subscription-warning {
    border-color: #fde68a !important;
    background: #fffbeb !important;
}

.subscription-card.subscription-danger,
.subscription-card.subscription-expired {
    border-color: #fecaca !important;
    background: #fff1f2 !important;
}

.subscription-card.subscription-danger .subscription-warning-text,
.subscription-card.subscription-expired .subscription-warning-text {
    color: #dc2626 !important;
}

.admin-subscription-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #16a34a;
    font-weight: 900;
    white-space: nowrap;
}

.admin-subscription-badge.warning {
    background: #fef3c7;
    color: #d97706;
}

.admin-subscription-badge.danger,
.admin-subscription-badge.expired {
    background: #ffe4e6;
    color: #dc2626;
}

.admin-subscription-until,
.subscription-muted {
    color: #64748b;
    font-weight: 800;
    white-space: nowrap;
}

/* ===== Админка: компактный список пользователей + подписка в карточке клиента ===== */

.admin-users-table th,
.admin-users-table td {
    vertical-align: middle !important;
}

.admin-users-table .admin-user-row {
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.admin-users-table .admin-user-row:hover {
    background: #f8fbff;
    transform: translateY(-1px);
}

.admin-users-table .user-access-badge {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-selected-subscription-block {
    margin: 18px 0 22px;
}

.admin-selected-subscription-card {
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border-radius: 28px;
    padding: 22px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.admin-selected-subscription-card.warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.admin-selected-subscription-card.danger,
.admin-selected-subscription-card.expired {
    border-color: #fecaca;
    background: #fff1f2;
}

.admin-selected-subscription-card.muted {
    background: #f8fafc;
    border-color: #e5eefb;
}

.admin-selected-subscription-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.admin-selected-subscription-main h3 {
    margin: 6px 0 6px;
    font-size: 24px;
    line-height: 1.2;
    color: #071225;
}

.admin-selected-subscription-main p {
    margin: 0;
    color: #5b6b82;
    font-weight: 700;
}

.admin-selected-subscription-form {
    display: grid;
    grid-template-columns: 120px 140px 170px minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.admin-selected-subscription-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    color: #5b6b82;
}

.admin-selected-subscription-form input,
.admin-selected-subscription-form select {
    width: 100%;
    border: 1px solid #dbe7f5;
    border-radius: 16px;
    padding: 13px 14px;
    font-size: 15px;
    font-weight: 800;
    background: #fff;
    color: #071225;
}

.admin-selected-subscription-form button {
    min-height: 48px;
    border-radius: 16px !important;
    white-space: nowrap;
}

.admin-subscription-mini-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #16a34a;
    font-weight: 900;
    white-space: nowrap;
}

.admin-subscription-mini-badge.warning {
    background: #fef3c7;
    color: #d97706;
}

.admin-subscription-mini-badge.danger,
.admin-subscription-mini-badge.expired {
    background: #ffe4e6;
    color: #dc2626;
}

@media (max-width: 1300px) {
    .admin-selected-subscription-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-selected-subscription-form .wide {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .admin-selected-subscription-main {
        flex-direction: column;
    }

    .admin-selected-subscription-form {
        grid-template-columns: 1fr;
    }
}

/* ===== Подписка: ручной ввод дней ===== */

.admin-selected-subscription-form.only-manual {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.2fr 2fr auto;
    gap: 14px;
    align-items: end;
    margin-top: 22px;
}

.admin-selected-subscription-form.only-manual label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 800;
    color: #5b6b82;
    font-size: 13px;
    text-transform: uppercase;
}

.admin-selected-subscription-form.only-manual input,
.admin-selected-subscription-form.only-manual select {
    height: 58px;
    border-radius: 16px;
    border: 1px solid #dbe7f5;
    padding: 0 18px;
    font-size: 18px;
    font-weight: 800;
    color: #071225;
    background: #ffffff;
}

.admin-selected-subscription-form.only-manual .days-field input {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.08);
}

.admin-selected-subscription-form.only-manual .subscription-add-btn {
    height: 58px;
    min-width: 150px;
}

@media (max-width: 1200px) {
    .admin-selected-subscription-form.only-manual {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-selected-subscription-form.only-manual .wide {
        grid-column: 1 / -1;
    }
}

/* ===== JD Group adaptive layout patch v1 ===== */

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

.dashboard-page,
.dashboard-content,
.dashboard-card,
.sidebar,
.sidebar-nav,
.manager-list,
.manager-item,
.telegram-card {
    min-width: 0;
}

.dashboard-content {
    overflow-x: hidden;
}

.dashboard-content table {
    max-width: 100%;
}

.table-wrap,
.table-wrapper,
.orders-table-wrapper,
.admin-orders-table-wrapper,
.accounting-table-wrap,
.accounting-table-wrapper,
.inventory-table-wrap,
.receipts-table-wrap,
.sales-table-wrap,
.expenses-table-wrap,
.payment-orders-table-wrap,
.client-orders-table-wrap,
.imeis-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap table,
.table-wrapper table,
.orders-table-wrapper table,
.admin-orders-table-wrapper table,
.accounting-table-wrap table,
.accounting-table-wrapper table,
.inventory-table-wrap table,
.receipts-table-wrap table,
.sales-table-wrap table,
.expenses-table-wrap table,
.payment-orders-table-wrap table,
.client-orders-table-wrap table,
.imeis-table-wrap table {
    min-width: 760px;
}

@media (max-width: 1300px) {
    .sidebar {
        width: 250px;
        padding: 24px 20px;
    }

    .dashboard-content {
        padding: 30px;
    }

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

    .dashboard-header h1 {
        font-size: clamp(34px, 4vw, 42px);
    }

    .dashboard-card {
        padding: 24px;
    }
}

@media (max-width: 900px) {
    .dashboard-page {
        display: block;
        min-height: 100vh;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 1000;
        width: 100%;
        min-height: 0;
        max-height: none;
        padding: 14px 16px;
        border-right: 0;
        border-bottom: 1px solid rgba(209, 213, 219, 0.75);
        background: rgba(255, 255, 255, 0.94);
    }

    .sidebar-logo {
        gap: 12px;
    }

    .sidebar-logo .brand-logo {
        width: 48px;
        height: 48px;
        border-radius: 16px;
        font-size: 18px;
        flex: 0 0 auto;
    }

    .sidebar-logo h2 {
        font-size: 20px;
    }

    .sidebar-logo p {
        font-size: 13px;
    }

    .sidebar-nav {
        margin-top: 14px;
        display: flex;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 2px 0 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .sidebar-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 11px 14px;
        border-radius: 14px;
        font-size: 14px;
        background: rgba(238, 246, 255, 0.8);
    }

    .sidebar-nav a:hover {
        transform: none;
    }

    .logout-btn {
        margin-top: 10px;
        padding: 12px 16px;
        border-radius: 14px;
    }

    .dashboard-content {
        width: 100%;
        max-width: 100%;
        padding: 20px 16px 28px;
    }

    .dashboard-header {
        margin-bottom: 20px;
    }

    .dashboard-header h1 {
        font-size: clamp(30px, 8vw, 38px);
        line-height: 1.08;
        letter-spacing: -0.04em;
    }

    .dashboard-header p {
        font-size: 15px;
        line-height: 1.45;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 14px;
    }

    .dashboard-card {
        border-radius: 22px;
        padding: 20px;
    }

    .dashboard-card:hover {
        transform: none;
    }

    .dashboard-card h2 {
        font-size: clamp(24px, 7vw, 30px);
        line-height: 1.08;
    }

    .telegram-card {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .telegram-btn,
    .secondary-btn,
    .delete-btn,
    .edit-btn,
    .save-btn,
    .primary-btn {
        min-height: 46px;
    }

    .telegram-card .telegram-btn {
        width: 100%;
        text-align: center;
    }

    .manager-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .modal,
    .modal-overlay,
    .order-modal,
    .payment-modal,
    .client-modal {
        padding: 12px !important;
    }

    .modal-content,
    .modal-card,
    .order-modal-content,
    .payment-modal-content,
    .client-modal-content {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 24px) !important;
        overflow-y: auto !important;
        border-radius: 24px !important;
        padding: 20px !important;
    }
}

@media (max-width: 640px) {
    .auth-page {
        padding: 14px;
        align-items: flex-start;
    }

    .auth-card {
        padding: 24px 20px;
        border-radius: 24px;
    }

    .brand {
        gap: 12px;
        margin-bottom: 24px;
    }

    .brand-logo {
        width: 50px;
        height: 50px;
        border-radius: 16px;
        font-size: 18px;
    }

    .brand h1 {
        font-size: 24px;
    }

    .dashboard-content {
        padding: 18px 12px 24px;
    }

    .dashboard-header h1 {
        font-size: 30px;
    }

    .dashboard-card {
        padding: 18px;
        border-radius: 20px;
    }

    .card-label {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .sidebar {
        padding: 12px;
    }

    .sidebar-nav a {
        font-size: 13px;
        padding: 10px 12px;
    }

    .logout-btn {
        width: 100%;
    }

    .dashboard-content table {
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .dashboard-header h1 {
        font-size: 27px;
    }

    .dashboard-card h2 {
        font-size: 23px;
    }

    .sidebar-logo h2 {
        font-size: 18px;
    }

    .sidebar-logo p {
        font-size: 12px;
    }

    .telegram-btn,
    .secondary-btn,
    .delete-btn,
    .edit-btn,
    .save-btn,
    .primary-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* ===== MOBILE FIX: общие страницы личного кабинета / учётность / заказы / склад ===== */

@media (max-width: 768px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .app-layout,
    .dashboard-layout,
    .page-layout,
    .layout,
    .cabinet-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    .sidebar {
        position: relative !important;
        left: auto !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: auto !important;

        padding: 22px 18px 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;

        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .sidebar-logo,
    .sidebar-header {
        margin-bottom: 18px !important;
    }

    .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .sidebar-nav a {
        flex: 0 0 auto !important;
        white-space: nowrap !important;

        min-width: auto !important;
        width: auto !important;

        padding: 12px 16px !important;
        border-radius: 16px !important;
        font-size: 15px !important;
    }

    .sidebar-nav .nav-badge,
    .sidebar-nav .badge,
    .sidebar-nav .menu-badge {
        position: static !important;
        transform: none !important;
        margin-left: 8px !important;
        flex: 0 0 auto !important;
    }

    .logout-btn,
    .sidebar-logout,
    #logoutBtn {
        width: 100% !important;
        margin-top: 14px !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
    }

    .main-content,
    .content,
    .page-content,
    .dashboard-content {
        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding: 22px 16px 36px !important;

        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .card,
    .content-card,
    .dashboard-card,
    .inventory-card,
    .orders-card,
    .accounting-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    table {
        min-width: 760px !important;
    }

    .table-wrapper,
    .table-wrap,
    .orders-table-wrapper,
    .inventory-table-wrapper,
    .accounting-table-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* ===== MOBILE FIX: складские остатки в учётности прокручиваются вправо ===== */

@media (max-width: 768px) {
    body.inventory-page {
        overflow-x: hidden !important;
    }

    body.inventory-page .inventory-card,
    body.inventory-page .content-card,
    body.inventory-page .dashboard-card,
    body.inventory-page .card {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    body.inventory-page .inventory-table-wrapper,
    body.inventory-page .inventory-table-wrap,
    body.inventory-page .table-wrapper,
    body.inventory-page .table-wrap,
    body.inventory-page .stock-table-wrapper,
    body.inventory-page .stock-table-wrap {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
    }

    body.inventory-page table,
    body.inventory-page .inventory-table,
    body.inventory-page .stock-table {
        width: 760px !important;
        min-width: 760px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.inventory-page table th,
    body.inventory-page table td,
    body.inventory-page .inventory-table th,
    body.inventory-page .inventory-table td,
    body.inventory-page .stock-table th,
    body.inventory-page .stock-table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.inventory-page table th:first-child,
    body.inventory-page table td:first-child,
    body.inventory-page .inventory-table th:first-child,
    body.inventory-page .inventory-table td:first-child,
    body.inventory-page .stock-table th:first-child,
    body.inventory-page .stock-table td:first-child {
        width: 240px !important;
        min-width: 240px !important;
        max-width: 240px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
}

@media (max-width: 768px) {
    body.inventory-page .inventory-list,
    body.inventory-page .stock-list,
    body.inventory-page .inventory-rows,
    body.inventory-page .stock-rows {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.inventory-page .inventory-row,
    body.inventory-page .stock-row,
    body.inventory-page .inventory-table-row {
        width: 760px !important;
        min-width: 760px !important;
        max-width: none !important;
        flex-shrink: 0 !important;
    }
}

/* ===== FINAL FIX: горизонтальная прокрутка складских остатков ===== */

@media (max-width: 768px) {
    body.inventory-page .stock-inventory-card {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    body.inventory-page .stock-inventory-card .inventory-table-wrapper {
        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: auto !important;

        padding-bottom: 12px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.inventory-page .stock-inventory-card .stock-table,
    body.inventory-page .stock-inventory-card .inventory-table {
        width: 1050px !important;
        min-width: 1050px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.inventory-page .stock-inventory-card .stock-table th,
    body.inventory-page .stock-inventory-card .stock-table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.inventory-page .stock-inventory-card .stock-table th:first-child,
    body.inventory-page .stock-inventory-card .stock-table td:first-child {
        width: 230px !important;
        min-width: 230px !important;
        max-width: 230px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    body.inventory-page .stock-inventory-card .inventory-table-wrapper::-webkit-scrollbar {
        width: 8px !important;
        height: 8px !important;
    }

    body.inventory-page .stock-inventory-card .inventory-table-wrapper::-webkit-scrollbar-track {
        background: #f1f5f9 !important;
        border-radius: 999px !important;
    }

    body.inventory-page .stock-inventory-card .inventory-table-wrapper::-webkit-scrollbar-thumb {
        background: #cbd5e1 !important;
        border-radius: 999px !important;
    }
}

/* ===== FINAL: удобная высота складских остатков ===== */

.inventory-page .stock-inventory-card,
.inventory-page .inventory-stock-card,
.inventory-page .inventory-card,
.inventory-page .content-card {
    overflow: visible !important;
}

/* Основной контейнер таблицы складских остатков */
.inventory-page .stock-inventory-card .inventory-table-wrapper,
.inventory-page .inventory-stock-card .inventory-table-wrapper,
.inventory-page .inventory-card .inventory-table-wrapper,
.inventory-page .stock-table-wrapper,
.inventory-page .inventory-table-wrapper {
    height: 520px !important;
    min-height: 520px !important;
    max-height: 520px !important;

    overflow-x: auto !important;
    overflow-y: auto !important;

    padding-right: 8px !important;
    padding-bottom: 12px !important;

    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Таблица внутри остаётся широкой */
.inventory-page .stock-inventory-card table,
.inventory-page .inventory-stock-card table,
.inventory-page .inventory-card table,
.inventory-page .inventory-table-wrapper table,
.inventory-page table.inventory-table,
.inventory-page table.stock-table {
    min-width: 1100px !important;
    width: 1100px !important;
    max-width: none !important;
    table-layout: fixed !important;
}

/* Планшет */
@media (max-width: 1024px) {
    .inventory-page .stock-inventory-card .inventory-table-wrapper,
    .inventory-page .inventory-stock-card .inventory-table-wrapper,
    .inventory-page .inventory-card .inventory-table-wrapper,
    .inventory-page .stock-table-wrapper,
    .inventory-page .inventory-table-wrapper {
        height: 500px !important;
        min-height: 500px !important;
        max-height: 500px !important;
    }
}

/* Телефон */
@media (max-width: 768px) {
    .inventory-page .stock-inventory-card .inventory-table-wrapper,
    .inventory-page .inventory-stock-card .inventory-table-wrapper,
    .inventory-page .inventory-card .inventory-table-wrapper,
    .inventory-page .stock-table-wrapper,
    .inventory-page .inventory-table-wrapper {
        height: 470px !important;
        min-height: 470px !important;
        max-height: 470px !important;

        overflow-x: auto !important;
        overflow-y: auto !important;
    }
}

/* Маленький телефон */
@media (max-width: 430px) {
    .inventory-page .stock-inventory-card .inventory-table-wrapper,
    .inventory-page .inventory-stock-card .inventory-table-wrapper,
    .inventory-page .inventory-card .inventory-table-wrapper,
    .inventory-page .stock-table-wrapper,
    .inventory-page .inventory-table-wrapper {
        height: 440px !important;
        min-height: 440px !important;
        max-height: 440px !important;
    }
}

/* ===== FINAL MOBILE HEIGHT: складские остатки выше на телефоне ===== */

@media (max-width: 768px) {
    body.inventory-page .stock-inventory-card .inventory-table-wrapper,
    body.inventory-page .inventory-stock-card .inventory-table-wrapper,
    body.inventory-page .inventory-card .inventory-table-wrapper,
    body.inventory-page .stock-table-wrapper,
    body.inventory-page .inventory-table-wrapper {
        height: 620px !important;
        min-height: 620px !important;
        max-height: 620px !important;

        overflow-y: auto !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

@media (max-width: 430px) {
    body.inventory-page .stock-inventory-card .inventory-table-wrapper,
    body.inventory-page .inventory-stock-card .inventory-table-wrapper,
    body.inventory-page .inventory-card .inventory-table-wrapper,
    body.inventory-page .stock-table-wrapper,
    body.inventory-page .inventory-table-wrapper {
        height: 600px !important;
        min-height: 600px !important;
        max-height: 600px !important;

        overflow-y: auto !important;
        overflow-x: auto !important;
    }
}

/* ===== MOBILE FIX: страница продаж sales.html ===== */

@media (max-width: 768px) {
    body.sales-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.sales-page .app-layout,
    body.sales-page .dashboard-layout,
    body.sales-page .page-layout,
    body.sales-page .layout,
    body.sales-page .cabinet-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    body.sales-page .sidebar {
        position: relative !important;
        left: auto !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: auto !important;

        padding: 22px 18px 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;

        box-sizing: border-box !important;
        overflow: visible !important;
    }

    body.sales-page .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.sales-page .sidebar-nav a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;

        padding: 12px 16px !important;
        border-radius: 16px !important;

        font-size: 15px !important;
        white-space: nowrap !important;
    }

    body.sales-page .sidebar-nav .nav-badge,
    body.sales-page .sidebar-nav .badge,
    body.sales-page .sidebar-nav .menu-badge {
        position: static !important;
        transform: none !important;
        margin-left: 8px !important;
        flex: 0 0 auto !important;
    }

    body.sales-page .main-content,
    body.sales-page .content,
    body.sales-page .page-content,
    body.sales-page .dashboard-content {
        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding: 22px 16px 36px !important;

        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.sales-page h1 {
        font-size: 32px !important;
        line-height: 1.05 !important;
        word-break: break-word !important;
    }

    body.sales-page .card,
    body.sales-page .content-card,
    body.sales-page .dashboard-card,
    body.sales-page .sales-card,
    body.sales-page .orders-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.sales-page .table-wrapper,
    body.sales-page .table-wrap,
    body.sales-page .sales-table-wrapper,
    body.sales-page .sales-table-wrap,
    body.sales-page .orders-table-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.sales-page table,
    body.sales-page .sales-table,
    body.sales-page .orders-table {
        width: 980px !important;
        min-width: 980px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.sales-page table th,
    body.sales-page table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.sales-page table th:first-child,
    body.sales-page table td:first-child {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    body.sales-page .logout-btn,
    body.sales-page .sidebar-logout,
    body.sales-page #logoutBtn {
        width: 100% !important;
        margin-top: 14px !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
    }
}

/* ===== HEIGHT FIX: блок продаж выше ===== */

/* Компьютер */
body.sales-page .sales-table-wrapper,
body.sales-page .sales-table-wrap,
body.sales-page .orders-table-wrapper,
body.sales-page .table-wrapper,
body.sales-page .table-wrap {
    height: 520px !important;
    min-height: 520px !important;
    max-height: 520px !important;

    overflow-y: auto !important;
    overflow-x: auto !important;

    padding-bottom: 12px !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Планшет */
@media (max-width: 1024px) {
    body.sales-page .sales-table-wrapper,
    body.sales-page .sales-table-wrap,
    body.sales-page .orders-table-wrapper,
    body.sales-page .table-wrapper,
    body.sales-page .table-wrap {
        height: 500px !important;
        min-height: 500px !important;
        max-height: 500px !important;
    }
}

/* Телефон */
@media (max-width: 768px) {
    body.sales-page .sales-table-wrapper,
    body.sales-page .sales-table-wrap,
    body.sales-page .orders-table-wrapper,
    body.sales-page .table-wrapper,
    body.sales-page .table-wrap {
        height: 460px !important;
        min-height: 460px !important;
        max-height: 460px !important;

        overflow-y: auto !important;
        overflow-x: auto !important;
    }
}

/* Маленькие телефоны */
@media (max-width: 430px) {
    body.sales-page .sales-table-wrapper,
    body.sales-page .sales-table-wrap,
    body.sales-page .orders-table-wrapper,
    body.sales-page .table-wrapper,
    body.sales-page .table-wrap {
        height: 440px !important;
        min-height: 440px !important;
        max-height: 440px !important;
    }
}

/* ===== FINAL FIX: sales.html — высота и прокрутка таблицы продаж ===== */

body.sales-page #salesTableScroll {
    width: 100% !important;
    max-width: 100% !important;

    height: 560px !important;
    min-height: 560px !important;
    max-height: 560px !important;

    overflow-x: auto !important;
    overflow-y: auto !important;

    padding-bottom: 12px !important;
    box-sizing: border-box !important;

    -webkit-overflow-scrolling: touch !important;
}

body.sales-page #salesTableScroll .sales-table,
body.sales-page #salesTableScroll table {
    width: 1120px !important;
    min-width: 1120px !important;
    max-width: none !important;

    table-layout: fixed !important;
    border-collapse: collapse !important;
}

body.sales-page #salesTableScroll th,
body.sales-page #salesTableScroll td {
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

body.sales-page #salesTableScroll th:first-child,
body.sales-page #salesTableScroll td:first-child {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
}

body.sales-page #salesTableScroll th:nth-child(2),
body.sales-page #salesTableScroll td:nth-child(2) {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    white-space: normal !important;
    word-break: break-word !important;
}

body.sales-page #salesTableScroll::-webkit-scrollbar {
    width: 8px !important;
    height: 8px !important;
}

body.sales-page #salesTableScroll::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
    border-radius: 999px !important;
}

body.sales-page #salesTableScroll::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 999px !important;
}

/* Планшет */
@media (max-width: 1024px) {
    body.sales-page #salesTableScroll {
        height: 540px !important;
        min-height: 540px !important;
        max-height: 540px !important;
    }
}

/* Телефон */
@media (max-width: 768px) {
    body.sales-page #salesTableScroll {
        height: 560px !important;
        min-height: 560px !important;
        max-height: 560px !important;

        overflow-x: auto !important;
        overflow-y: auto !important;
    }

    body.sales-page #salesTableScroll .sales-table,
    body.sales-page #salesTableScroll table {
        width: 1050px !important;
        min-width: 1050px !important;
        max-width: none !important;
    }
}

/* Маленький телефон */
@media (max-width: 430px) {
    body.sales-page #salesTableScroll {
        height: 540px !important;
        min-height: 540px !important;
        max-height: 540px !important;
    }
}

/* ===== MOBILE FIX: add-sale.html / добавление продажи ===== */

@media (max-width: 768px) {
    body.add-sale-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.add-sale-page .dashboard-page,
    body.add-sale-page .app-layout,
    body.add-sale-page .dashboard-layout,
    body.add-sale-page .page-layout,
    body.add-sale-page .layout,
    body.add-sale-page .cabinet-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    body.add-sale-page .sidebar {
        position: relative !important;
        left: auto !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: auto !important;

        padding: 22px 18px 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;

        box-sizing: border-box !important;
        overflow: visible !important;
    }

    body.add-sale-page .sidebar-logo,
    body.add-sale-page .sidebar-header {
        margin-bottom: 18px !important;
    }

    body.add-sale-page .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.add-sale-page .sidebar-nav a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;

        padding: 12px 16px !important;
        border-radius: 16px !important;

        font-size: 15px !important;
        white-space: nowrap !important;
    }

    body.add-sale-page .sidebar-nav .nav-badge,
    body.add-sale-page .sidebar-nav .badge,
    body.add-sale-page .sidebar-nav .menu-badge {
        position: static !important;
        transform: none !important;
        margin-left: 8px !important;
        flex: 0 0 auto !important;
    }

    body.add-sale-page .logout-btn,
    body.add-sale-page .sidebar-logout,
    body.add-sale-page #logoutBtn {
        width: 100% !important;
        margin-top: 14px !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
    }

    body.add-sale-page .dashboard-content,
    body.add-sale-page .main-content,
    body.add-sale-page .content,
    body.add-sale-page .page-content {
        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding: 22px 16px 36px !important;

        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.add-sale-page .dashboard-header h1,
    body.add-sale-page h1 {
        font-size: 32px !important;
        line-height: 1.05 !important;
        word-break: break-word !important;
    }

    body.add-sale-page .dashboard-card,
    body.add-sale-page .content-card,
    body.add-sale-page .card,
    body.add-sale-page .inventory-card,
    body.add-sale-page .order-card,
    body.add-sale-page .sale-card,
    body.add-sale-page form {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.add-sale-page .form-grid,
    body.add-sale-page .order-form-grid,
    body.add-sale-page .sale-form-grid,
    body.add-sale-page .modal-form-grid,
    body.add-sale-page .products-form-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.add-sale-page input,
    body.add-sale-page select,
    body.add-sale-page textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.add-sale-page button,
    body.add-sale-page .primary-btn,
    body.add-sale-page .secondary-btn,
    body.add-sale-page .sales-action-btn,
    body.add-sale-page .telegram-btn {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body.add-sale-page .inventory-table-wrapper,
    body.add-sale-page .table-wrapper,
    body.add-sale-page .table-wrap,
    body.add-sale-page .sale-items-wrapper {
        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: auto !important;

        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
    }

    body.add-sale-page table,
    body.add-sale-page .inventory-table,
    body.add-sale-page .sale-items-table {
        width: 900px !important;
        min-width: 900px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.add-sale-page table th,
    body.add-sale-page table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.add-sale-page table th:first-child,
    body.add-sale-page table td:first-child {
        width: 240px !important;
        min-width: 240px !important;
        max-width: 240px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
}

/* ===== MOBILE FIX: orders.html / учётность заказов ===== */

@media (max-width: 768px) {
    body.orders-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.orders-page .dashboard-page,
    body.orders-page .app-layout,
    body.orders-page .dashboard-layout,
    body.orders-page .page-layout,
    body.orders-page .layout,
    body.orders-page .cabinet-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    body.orders-page .sidebar {
        position: relative !important;
        left: auto !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: auto !important;

        padding: 22px 18px 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;

        box-sizing: border-box !important;
        overflow: visible !important;
    }

    body.orders-page .sidebar-logo,
    body.orders-page .sidebar-header {
        margin-bottom: 18px !important;
    }

    body.orders-page .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.orders-page .sidebar-nav a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;

        padding: 12px 16px !important;
        border-radius: 16px !important;

        font-size: 15px !important;
        white-space: nowrap !important;
    }

    body.orders-page .sidebar-nav .nav-badge,
    body.orders-page .sidebar-nav .badge,
    body.orders-page .sidebar-nav .menu-badge {
        position: static !important;
        transform: none !important;
        margin-left: 8px !important;
        flex: 0 0 auto !important;
    }

    body.orders-page .logout-btn,
    body.orders-page .sidebar-logout,
    body.orders-page #logoutBtn {
        width: 100% !important;
        margin-top: 14px !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
    }

    body.orders-page .dashboard-content,
    body.orders-page .main-content,
    body.orders-page .content,
    body.orders-page .page-content {
        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding: 22px 16px 36px !important;

        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.orders-page .dashboard-header h1,
    body.orders-page h1 {
        font-size: 32px !important;
        line-height: 1.05 !important;
        word-break: break-word !important;
    }

    body.orders-page .dashboard-card,
    body.orders-page .content-card,
    body.orders-page .card,
    body.orders-page .inventory-card,
    body.orders-page .orders-card,
    body.orders-page .order-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.orders-page .inventory-summary,
    body.orders-page .dashboard-summary,
    body.orders-page .orders-summary {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.orders-page .inventory-top,
    body.orders-page .orders-top,
    body.orders-page .card-top,
    body.orders-page .dashboard-card-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.orders-page .orders-page-actions,
    body.orders-page .inventory-actions,
    body.orders-page .page-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.orders-page .orders-page-actions a,
    body.orders-page .inventory-actions a,
    body.orders-page .page-actions a,
    body.orders-page .sales-action-btn,
    body.orders-page .primary-btn,
    body.orders-page .secondary-btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }

    body.orders-page .inventory-table-wrapper,
    body.orders-page .orders-table-wrapper,
    body.orders-page .table-wrapper,
    body.orders-page .table-wrap {
        width: 100% !important;
        max-width: 100% !important;

        height: 540px !important;
        min-height: 540px !important;
        max-height: 540px !important;

        overflow-x: auto !important;
        overflow-y: auto !important;

        padding-bottom: 12px !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.orders-page table,
    body.orders-page .inventory-table,
    body.orders-page .orders-table {
        width: 1050px !important;
        min-width: 1050px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.orders-page table th,
    body.orders-page table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.orders-page table th:first-child,
    body.orders-page table td:first-child {
        width: 180px !important;
        min-width: 180px !important;
        max-width: 180px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
}

@media (max-width: 430px) {
    body.orders-page .inventory-table-wrapper,
    body.orders-page .orders-table-wrapper,
    body.orders-page .table-wrapper,
    body.orders-page .table-wrap {
        height: 520px !important;
        min-height: 520px !important;
        max-height: 520px !important;
    }
}

/* ===== MOBILE FIX: marketplace-analytics.html / маркетплейсы ===== */

@media (max-width: 768px) {
    body.marketplace-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.marketplace-page .dashboard-page,
    body.marketplace-page .app-layout,
    body.marketplace-page .dashboard-layout,
    body.marketplace-page .page-layout,
    body.marketplace-page .layout,
    body.marketplace-page .cabinet-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    body.marketplace-page .sidebar {
        position: relative !important;
        left: auto !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: auto !important;

        padding: 22px 18px 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;

        box-sizing: border-box !important;
        overflow: visible !important;
    }

    body.marketplace-page .sidebar-logo,
    body.marketplace-page .sidebar-header {
        margin-bottom: 18px !important;
    }

    body.marketplace-page .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.marketplace-page .sidebar-nav a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;

        padding: 12px 16px !important;
        border-radius: 16px !important;

        font-size: 15px !important;
        white-space: nowrap !important;
    }

    body.marketplace-page .sidebar-nav .nav-badge,
    body.marketplace-page .sidebar-nav .badge,
    body.marketplace-page .sidebar-nav .menu-badge {
        position: static !important;
        transform: none !important;
        margin-left: 8px !important;
        flex: 0 0 auto !important;
    }

    body.marketplace-page .logout-btn,
    body.marketplace-page .sidebar-logout,
    body.marketplace-page #logoutBtn {
        width: 100% !important;
        margin-top: 14px !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
    }

    body.marketplace-page .dashboard-content,
    body.marketplace-page .main-content,
    body.marketplace-page .content,
    body.marketplace-page .page-content {
        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding: 22px 16px 36px !important;

        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.marketplace-page .dashboard-header h1,
    body.marketplace-page h1 {
        font-size: 32px !important;
        line-height: 1.05 !important;
        word-break: break-word !important;
    }

    body.marketplace-page .dashboard-card,
    body.marketplace-page .content-card,
    body.marketplace-page .card,
    body.marketplace-page .marketplace-card,
    body.marketplace-page .analytics-card,
    body.marketplace-page .inventory-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.marketplace-page .inventory-summary,
    body.marketplace-page .dashboard-summary,
    body.marketplace-page .marketplace-summary,
    body.marketplace-page .analytics-summary,
    body.marketplace-page .stats-grid,
    body.marketplace-page .cards-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.marketplace-page .inventory-top,
    body.marketplace-page .marketplace-top,
    body.marketplace-page .analytics-top,
    body.marketplace-page .card-top,
    body.marketplace-page .dashboard-card-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.marketplace-page .marketplace-actions,
    body.marketplace-page .analytics-actions,
    body.marketplace-page .inventory-actions,
    body.marketplace-page .page-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.marketplace-page .marketplace-actions a,
    body.marketplace-page .analytics-actions a,
    body.marketplace-page .inventory-actions a,
    body.marketplace-page .page-actions a,
    body.marketplace-page .primary-btn,
    body.marketplace-page .secondary-btn,
    body.marketplace-page .telegram-btn,
    body.marketplace-page button {
        max-width: 100% !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }

    body.marketplace-page input,
    body.marketplace-page select,
    body.marketplace-page textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.marketplace-page .inventory-table-wrapper,
    body.marketplace-page .marketplace-table-wrapper,
    body.marketplace-page .analytics-table-wrapper,
    body.marketplace-page .table-wrapper,
    body.marketplace-page .table-wrap {
        width: 100% !important;
        max-width: 100% !important;

        height: 540px !important;
        min-height: 540px !important;
        max-height: 540px !important;

        overflow-x: auto !important;
        overflow-y: auto !important;

        padding-bottom: 12px !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.marketplace-page table,
    body.marketplace-page .inventory-table,
    body.marketplace-page .marketplace-table,
    body.marketplace-page .analytics-table {
        width: 1050px !important;
        min-width: 1050px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.marketplace-page table th,
    body.marketplace-page table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.marketplace-page table th:first-child,
    body.marketplace-page table td:first-child {
        width: 220px !important;
        min-width: 220px !important;
        max-width: 220px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
}

@media (max-width: 430px) {
    body.marketplace-page .inventory-table-wrapper,
    body.marketplace-page .marketplace-table-wrapper,
    body.marketplace-page .analytics-table-wrapper,
    body.marketplace-page .table-wrapper,
    body.marketplace-page .table-wrap {
        height: 520px !important;
        min-height: 520px !important;
        max-height: 520px !important;
    }
}

/* ===== MOBILE FIX: place-order.html / оформление заказа ===== */

@media (max-width: 768px) {
    body.place-order-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.place-order-page .dashboard-page,
    body.place-order-page .app-layout,
    body.place-order-page .dashboard-layout,
    body.place-order-page .page-layout,
    body.place-order-page .layout,
    body.place-order-page .cabinet-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    body.place-order-page .sidebar {
        position: relative !important;
        left: auto !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: auto !important;

        padding: 22px 18px 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;

        box-sizing: border-box !important;
        overflow: visible !important;
    }

    body.place-order-page .sidebar-logo,
    body.place-order-page .sidebar-header {
        margin-bottom: 18px !important;
    }

    body.place-order-page .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.place-order-page .sidebar-nav a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;

        padding: 12px 16px !important;
        border-radius: 16px !important;

        font-size: 15px !important;
        white-space: nowrap !important;
    }

    body.place-order-page .sidebar-nav .nav-badge,
    body.place-order-page .sidebar-nav .badge,
    body.place-order-page .sidebar-nav .menu-badge {
        position: static !important;
        transform: none !important;
        margin-left: 8px !important;
        flex: 0 0 auto !important;
    }

    body.place-order-page .logout-btn,
    body.place-order-page .sidebar-logout,
    body.place-order-page #logoutBtn {
        width: 100% !important;
        margin-top: 14px !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
    }

    body.place-order-page .dashboard-content,
    body.place-order-page .main-content,
    body.place-order-page .content,
    body.place-order-page .page-content {
        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding: 22px 16px 36px !important;

        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.place-order-page .dashboard-header,
    body.place-order-page .inventory-top,
    body.place-order-page .order-top,
    body.place-order-page .card-top {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.place-order-page .dashboard-header h1,
    body.place-order-page h1 {
        font-size: 32px !important;
        line-height: 1.05 !important;
        word-break: break-word !important;
    }

    body.place-order-page .dashboard-card,
    body.place-order-page .content-card,
    body.place-order-page .card,
    body.place-order-page .order-card,
    body.place-order-page form {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.place-order-page .form-grid,
    body.place-order-page .order-form-grid,
    body.place-order-page .modal-form-grid,
    body.place-order-page .products-form-grid,
    body.place-order-page .marketplace-form-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.place-order-page label,
    body.place-order-page input,
    body.place-order-page select,
    body.place-order-page textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.place-order-page button,
    body.place-order-page .primary-btn,
    body.place-order-page .secondary-btn,
    body.place-order-page .telegram-btn {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body.place-order-page .form-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.place-order-page .form-actions button,
    body.place-order-page .form-actions a {
        width: 100% !important;
        max-width: 100% !important;
    }

    body.place-order-page .inventory-table-wrapper,
    body.place-order-page .order-table-wrapper,
    body.place-order-page .table-wrapper,
    body.place-order-page .table-wrap {
        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: auto !important;

        padding-bottom: 12px !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.place-order-page table,
    body.place-order-page .inventory-table,
    body.place-order-page .order-table {
        width: 950px !important;
        min-width: 950px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.place-order-page table th,
    body.place-order-page table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.place-order-page table th:first-child,
    body.place-order-page table td:first-child {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
}

/* ===== MOBILE FIX: my-orders.html / мои заявки ===== */

@media (max-width: 768px) {
    body.my-orders-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.my-orders-page .dashboard-page,
    body.my-orders-page .app-layout,
    body.my-orders-page .dashboard-layout,
    body.my-orders-page .page-layout,
    body.my-orders-page .layout,
    body.my-orders-page .cabinet-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    body.my-orders-page .sidebar {
        position: relative !important;
        left: auto !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: auto !important;

        padding: 22px 18px 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;

        box-sizing: border-box !important;
        overflow: visible !important;
    }

    body.my-orders-page .sidebar-logo,
    body.my-orders-page .sidebar-header {
        margin-bottom: 18px !important;
    }

    body.my-orders-page .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.my-orders-page .sidebar-nav a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;

        padding: 12px 16px !important;
        border-radius: 16px !important;

        font-size: 15px !important;
        white-space: nowrap !important;
    }

    body.my-orders-page .sidebar-nav .nav-badge,
    body.my-orders-page .sidebar-nav .badge,
    body.my-orders-page .sidebar-nav .menu-badge {
        position: static !important;
        transform: none !important;
        margin-left: 8px !important;
        flex: 0 0 auto !important;
    }

    body.my-orders-page .logout-btn,
    body.my-orders-page .sidebar-logout,
    body.my-orders-page #logoutBtn {
        width: 100% !important;
        margin-top: 14px !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
    }

    body.my-orders-page .dashboard-content,
    body.my-orders-page .main-content,
    body.my-orders-page .content,
    body.my-orders-page .page-content {
        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding: 22px 16px 36px !important;

        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.my-orders-page .dashboard-header,
    body.my-orders-page .my-orders-header,
    body.my-orders-page .orders-header,
    body.my-orders-page .card-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.my-orders-page .dashboard-header h1,
    body.my-orders-page h1 {
        font-size: 32px !important;
        line-height: 1.05 !important;
        word-break: break-word !important;
    }

    body.my-orders-page .dashboard-card,
    body.my-orders-page .content-card,
    body.my-orders-page .card,
    body.my-orders-page .my-orders-card,
    body.my-orders-page .orders-card,
    body.my-orders-page .order-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.my-orders-page .my-orders-filters,
    body.my-orders-page .orders-filters,
    body.my-orders-page .filters-row,
    body.my-orders-page .page-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.my-orders-page input,
    body.my-orders-page select,
    body.my-orders-page textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.my-orders-page button,
    body.my-orders-page .primary-btn,
    body.my-orders-page .secondary-btn,
    body.my-orders-page .telegram-btn {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body.my-orders-page .my-orders-list,
    body.my-orders-page .client-orders-list,
    body.my-orders-page #myOrdersList {
        width: 100% !important;
        max-width: 100% !important;

        max-height: 560px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;

        padding-right: 6px !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.my-orders-page .my-order-card,
    body.my-orders-page .order-item,
    body.my-orders-page .client-order-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.my-orders-page .my-order-card *,
    body.my-orders-page .order-item *,
    body.my-orders-page .client-order-card * {
        max-width: 100% !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    body.my-orders-page .inventory-table-wrapper,
    body.my-orders-page .orders-table-wrapper,
    body.my-orders-page .table-wrapper,
    body.my-orders-page .table-wrap {
        width: 100% !important;
        max-width: 100% !important;

        height: 540px !important;
        min-height: 540px !important;
        max-height: 540px !important;

        overflow-x: auto !important;
        overflow-y: auto !important;

        padding-bottom: 12px !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.my-orders-page table,
    body.my-orders-page .inventory-table,
    body.my-orders-page .orders-table {
        width: 1050px !important;
        min-width: 1050px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.my-orders-page table th,
    body.my-orders-page table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.my-orders-page table th:first-child,
    body.my-orders-page table td:first-child {
        width: 240px !important;
        min-width: 240px !important;
        max-width: 240px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
}

@media (max-width: 430px) {
    body.my-orders-page .my-orders-list,
    body.my-orders-page .client-orders-list,
    body.my-orders-page #myOrdersList {
        max-height: 520px !important;
    }

    body.my-orders-page .inventory-table-wrapper,
    body.my-orders-page .orders-table-wrapper,
    body.my-orders-page .table-wrapper,
    body.my-orders-page .table-wrap {
        height: 520px !important;
        min-height: 520px !important;
        max-height: 520px !important;
    }
}

/* ===== HEIGHT FIX: my-orders.html — список заявок выше ===== */

/* Компьютер */
body.my-orders-page .my-orders-card {
    min-height: 760px !important;
    height: auto !important;

    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

body.my-orders-page #myOrdersList,
body.my-orders-page .my-orders-list,
body.my-orders-page .client-orders-list {
    height: 620px !important;
    min-height: 620px !important;
    max-height: 620px !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    padding-right: 8px !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Планшеты */
@media (max-width: 1024px) {
    body.my-orders-page .my-orders-card {
        min-height: 720px !important;
    }

    body.my-orders-page #myOrdersList,
    body.my-orders-page .my-orders-list,
    body.my-orders-page .client-orders-list {
        height: 600px !important;
        min-height: 600px !important;
        max-height: 600px !important;
    }
}

/* Телефоны */
@media (max-width: 768px) {
    body.my-orders-page .my-orders-card {
        min-height: 700px !important;
    }

    body.my-orders-page #myOrdersList,
    body.my-orders-page .my-orders-list,
    body.my-orders-page .client-orders-list {
        height: 560px !important;
        min-height: 560px !important;
        max-height: 560px !important;

        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
}

/* Маленькие телефоны */
@media (max-width: 430px) {
    body.my-orders-page .my-orders-card {
        min-height: 690px !important;
    }

    body.my-orders-page #myOrdersList,
    body.my-orders-page .my-orders-list,
    body.my-orders-page .client-orders-list {
        height: 540px !important;
        min-height: 540px !important;
        max-height: 540px !important;
    }
}

/* ===== MOBILE FIX: accounting.html / бухгалтерия ===== */

@media (max-width: 768px) {
    body.accounting-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.accounting-page .dashboard-page,
    body.accounting-page .app-layout,
    body.accounting-page .dashboard-layout,
    body.accounting-page .page-layout,
    body.accounting-page .layout,
    body.accounting-page .cabinet-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    body.accounting-page .sidebar {
        position: relative !important;
        left: auto !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: auto !important;

        padding: 22px 18px 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;

        box-sizing: border-box !important;
        overflow: visible !important;
    }

    body.accounting-page .sidebar-logo,
    body.accounting-page .sidebar-header {
        margin-bottom: 18px !important;
    }

    body.accounting-page .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.accounting-page .sidebar-nav a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;

        padding: 12px 16px !important;
        border-radius: 16px !important;

        font-size: 15px !important;
        white-space: nowrap !important;
    }

    body.accounting-page .sidebar-nav .nav-badge,
    body.accounting-page .sidebar-nav .badge,
    body.accounting-page .sidebar-nav .menu-badge {
        position: static !important;
        transform: none !important;
        margin-left: 8px !important;
        flex: 0 0 auto !important;
    }

    body.accounting-page .logout-btn,
    body.accounting-page .sidebar-logout,
    body.accounting-page #logoutBtn {
        width: 100% !important;
        margin-top: 14px !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
    }

    body.accounting-page .dashboard-content,
    body.accounting-page .main-content,
    body.accounting-page .content,
    body.accounting-page .page-content {
        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding: 22px 16px 36px !important;

        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.accounting-page .dashboard-header,
    body.accounting-page .accounting-header,
    body.accounting-page .card-header,
    body.accounting-page .accounting-top {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.accounting-page .dashboard-header h1,
    body.accounting-page h1 {
        font-size: 32px !important;
        line-height: 1.05 !important;
        word-break: break-word !important;
    }

    body.accounting-page .dashboard-card,
    body.accounting-page .content-card,
    body.accounting-page .card,
    body.accounting-page .accounting-card,
    body.accounting-page .finance-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.accounting-page .stats-grid,
    body.accounting-page .accounting-stats,
    body.accounting-page .accounting-summary,
    body.accounting-page .summary-grid,
    body.accounting-page .dashboard-summary {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.accounting-page .accounting-actions,
    body.accounting-page .page-actions,
    body.accounting-page .card-actions,
    body.accounting-page .finance-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.accounting-page .accounting-actions a,
    body.accounting-page .accounting-actions button,
    body.accounting-page .page-actions a,
    body.accounting-page .page-actions button,
    body.accounting-page .primary-btn,
    body.accounting-page .secondary-btn,
    body.accounting-page .telegram-btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }

    body.accounting-page input,
    body.accounting-page select,
    body.accounting-page textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.accounting-page .form-grid,
    body.accounting-page .accounting-form-grid,
    body.accounting-page .modal-form-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.accounting-page .inventory-table-wrapper,
    body.accounting-page .accounting-table-wrapper,
    body.accounting-page .finance-table-wrapper,
    body.accounting-page .table-wrapper,
    body.accounting-page .table-wrap {
        width: 100% !important;
        max-width: 100% !important;

        height: 540px !important;
        min-height: 540px !important;
        max-height: 540px !important;

        overflow-x: auto !important;
        overflow-y: auto !important;

        padding-bottom: 12px !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.accounting-page table,
    body.accounting-page .inventory-table,
    body.accounting-page .accounting-table,
    body.accounting-page .finance-table {
        width: 1050px !important;
        min-width: 1050px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.accounting-page table th,
    body.accounting-page table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.accounting-page table th:first-child,
    body.accounting-page table td:first-child {
        width: 160px !important;
        min-width: 160px !important;
        max-width: 160px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    body.accounting-page table th:nth-child(2),
    body.accounting-page table td:nth-child(2) {
        width: 180px !important;
        min-width: 180px !important;
        max-width: 180px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
}

@media (max-width: 430px) {
    body.accounting-page .inventory-table-wrapper,
    body.accounting-page .accounting-table-wrapper,
    body.accounting-page .finance-table-wrapper,
    body.accounting-page .table-wrapper,
    body.accounting-page .table-wrap {
        height: 520px !important;
        min-height: 520px !important;
        max-height: 520px !important;
    }
}

/* ===== MOBILE FIX: admin-orders.html / заявки клиентов ===== */

@media (max-width: 768px) {
    body.admin-orders-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.admin-orders-page .dashboard-page,
    body.admin-orders-page .app-layout,
    body.admin-orders-page .dashboard-layout,
    body.admin-orders-page .page-layout,
    body.admin-orders-page .layout,
    body.admin-orders-page .cabinet-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    body.admin-orders-page .sidebar {
        position: relative !important;
        left: auto !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: auto !important;

        padding: 22px 18px 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;

        box-sizing: border-box !important;
        overflow: visible !important;
    }

    body.admin-orders-page .sidebar-logo,
    body.admin-orders-page .sidebar-header {
        margin-bottom: 18px !important;
    }

    body.admin-orders-page .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.admin-orders-page .sidebar-nav a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;

        padding: 12px 16px !important;
        border-radius: 16px !important;

        font-size: 15px !important;
        white-space: nowrap !important;
    }

    body.admin-orders-page .sidebar-nav .nav-badge,
    body.admin-orders-page .sidebar-nav .badge,
    body.admin-orders-page .sidebar-nav .menu-badge {
        position: static !important;
        transform: none !important;
        margin-left: 8px !important;
        flex: 0 0 auto !important;
    }

    body.admin-orders-page .logout-btn,
    body.admin-orders-page .sidebar-logout,
    body.admin-orders-page #logoutBtn {
        width: 100% !important;
        margin-top: 14px !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
    }

    body.admin-orders-page .dashboard-content,
    body.admin-orders-page .main-content,
    body.admin-orders-page .content,
    body.admin-orders-page .page-content {
        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding: 22px 16px 36px !important;

        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.admin-orders-page .dashboard-header,
    body.admin-orders-page .admin-orders-header,
    body.admin-orders-page .orders-header,
    body.admin-orders-page .card-header,
    body.admin-orders-page .orders-top {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.admin-orders-page .dashboard-header h1,
    body.admin-orders-page h1 {
        font-size: 32px !important;
        line-height: 1.05 !important;
        word-break: break-word !important;
    }

    body.admin-orders-page .dashboard-card,
    body.admin-orders-page .content-card,
    body.admin-orders-page .card,
    body.admin-orders-page .admin-orders-card,
    body.admin-orders-page .orders-card,
    body.admin-orders-page .order-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.admin-orders-page .stats-grid,
    body.admin-orders-page .dashboard-summary,
    body.admin-orders-page .orders-summary,
    body.admin-orders-page .admin-orders-summary {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.admin-orders-page .filters-row,
    body.admin-orders-page .orders-filters,
    body.admin-orders-page .admin-orders-filters,
    body.admin-orders-page .page-actions,
    body.admin-orders-page .card-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.admin-orders-page input,
    body.admin-orders-page select,
    body.admin-orders-page textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.admin-orders-page button,
    body.admin-orders-page .primary-btn,
    body.admin-orders-page .secondary-btn,
    body.admin-orders-page .telegram-btn {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body.admin-orders-page .inventory-table-wrapper,
    body.admin-orders-page .orders-table-wrapper,
    body.admin-orders-page .admin-orders-table-wrapper,
    body.admin-orders-page .table-wrapper,
    body.admin-orders-page .table-wrap {
        width: 100% !important;
        max-width: 100% !important;

        height: 560px !important;
        min-height: 560px !important;
        max-height: 560px !important;

        overflow-x: auto !important;
        overflow-y: auto !important;

        padding-bottom: 12px !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.admin-orders-page table,
    body.admin-orders-page .inventory-table,
    body.admin-orders-page .orders-table,
    body.admin-orders-page .admin-orders-table {
        width: 1200px !important;
        min-width: 1200px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.admin-orders-page table th,
    body.admin-orders-page table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.admin-orders-page table th:first-child,
    body.admin-orders-page table td:first-child {
        width: 140px !important;
        min-width: 140px !important;
        max-width: 140px !important;
    }

    body.admin-orders-page table th:nth-child(2),
    body.admin-orders-page table td:nth-child(2) {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    body.admin-orders-page .modal,
    body.admin-orders-page .modal-content,
    body.admin-orders-page .order-details-modal,
    body.admin-orders-page .admin-modal {
        max-width: calc(100vw - 24px) !important;
        width: calc(100vw - 24px) !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.admin-orders-page .modal-body,
    body.admin-orders-page .order-details-body {
        max-height: 75vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

@media (max-width: 430px) {
    body.admin-orders-page .inventory-table-wrapper,
    body.admin-orders-page .orders-table-wrapper,
    body.admin-orders-page .admin-orders-table-wrapper,
    body.admin-orders-page .table-wrapper,
    body.admin-orders-page .table-wrap {
        height: 540px !important;
        min-height: 540px !important;
        max-height: 540px !important;
    }
}

/* ===== MOBILE FIX: payment-orders.html / ожидают оплаты ===== */

@media (max-width: 768px) {
    body.payment-orders-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.payment-orders-page .dashboard-page,
    body.payment-orders-page .app-layout,
    body.payment-orders-page .dashboard-layout,
    body.payment-orders-page .page-layout,
    body.payment-orders-page .layout,
    body.payment-orders-page .cabinet-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    body.payment-orders-page .sidebar {
        position: relative !important;
        left: auto !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: auto !important;

        padding: 22px 18px 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;

        box-sizing: border-box !important;
        overflow: visible !important;
    }

    body.payment-orders-page .sidebar-logo,
    body.payment-orders-page .sidebar-header {
        margin-bottom: 18px !important;
    }

    body.payment-orders-page .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.payment-orders-page .sidebar-nav a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;

        padding: 12px 16px !important;
        border-radius: 16px !important;

        font-size: 15px !important;
        white-space: nowrap !important;
    }

    body.payment-orders-page .sidebar-nav .nav-badge,
    body.payment-orders-page .sidebar-nav .badge,
    body.payment-orders-page .sidebar-nav .menu-badge {
        position: static !important;
        transform: none !important;
        margin-left: 8px !important;
        flex: 0 0 auto !important;
    }

    body.payment-orders-page .logout-btn,
    body.payment-orders-page .sidebar-logout,
    body.payment-orders-page #logoutBtn {
        width: 100% !important;
        margin-top: 14px !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
    }

    body.payment-orders-page .dashboard-content,
    body.payment-orders-page .main-content,
    body.payment-orders-page .content,
    body.payment-orders-page .page-content {
        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding: 22px 16px 36px !important;

        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.payment-orders-page .dashboard-header,
    body.payment-orders-page .payment-orders-header,
    body.payment-orders-page .orders-header,
    body.payment-orders-page .card-header,
    body.payment-orders-page .orders-top {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.payment-orders-page h1,
    body.payment-orders-page .dashboard-header h1 {
        font-size: 32px !important;
        line-height: 1.05 !important;
        word-break: break-word !important;
    }

    body.payment-orders-page .dashboard-card,
    body.payment-orders-page .content-card,
    body.payment-orders-page .card,
    body.payment-orders-page .payment-orders-card,
    body.payment-orders-page .orders-card,
    body.payment-orders-page .order-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.payment-orders-page .stats-grid,
    body.payment-orders-page .dashboard-summary,
    body.payment-orders-page .orders-summary,
    body.payment-orders-page .payment-orders-summary {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.payment-orders-page .filters-row,
    body.payment-orders-page .orders-filters,
    body.payment-orders-page .payment-orders-filters,
    body.payment-orders-page .page-actions,
    body.payment-orders-page .card-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.payment-orders-page input,
    body.payment-orders-page select,
    body.payment-orders-page textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.payment-orders-page button,
    body.payment-orders-page .primary-btn,
    body.payment-orders-page .secondary-btn,
    body.payment-orders-page .telegram-btn {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body.payment-orders-page .inventory-table-wrapper,
    body.payment-orders-page .orders-table-wrapper,
    body.payment-orders-page .payment-orders-table-wrapper,
    body.payment-orders-page .table-wrapper,
    body.payment-orders-page .table-wrap {
        width: 100% !important;
        max-width: 100% !important;

        height: 560px !important;
        min-height: 560px !important;
        max-height: 560px !important;

        overflow-x: auto !important;
        overflow-y: auto !important;

        padding-bottom: 12px !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.payment-orders-page table,
    body.payment-orders-page .inventory-table,
    body.payment-orders-page .orders-table,
    body.payment-orders-page .payment-orders-table {
        width: 1200px !important;
        min-width: 1200px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.payment-orders-page table th,
    body.payment-orders-page table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.payment-orders-page table th:first-child,
    body.payment-orders-page table td:first-child {
        width: 140px !important;
        min-width: 140px !important;
        max-width: 140px !important;
    }

    body.payment-orders-page table th:nth-child(2),
    body.payment-orders-page table td:nth-child(2) {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    body.payment-orders-page .modal,
    body.payment-orders-page .modal-content,
    body.payment-orders-page .order-details-modal,
    body.payment-orders-page .payment-modal {
        max-width: calc(100vw - 24px) !important;
        width: calc(100vw - 24px) !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.payment-orders-page .modal-body,
    body.payment-orders-page .order-details-body {
        max-height: 75vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

@media (max-width: 430px) {
    body.payment-orders-page .inventory-table-wrapper,
    body.payment-orders-page .orders-table-wrapper,
    body.payment-orders-page .payment-orders-table-wrapper,
    body.payment-orders-page .table-wrapper,
    body.payment-orders-page .table-wrap {
        height: 540px !important;
        min-height: 540px !important;
        max-height: 540px !important;
    }
}

/* ===== MOBILE FIX: imeis.html / имейки ===== */

@media (max-width: 768px) {
    body.imeis-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.imeis-page .dashboard-page,
    body.imeis-page .app-layout,
    body.imeis-page .dashboard-layout,
    body.imeis-page .page-layout,
    body.imeis-page .layout,
    body.imeis-page .cabinet-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    body.imeis-page .sidebar {
        position: relative !important;
        left: auto !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: auto !important;

        padding: 22px 18px 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;

        box-sizing: border-box !important;
        overflow: visible !important;
    }

    body.imeis-page .sidebar-logo,
    body.imeis-page .sidebar-header {
        margin-bottom: 18px !important;
    }

    body.imeis-page .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.imeis-page .sidebar-nav a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;

        padding: 12px 16px !important;
        border-radius: 16px !important;

        font-size: 15px !important;
        white-space: nowrap !important;
    }

    body.imeis-page .sidebar-nav .nav-badge,
    body.imeis-page .sidebar-nav .badge,
    body.imeis-page .sidebar-nav .menu-badge {
        position: static !important;
        transform: none !important;
        margin-left: 8px !important;
        flex: 0 0 auto !important;
    }

    body.imeis-page .logout-btn,
    body.imeis-page .sidebar-logout,
    body.imeis-page #logoutBtn {
        width: 100% !important;
        margin-top: 14px !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
    }

    body.imeis-page .dashboard-content,
    body.imeis-page .main-content,
    body.imeis-page .content,
    body.imeis-page .page-content {
        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding: 22px 16px 36px !important;

        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.imeis-page .dashboard-header,
    body.imeis-page .imeis-header,
    body.imeis-page .card-header,
    body.imeis-page .orders-top,
    body.imeis-page .page-top {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.imeis-page h1,
    body.imeis-page .dashboard-header h1 {
        font-size: 32px !important;
        line-height: 1.05 !important;
        word-break: break-word !important;
    }

    body.imeis-page .dashboard-card,
    body.imeis-page .content-card,
    body.imeis-page .card,
    body.imeis-page .imeis-card,
    body.imeis-page .orders-card,
    body.imeis-page .order-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.imeis-page .stats-grid,
    body.imeis-page .dashboard-summary,
    body.imeis-page .imeis-summary,
    body.imeis-page .orders-summary {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.imeis-page .filters-row,
    body.imeis-page .imeis-filters,
    body.imeis-page .orders-filters,
    body.imeis-page .page-actions,
    body.imeis-page .card-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.imeis-page input,
    body.imeis-page select,
    body.imeis-page textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.imeis-page button,
    body.imeis-page .primary-btn,
    body.imeis-page .secondary-btn,
    body.imeis-page .telegram-btn {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body.imeis-page .inventory-table-wrapper,
    body.imeis-page .imeis-table-wrapper,
    body.imeis-page .orders-table-wrapper,
    body.imeis-page .table-wrapper,
    body.imeis-page .table-wrap {
        width: 100% !important;
        max-width: 100% !important;

        height: 560px !important;
        min-height: 560px !important;
        max-height: 560px !important;

        overflow-x: auto !important;
        overflow-y: auto !important;

        padding-bottom: 12px !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.imeis-page table,
    body.imeis-page .inventory-table,
    body.imeis-page .imeis-table,
    body.imeis-page .orders-table {
        width: 1200px !important;
        min-width: 1200px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.imeis-page table th,
    body.imeis-page table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.imeis-page table th:first-child,
    body.imeis-page table td:first-child {
        width: 160px !important;
        min-width: 160px !important;
        max-width: 160px !important;
    }

    body.imeis-page table th:nth-child(2),
    body.imeis-page table td:nth-child(2) {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    body.imeis-page .modal,
    body.imeis-page .modal-content,
    body.imeis-page .imeis-modal,
    body.imeis-page .order-details-modal {
        max-width: calc(100vw - 24px) !important;
        width: calc(100vw - 24px) !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.imeis-page .modal-body,
    body.imeis-page .order-details-body {
        max-height: 75vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

@media (max-width: 430px) {
    body.imeis-page .inventory-table-wrapper,
    body.imeis-page .imeis-table-wrapper,
    body.imeis-page .orders-table-wrapper,
    body.imeis-page .table-wrapper,
    body.imeis-page .table-wrap {
        height: 540px !important;
        min-height: 540px !important;
        max-height: 540px !important;
    }
}

/* ===== MOBILE FIX: shipping-orders.html / ожидают отправки ===== */

@media (max-width: 768px) {
    body.shipping-orders-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.shipping-orders-page .dashboard-page,
    body.shipping-orders-page .app-layout,
    body.shipping-orders-page .dashboard-layout,
    body.shipping-orders-page .page-layout,
    body.shipping-orders-page .layout,
    body.shipping-orders-page .cabinet-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden !important;
    }

    body.shipping-orders-page .sidebar {
        position: relative !important;
        left: auto !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        min-height: auto !important;

        padding: 22px 18px 14px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;

        box-sizing: border-box !important;
        overflow: visible !important;
    }

    body.shipping-orders-page .sidebar-logo,
    body.shipping-orders-page .sidebar-header {
        margin-bottom: 18px !important;
    }

    body.shipping-orders-page .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding-bottom: 8px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.shipping-orders-page .sidebar-nav a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;

        padding: 12px 16px !important;
        border-radius: 16px !important;

        font-size: 15px !important;
        white-space: nowrap !important;
    }

    body.shipping-orders-page .sidebar-nav .nav-badge,
    body.shipping-orders-page .sidebar-nav .badge,
    body.shipping-orders-page .sidebar-nav .menu-badge {
        position: static !important;
        transform: none !important;
        margin-left: 8px !important;
        flex: 0 0 auto !important;
    }

    body.shipping-orders-page .logout-btn,
    body.shipping-orders-page .sidebar-logout,
    body.shipping-orders-page #logoutBtn {
        width: 100% !important;
        margin-top: 14px !important;
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
    }

    body.shipping-orders-page .dashboard-content,
    body.shipping-orders-page .main-content,
    body.shipping-orders-page .content,
    body.shipping-orders-page .page-content {
        width: 100% !important;
        max-width: 100% !important;

        margin-left: 0 !important;
        padding: 22px 16px 36px !important;

        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.shipping-orders-page .dashboard-header,
    body.shipping-orders-page .shipping-orders-header,
    body.shipping-orders-page .orders-header,
    body.shipping-orders-page .card-header,
    body.shipping-orders-page .orders-top {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.shipping-orders-page h1,
    body.shipping-orders-page .dashboard-header h1 {
        font-size: 32px !important;
        line-height: 1.05 !important;
        word-break: break-word !important;
    }

    body.shipping-orders-page .dashboard-card,
    body.shipping-orders-page .content-card,
    body.shipping-orders-page .card,
    body.shipping-orders-page .shipping-orders-card,
    body.shipping-orders-page .orders-card,
    body.shipping-orders-page .order-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    body.shipping-orders-page .stats-grid,
    body.shipping-orders-page .dashboard-summary,
    body.shipping-orders-page .orders-summary,
    body.shipping-orders-page .shipping-orders-summary {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.shipping-orders-page .filters-row,
    body.shipping-orders-page .orders-filters,
    body.shipping-orders-page .shipping-orders-filters,
    body.shipping-orders-page .page-actions,
    body.shipping-orders-page .card-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    body.shipping-orders-page input,
    body.shipping-orders-page select,
    body.shipping-orders-page textarea {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.shipping-orders-page button,
    body.shipping-orders-page .primary-btn,
    body.shipping-orders-page .secondary-btn,
    body.shipping-orders-page .telegram-btn {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body.shipping-orders-page .inventory-table-wrapper,
    body.shipping-orders-page .orders-table-wrapper,
    body.shipping-orders-page .shipping-orders-table-wrapper,
    body.shipping-orders-page .table-wrapper,
    body.shipping-orders-page .table-wrap {
        width: 100% !important;
        max-width: 100% !important;

        height: 560px !important;
        min-height: 560px !important;
        max-height: 560px !important;

        overflow-x: auto !important;
        overflow-y: auto !important;

        padding-bottom: 12px !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    body.shipping-orders-page table,
    body.shipping-orders-page .inventory-table,
    body.shipping-orders-page .orders-table,
    body.shipping-orders-page .shipping-orders-table {
        width: 1200px !important;
        min-width: 1200px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    body.shipping-orders-page table th,
    body.shipping-orders-page table td {
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    body.shipping-orders-page table th:first-child,
    body.shipping-orders-page table td:first-child {
        width: 140px !important;
        min-width: 140px !important;
        max-width: 140px !important;
    }

    body.shipping-orders-page table th:nth-child(2),
    body.shipping-orders-page table td:nth-child(2) {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    body.shipping-orders-page .modal,
    body.shipping-orders-page .modal-content,
    body.shipping-orders-page .order-details-modal,
    body.shipping-orders-page .shipping-modal {
        max-width: calc(100vw - 24px) !important;
        width: calc(100vw - 24px) !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    body.shipping-orders-page .modal-body,
    body.shipping-orders-page .order-details-body {
        max-height: 75vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

@media (max-width: 430px) {
    body.shipping-orders-page .inventory-table-wrapper,
    body.shipping-orders-page .orders-table-wrapper,
    body.shipping-orders-page .shipping-orders-table-wrapper,
    body.shipping-orders-page .table-wrapper,
    body.shipping-orders-page .table-wrap {
        height: 540px !important;
        min-height: 540px !important;
        max-height: 540px !important;
    }
}

/* ===== Карточки быстрых разделов на dashboard ===== */

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 28px;
    margin-bottom: 28px;
}

.dashboard-action-card {
    display: block;
    padding: 24px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid #d9e3f0;
    text-decoration: none;
    color: #0f172a;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
    transition: 0.18s ease;
}

.dashboard-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.dashboard-action-card span {
    display: block;
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 8px;
    color: #0f172a;
}

.dashboard-action-card small {
    display: block;
    color: #64748b;
    font-size: 15px;
    line-height: 1.45;
}
/* ===== Stage 2: скрываем поставщицкие разделы от региональных клиентов ===== */
body.is-region-user .dashboard-action-card[href="supplier-clients.html"],
body.is-region-user .dashboard-action-card[href="admin-orders.html"],
body.is-region-user .dashboard-action-card[href="payment-orders.html"],
body.is-region-user .dashboard-action-card[href="imeis.html"],
body.is-region-user .dashboard-action-card[href="shipping-orders.html"],
body.is-region-user .sidebar-nav a[href="supplier-clients.html"],
body.is-region-user .sidebar-nav a[href="admin-orders.html"],
body.is-region-user .sidebar-nav a[href="payment-orders.html"],
body.is-region-user .sidebar-nav a[href="imeis.html"],
body.is-region-user .sidebar-nav a[href="shipping-orders.html"] {
    display: none !important;
}

/* =========================================================
   PLATFORM STAGE 3 — выкуп по заявкам региональных клиентов
   ========================================================= */
.regional-procurement-box {
    margin: 16px 0 !important;
    padding: 18px !important;
    border: 1px solid #d9e3f0 !important;
    border-radius: 20px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
}

.regional-procurement-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
}

.regional-procurement-head strong {
    color: #0f172a !important;
    font-size: 17px !important;
    font-weight: 900 !important;
}

.regional-procurement-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

.regional-procurement-grid p {
    margin: 0 !important;
    padding: 12px !important;
    border-radius: 14px !important;
    background: #f1f6fc !important;
    border: 1px solid #e1eaf5 !important;
}

.regional-procurement-grid span {
    display: block !important;
    margin-bottom: 5px !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
}

.regional-procurement-grid strong {
    display: block !important;
    color: #0f172a !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
}

.regional-procurement-note,
.regional-procurement-warning,
.regional-procurement-success {
    margin: 14px 0 0 !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    font-weight: 800 !important;
    line-height: 1.4 !important;
}

.regional-procurement-note {
    background: #eef4fb !important;
    color: #475569 !important;
}

.regional-procurement-warning {
    background: #fff7ed !important;
    color: #c2410c !important;
}

.regional-procurement-success {
    background: #ecfdf3 !important;
    color: #15803d !important;
}

.regional-procurement-btn {
    margin-top: 14px !important;
    min-width: 190px !important;
}

@media (max-width: 1000px) {
    .regional-procurement-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .regional-procurement-head {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .regional-procurement-grid {
        grid-template-columns: 1fr !important;
    }

    .regional-procurement-btn {
        width: 100% !important;
    }
}

/* ===== Stage 4: отдельный региональный склад поставщика ===== */
body.is-region-user .dashboard-action-card[href="supplier-regional-inventory.html"],
body.is-region-user .sidebar-nav a[href="supplier-regional-inventory.html"] {
    display: none !important;
}

body.is-internal-market-only .sidebar-nav a[href="supplier-regional-inventory.html"] {
    display: block;
}

/* ===== Stage 6: IMEI / отправка / закрытие сделки ===== */
.imei-product-row small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.35;
}

.imei-external-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 18px 0 8px;
    padding: 14px 16px;
    border: 1px solid #d9e4f2;
    border-radius: 14px;
    background: #f5f9ff;
    cursor: pointer;
}
.imei-external-toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: #0d6efd; }
.imei-external-toggle span { display: flex; flex-direction: column; gap: 3px; }
.imei-external-toggle small { color: #64748b; font-size: 13px; }
.imei-external-warning { margin: 0 0 14px; color: #64748b; font-size: 13px; }
.imei-stock-select, .imei-external-input { width: 100%; min-height: 48px; }

.imei-source-note {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #eef6ff;
    color: #334155;
    border: 1px solid #d8eaff;
    font-size: 14px;
}

.shipping-product-imeis {
    margin-top: 10px;
    color: #475569;
    font-size: 14px;
    line-height: 1.45;
}

.shipping-product-imeis span {
    display: inline-flex;
    margin: 4px 6px 0 0;
    padding: 5px 8px;
    border-radius: 999px;
    background: #eef6ff;
    border: 1px solid #d8eaff;
    color: #1e3a8a;
    font-weight: 800;
}

/* =========================================================
   STAGE 10: кабинет регионального клиента
   ========================================================= */
.client-order-progress-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.client-order-progress-grid div {
    background: #f8fbff;
    border: 1px solid #e2eaf5;
    border-radius: 16px;
    padding: 12px;
}

.client-order-progress-grid span,
.client-price-stat span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.client-order-progress-grid strong {
    color: #0f172a;
    font-size: 18px;
    font-weight: 900;
}

.client-order-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 16px;
}

.client-order-status-row span,
.client-order-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
    background: #eef6ff;
    color: #1663d8;
    border: 1px solid #d8eaff;
    font-size: 13px;
    font-weight: 900;
}

.client-order-details-panel {
    background: #ffffff;
    border: 1px solid #d9e3f0;
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 16px;
}

.client-order-details-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.client-order-details-head h3 {
    margin: 4px 0 6px;
    color: #0f172a;
    font-size: 24px;
}

.client-order-payments-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.client-order-payment-row {
    border: 1px solid #e2eaf5;
    background: #f8fbff;
    border-radius: 16px;
    padding: 12px;
}

.client-order-payment-row div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.client-order-payment-row span,
.client-order-payment-row p,
.client-fulfillment-note,
.client-imei-empty {
    color: #64748b;
    margin: 4px 0 0;
    font-size: 14px;
}

.client-product-fulfillment {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #edf2f7;
}

.client-imei-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.client-imei-list span {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-weight: 800;
}

@media (max-width: 700px) {
    .client-order-progress-grid {
        grid-template-columns: 1fr;
    }

    .client-order-details-head {
        flex-direction: column;
    }
}

/* ===== JD Group stage 13.6: контекстное меню сообщений ===== */
.jd-chat-context-menu {
    position: fixed;
    z-index: 99999;
    min-width: 190px;
    padding: 8px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.jd-chat-context-menu button {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    font: inherit;
    color: #111827;
    cursor: pointer;
}

.jd-chat-context-menu button:hover {
    background: rgba(37, 99, 235, 0.08);
}

.chat-message.is-deleted .chat-message-text {
    font-style: italic;
    opacity: 0.72;
}

.chat-message.is-edited:not(.is-deleted) .chat-message-meta {
    opacity: 0.95;
}

/* ===== 15.88.2: главная страница по ролям и реальные Telegram-контакты ===== */
body.dashboard-admin-clean .dashboard-grid,
body.dashboard-admin-clean #telegram,
body.dashboard-admin-clean #managers {
    display: none !important;
}

body.dashboard-regional-clean #balance,
body.dashboard-regional-clean #debt {
    display: none !important;
}

body.dashboard-regional-clean .dashboard-grid,
body.dashboard-supplier-clean .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

body.dashboard-regional-clean .dashboard-grid > .dashboard-card,
body.dashboard-supplier-clean .dashboard-grid > .dashboard-card {
    min-height: 210px;
}

.dashboard-action-card,
.dashboard-action-card.dashboard-action-card-fixed {
    min-height: 190px;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
}

.dashboard-action-card span,
.dashboard-action-card.dashboard-action-card-fixed span {
    min-height: 58px;
    display: flex;
    align-items: flex-start;
}

.dashboard-action-card small,
.dashboard-action-card.dashboard-action-card-fixed small {
    margin-top: auto;
}

.dashboard-action-card[href="place-order.html"],
.dashboard-action-card[href="supplier-client-transfer.html"] {
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border-color: #d9e8ff;
}

.dashboard-action-card[href="place-order.html"] span,
.dashboard-action-card[href="supplier-client-transfer.html"] span {
    color: #0f172a;
}

body.dashboard-regional-clean .dashboard-action-card[href="place-order.html"] span,
body.dashboard-regional-clean .dashboard-action-card[href="supplier-client-transfer.html"] span,
body.dashboard-supplier-clean .dashboard-action-card[href="supplier-client-transfer.html"] span {
    min-height: 0;
}

.manager-list .manager-item:only-child {
    min-height: 74px;
}

@media (max-width: 1100px) {
    body.dashboard-regional-clean .dashboard-grid,
    body.dashboard-supplier-clean .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-action-card,
    .dashboard-action-card.dashboard-action-card-fixed {
        min-height: auto;
    }

    .dashboard-action-card span,
    .dashboard-action-card.dashboard-action-card-fixed span {
        min-height: 0;
    }
}

/* ===== 15.88.3: ровные карточки главной и Telegram-контакты по ролям ===== */
body.dashboard-page.is-supplier-user #telegram,
body.dashboard-page.is-regional-client-user #telegram,
body.dashboard-supplier-clean #telegram,
body.dashboard-regional-clean #telegram {
    display: flex !important;
}

body.dashboard-page.is-supplier-user #managers,
body.dashboard-page.is-regional-client-user #managers,
body.dashboard-supplier-clean #managers,
body.dashboard-regional-clean #managers {
    display: block !important;
}

body.dashboard-admin-clean #telegram,
body.dashboard-admin-clean #managers {
    display: none !important;
}

.dashboard-action-card[href="place-order.html"],
.dashboard-action-card[href="supplier-client-transfer.html"],
.dashboard-action-card.dashboard-action-card-fixed {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    min-height: 190px;
    overflow: hidden;
}

.dashboard-action-card[href="place-order.html"] span,
.dashboard-action-card[href="supplier-client-transfer.html"] span,
.dashboard-action-card.dashboard-action-card-fixed span {
    display: block !important;
    min-height: auto !important;
    margin-bottom: 0 !important;
    line-height: 1.18;
}

.dashboard-action-card[href="place-order.html"] small,
.dashboard-action-card[href="supplier-client-transfer.html"] small,
.dashboard-action-card.dashboard-action-card-fixed small {
    display: block !important;
    margin-top: 0 !important;
    line-height: 1.45;
}

#managers .manager-list {
    margin-top: 20px;
}

#managers .manager-item {
    min-height: 78px;
}

/* ===== 15.91.1: стабильное боковое меню без прыжков при загрузке ===== */
body:not(.jd-menu-ready) .sidebar-nav {
    visibility: hidden;
}

body.jd-menu-ready .sidebar-nav {
    visibility: visible;
}

.dashboard-page > .sidebar,
.sidebar {
    flex: 0 0 290px;
    width: 290px;
    min-width: 290px;
    max-width: 290px;
    align-self: flex-start;
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 20;
}

.sidebar-nav {
    min-height: 0;
}

.sidebar-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
}

@media (max-width: 980px) {
    body:not(.jd-menu-ready) .sidebar-nav {
        visibility: visible;
    }

    .dashboard-page > .sidebar,
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(86vw, 320px);
        min-width: 0;
        max-width: min(86vw, 320px);
        overflow-y: auto;
        z-index: 1000;
}
}

/* ===== 15.91.2: защита бокового меню от старых добавленных ссылок ===== */
.dashboard-page > .sidebar,
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar > .sidebar-nav,
.sidebar > nav.sidebar-nav {
    overflow: visible;
}

.sidebar > .logout-btn {
    order: 3;
    flex: 0 0 auto;
    margin-top: 12px !important;
}

.sidebar > a:not(.telegram-btn),
.sidebar > .dashboard-action-card,
.sidebar > .sidebar-item,
.sidebar > .menu-item,
.sidebar > .nav-item {
    display: none !important;
}

.sidebar .sidebar-nav a,
.sidebar nav.sidebar-nav a {
    display: flex !important;
    align-items: center;
    min-height: 44px;
}

.sidebar .sidebar-nav a.active,
.sidebar .sidebar-nav a.active-link {
    font-weight: 800;
    color: #111827;
}

body.jd-menu-hard-fixed .sidebar-nav {
    visibility: visible !important;
}

/* ===== 15.91.3: фикс бокового меню без наложения кнопки выхода ===== */
html.jd-menu-hard-fixed .dashboard-page > .sidebar,
html.jd-menu-hard-fixed .sidebar,
body.jd-menu-hard-fixed .dashboard-page > .sidebar,
body.jd-menu-hard-fixed .sidebar,
.dashboard-page > .sidebar,
.sidebar {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
}

.sidebar > .sidebar-logo {
    order: 1 !important;
    flex: 0 0 auto !important;
}

.sidebar > .sidebar-nav,
.sidebar > nav.sidebar-nav {
    order: 2 !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    margin-top: 28px !important;
    margin-bottom: 12px !important;
    padding-right: 6px !important;
    padding-bottom: 8px !important;
    scrollbar-width: thin;
}

.sidebar > .logout-btn,
.sidebar > button.logout-btn {
    order: 3 !important;
    flex: 0 0 auto !important;
    position: static !important;
    inset: auto !important;
    transform: none;
    width: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    z-index: 5 !important;
}

.sidebar > .logout-btn:hover,
.sidebar > button.logout-btn:hover {
    transform: translateY(-1px);
}

.sidebar .sidebar-nav a,
.sidebar nav.sidebar-nav a {
    flex: 0 0 auto !important;
}

@media (max-width: 980px) {
    html.jd-menu-hard-fixed .dashboard-page > .sidebar,
    html.jd-menu-hard-fixed .sidebar,
    body.jd-menu-hard-fixed .dashboard-page > .sidebar,
    body.jd-menu-hard-fixed .sidebar,
    .dashboard-page > .sidebar,
    .sidebar {
        height: 100vh !important;
        max-height: 100vh !important;
        overflow: hidden !important;
    }

    .sidebar > .sidebar-nav,
    .sidebar > nav.sidebar-nav {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        flex-direction: column !important;
        margin-top: 14px !important;
        margin-bottom: 10px !important;
        padding-bottom: 8px !important;
    }
}

/* ===== 15.91.4: кнопка выхода в самом низу списка меню ===== */
@media (min-width: 981px) {
    html.jd-menu-hard-fixed .dashboard-page > .sidebar,
    html.jd-menu-hard-fixed .sidebar,
    body.jd-menu-hard-fixed .dashboard-page > .sidebar,
    body.jd-menu-hard-fixed .sidebar,
    .dashboard-page > .sidebar,
    .sidebar {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        scrollbar-width: thin !important;
        padding-bottom: 28px !important;
}

    .sidebar > .sidebar-logo {
        order: 1 !important;
        flex: 0 0 auto !important;
    }

    .sidebar > .sidebar-nav,
    .sidebar > nav.sidebar-nav {
        order: 2 !important;
        flex: 0 0 auto !important;
        overflow: visible !important;
        margin-top: 28px !important;
        margin-bottom: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
}

    .sidebar > .logout-btn,
    .sidebar > button.logout-btn {
        order: 3 !important;
        inset: auto !important;
        margin-top: 28px !important;
        margin-bottom: 0 !important;
        align-self: stretch !important;
}

}

/* ===== 15.91.5: кнопка выхода закреплена внизу боковой панели ===== */
@media (min-width: 981px) {
    html.jd-menu-hard-fixed .dashboard-page > .sidebar,
    html.jd-menu-hard-fixed .sidebar,
    body.jd-menu-hard-fixed .dashboard-page > .sidebar,
    body.jd-menu-hard-fixed .sidebar,
    .dashboard-page > .sidebar,
    .sidebar {
        position: sticky !important;
        top: 0 !important;
        flex: 0 0 290px !important;
        width: 290px !important;
        min-width: 290px !important;
        max-width: 290px !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        padding: 28px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        display: block !important;
        z-index: 20 !important;
    }

    .sidebar > .sidebar-logo {
        position: relative !important;
        z-index: 2 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .sidebar > .sidebar-nav,
    .sidebar > nav.sidebar-nav {
        position: absolute !important;
        left: 28px !important;
        right: 22px !important;
        top: 122px !important;
        bottom: 104px !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 6px 14px 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        scrollbar-width: thin !important;
    }

    .sidebar > .logout-btn,
    .sidebar > button.logout-btn {
        position: absolute !important;
        left: 28px !important;
        right: 28px !important;
        bottom: 28px !important;
        width: calc(100% - 56px) !important;
        min-height: 56px !important;
        margin: 0 !important;
        z-index: 3 !important;
        flex: none !important;
        inset: auto 28px 28px 28px !important;
        transform: none !important;
    }

    .sidebar > .logout-btn:hover,
    .sidebar > button.logout-btn:hover {
        transform: translateY(-1px) !important;
    }
}

@media (max-width: 980px) {
    .dashboard-page > .sidebar,
    .sidebar {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .sidebar > .sidebar-nav,
    .sidebar > nav.sidebar-nav,
    .sidebar > .logout-btn,
    .sidebar > button.logout-btn {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        inset: auto !important;
        width: 100% !important;
    }
}

/* ===== 15.91.6: финальная фиксация бокового меню на рабочем столе и ноутбуках =====
   Причина прошлой ошибки: при изменённом масштабе браузера часть правил попадала в планшетный режим,
   поэтому кнопка выхода закреплялась не внизу боковой панели, а внутри укороченной области меню.
   Ниже меню собирается в стабильную сетку: логотип сверху, список прокручивается, кнопка выхода всегда снизу.
*/
@media (min-width: 720px) {
    body:not(.auth-page) .dashboard-page {
        width: 100% !important;
        overflow: visible !important;
}

    body:not(.auth-page) .dashboard-page > .sidebar,
    body:not(.auth-page) aside.sidebar,
    html.jd-menu-hard-fixed body:not(.auth-page) .dashboard-page > .sidebar,
    html.jd-menu-hard-fixed body:not(.auth-page) aside.sidebar {
        position: sticky !important;
        top: 0 !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        inset: auto !important;
        align-self: flex-start !important;
        flex: 0 0 290px !important;
        width: 290px !important;
        min-width: 290px !important;
        max-width: 290px !important;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        padding: 28px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) auto !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0 !important;
        transform: none !important;
        z-index: 20 !important;
    }

    body:not(.auth-page) .sidebar > .sidebar-logo,
    body:not(.auth-page) aside.sidebar > .sidebar-logo {
        grid-row: 1 !important;
        grid-column: 1 !important;
        position: static !important;
        flex: none !important;
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: none !important;
    }

    body:not(.auth-page) .sidebar > .sidebar-nav,
    body:not(.auth-page) .sidebar > nav.sidebar-nav,
    body:not(.auth-page) aside.sidebar > .sidebar-nav,
    body:not(.auth-page) aside.sidebar > nav.sidebar-nav {
        grid-row: 2 !important;
        grid-column: 1 !important;
        position: static !important;
        inset: auto !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 28px 0 18px 0 !important;
        padding: 0 8px 0 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        scrollbar-width: thin !important;
        transform: none !important;
    }

    body:not(.auth-page) .sidebar > .logout-btn,
    body:not(.auth-page) .sidebar > button.logout-btn,
    body:not(.auth-page) aside.sidebar > .logout-btn,
    body:not(.auth-page) aside.sidebar > button.logout-btn {
        grid-row: 3 !important;
        grid-column: 1 !important;
        position: static !important;
        inset: auto !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        min-height: 56px !important;
        height: auto !important;
        margin: 0 !important;
        padding: 14px 18px !important;
        align-self: end !important;
        justify-self: stretch !important;
        flex: none !important;
        z-index: 3 !important;
        transform: none !important;
    }

    body:not(.auth-page) .sidebar > .logout-btn:hover,
    body:not(.auth-page) .sidebar > button.logout-btn:hover,
    body:not(.auth-page) aside.sidebar > .logout-btn:hover,
    body:not(.auth-page) aside.sidebar > button.logout-btn:hover {
        transform: translateY(-1px) !important;
    }
}

@media (max-width: 719px) {
    body:not(.auth-page) .sidebar > .logout-btn,
    body:not(.auth-page) .sidebar > button.logout-btn {
        position: static !important;
        width: 100% !important;
        margin-top: 12px !important;
    }
}

/* ===== 15.91.7: обычное боковое меню без внутренней прокрутки =====
   Важно: кнопка «Выйти» должна быть внизу всей левой колонки страницы,
   а не внизу видимой области и не внутри прокручиваемого списка меню.
   Поэтому левая колонка больше не фиксируется к экрану и не имеет своей внутренней прокрутки.
*/
@media (min-width: 720px) {
    html.jd-menu-hard-fixed body:not(.auth-page) .dashboard-page,
    body:not(.auth-page) .dashboard-page,
    .dashboard-page {
        display: flex !important;
        align-items: stretch !important;
        min-height: 100vh !important;
        width: 100% !important;
        overflow: visible !important;
    }

    html.jd-menu-hard-fixed body:not(.auth-page) .dashboard-page > .sidebar,
    html.jd-menu-hard-fixed body:not(.auth-page) aside.sidebar,
    body.jd-menu-hard-fixed:not(.auth-page) .dashboard-page > .sidebar,
    body.jd-menu-hard-fixed:not(.auth-page) aside.sidebar,
    body:not(.auth-page) .dashboard-page > .sidebar,
    body:not(.auth-page) aside.sidebar,
    .dashboard-page > .sidebar,
    aside.sidebar,
    .sidebar {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        inset: auto !important;
        align-self: stretch !important;
        flex: 0 0 290px !important;
        width: 290px !important;
        min-width: 290px !important;
        max-width: 290px !important;
        height: auto !important;
        min-height: 100vh !important;
        max-height: none !important;
        padding: 28px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        transform: none !important;
        z-index: 20 !important;
    }

    body:not(.auth-page) .sidebar > .sidebar-logo,
    body:not(.auth-page) aside.sidebar > .sidebar-logo,
    .sidebar > .sidebar-logo {
        position: static !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: none !important;
        order: 1 !important;
    }

    body:not(.auth-page) .sidebar > .sidebar-nav,
    body:not(.auth-page) .sidebar > nav.sidebar-nav,
    body:not(.auth-page) aside.sidebar > .sidebar-nav,
    body:not(.auth-page) aside.sidebar > nav.sidebar-nav,
    .sidebar > .sidebar-nav,
    .sidebar > nav.sidebar-nav {
        position: static !important;
        inset: auto !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 32px 0 28px 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        transform: none !important;
        order: 2 !important;
        scrollbar-width: auto !important;
    }

    body:not(.auth-page) .sidebar > .logout-btn,
    body:not(.auth-page) .sidebar > button.logout-btn,
    body:not(.auth-page) aside.sidebar > .logout-btn,
    body:not(.auth-page) aside.sidebar > button.logout-btn,
    .sidebar > .logout-btn,
    .sidebar > button.logout-btn {
        position: static !important;
        inset: auto !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        min-height: 56px !important;
        height: auto !important;
        margin: auto 0 0 0 !important;
        padding: 14px 18px !important;
        align-self: stretch !important;
        justify-self: auto !important;
        flex: 0 0 auto !important;
        z-index: 3 !important;
        transform: none !important;
        order: 3 !important;
    }

    body:not(.auth-page) .sidebar > .logout-btn:hover,
    body:not(.auth-page) .sidebar > button.logout-btn:hover,
    body:not(.auth-page) aside.sidebar > .logout-btn:hover,
    body:not(.auth-page) aside.sidebar > button.logout-btn:hover,
    .sidebar > .logout-btn:hover,
    .sidebar > button.logout-btn:hover {
        transform: translateY(-1px) !important;
    }
}

/* ===== 15.91.8: меню снова кликабельное после фиксации кнопки выхода =====
   Левая колонка остаётся в нужном положении, но получает приоритет над рабочей областью.
   Это защищает пункты меню от прозрачных наложений и от старых мобильных слоёв. */
@media (min-width: 720px) {
    html.jd-menu-click-fixed body:not(.auth-page) .dashboard-page,
    body.jd-menu-click-fixed:not(.auth-page) .dashboard-page {
        isolation: isolate !important;
    }

    html.jd-menu-click-fixed body:not(.auth-page) .dashboard-page > .sidebar,
    html.jd-menu-click-fixed body:not(.auth-page) aside.sidebar,
    body.jd-menu-click-fixed:not(.auth-page) .dashboard-page > .sidebar,
    body.jd-menu-click-fixed:not(.auth-page) aside.sidebar,
    html.jd-menu-click-fixed .dashboard-page > .sidebar,
    body.jd-menu-click-fixed .dashboard-page > .sidebar {
        pointer-events: auto !important;
        z-index: 1000 !important;
    }

    html.jd-menu-click-fixed body:not(.auth-page) .sidebar > .sidebar-nav,
    html.jd-menu-click-fixed body:not(.auth-page) .sidebar > nav.sidebar-nav,
    body.jd-menu-click-fixed:not(.auth-page) .sidebar > .sidebar-nav,
    body.jd-menu-click-fixed:not(.auth-page) .sidebar > nav.sidebar-nav {
        pointer-events: auto !important;
        position: relative !important;
        z-index: 1001 !important;
    }

    html.jd-menu-click-fixed body:not(.auth-page) .sidebar-nav a[href],
    body.jd-menu-click-fixed:not(.auth-page) .sidebar-nav a[href] {
        pointer-events: auto !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 1002 !important;
    }

    html.jd-menu-click-fixed body:not(.auth-page) .dashboard-content,
    body.jd-menu-click-fixed:not(.auth-page) .dashboard-content {
        position: relative !important;
        z-index: 1 !important;
    }

    html.jd-menu-click-fixed .jd-mobile-menu-backdrop,
    body.jd-menu-click-fixed .jd-mobile-menu-backdrop {
        display: none !important;
        pointer-events: none !important;
    }

    html.jd-menu-click-fixed .jd-mobile-menu-toggle,
    body.jd-menu-click-fixed .jd-mobile-menu-toggle {
        display: none !important;
    }
}

@media (max-width: 719px) {
    html.jd-menu-click-fixed .sidebar,
    body.jd-menu-click-fixed .sidebar,
    html.jd-menu-click-fixed .sidebar-nav,
    body.jd-menu-click-fixed .sidebar-nav,
    html.jd-menu-click-fixed .sidebar-nav a[href],
    body.jd-menu-click-fixed .sidebar-nav a[href] {
        pointer-events: auto !important;
    }
}

/* =========================================================
   15.99.1 — защита заявок и аккуратное окно заявки
   ========================================================= */
.telegram-btn.is-loading,
.form-main-btn.is-loading,
button.is-loading {
    opacity: 0.72 !important;
    cursor: wait !important;
    pointer-events: none !important;
}

.telegram-btn:disabled,
.form-main-btn:disabled,
button:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

body.admin-orders-page .order-modal {
    width: min(980px, calc(100vw - 32px)) !important;
    max-width: min(980px, calc(100vw - 32px)) !important;
}

body.admin-orders-page .modal-products-list,
body.admin-orders-page .modal-product-item,
body.admin-orders-page .admin-product-decision,
body.admin-orders-page .regional-procurement-box,
body.admin-orders-page .regional-procurement-grid,
body.admin-orders-page .regional-procurement-grid p {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.admin-orders-page .admin-product-decision {
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr) !important;
    align-items: start !important;
    gap: 18px !important;
    overflow: hidden !important;
}

body.admin-orders-page .admin-product-decision > div {
    min-width: 0 !important;
}

body.admin-orders-page .modal-product-item h4,
body.admin-orders-page .modal-product-item p,
body.admin-orders-page .modal-product-item strong,
body.admin-orders-page .regional-procurement-grid strong,
body.admin-orders-page .regional-procurement-grid span,
body.admin-orders-page .order-modal-info strong {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

body.admin-orders-page .modal-product-item h4 {
    max-width: 100% !important;
    line-height: 1.35 !important;
}

body.admin-orders-page .admin-product-controls label,
body.admin-orders-page .admin-product-controls input,
body.admin-orders-page .admin-product-controls select,
body.admin-orders-page .admin-product-controls button {
    max-width: 100% !important;
}

body.admin-orders-page .regional-procurement-grid .regional-procurement-source-title strong {
    display: -webkit-box !important;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

@media (max-width: 900px) {
    body.admin-orders-page .admin-product-decision {
        grid-template-columns: 1fr !important;
    }

    body.admin-orders-page .regional-procurement-grid .regional-procurement-source-title {
        grid-column: 1 / -1 !important;
    }
}

/* =========================================================
   15.99.2 — восстановление нормальной ширины окна заявки
   ========================================================= */
body.admin-orders-page .orders-table-wrapper,
body.admin-orders-page .table-wrapper {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

body.admin-orders-page .orders-table,
body.admin-orders-page table {
    max-width: 100% !important;
}

body.admin-orders-page .order-modal-overlay {
    padding: 24px !important;
    align-items: center !important;
    justify-content: center !important;
}

body.admin-orders-page .order-modal {
    width: min(1120px, calc(100vw - 48px)) !important;
    min-width: 0 !important;
    max-height: calc(100vh - 48px) !important;
    overflow-y: auto !important;
    padding: 30px !important;
}

body.admin-orders-page .order-modal,
body.admin-orders-page .order-modal * {
    box-sizing: border-box !important;
}

body.admin-orders-page .modal-products-list {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
}

body.admin-orders-page .modal-product-item.admin-product-decision {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 22px !important;
    overflow: hidden !important;
}

body.admin-orders-page .admin-product-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

body.admin-orders-page .modal-product-item h4,
body.admin-orders-page .admin-product-main p,
body.admin-orders-page .admin-product-main strong,
body.admin-orders-page .admin-product-main span,
body.admin-orders-page .order-modal-info strong {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

body.admin-orders-page .regional-procurement-box {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

body.admin-orders-page .regional-procurement-head {
    min-width: 0 !important;
}

body.admin-orders-page .regional-procurement-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 10px !important;
}

body.admin-orders-page .regional-procurement-grid p {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

body.admin-orders-page .regional-procurement-grid .regional-procurement-source-title {
    grid-column: span 2 !important;
}

body.admin-orders-page .regional-procurement-grid strong,
body.admin-orders-page .regional-procurement-grid span {
    display: block !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

body.admin-orders-page .regional-procurement-grid .regional-procurement-source-title strong {
    display: block !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
}

body.admin-orders-page .admin-product-controls {
    display: grid !important;
    grid-template-columns: minmax(170px, 1fr) minmax(130px, 0.75fr) minmax(150px, 0.75fr) minmax(220px, 1.25fr) !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-top: 20px !important;
    padding-top: 18px !important;
    border-top: 1px solid #e5e7eb !important;
}

body.admin-orders-page .admin-product-controls label {
    min-width: 0 !important;
    max-width: 100% !important;
}

body.admin-orders-page .admin-product-controls input,
body.admin-orders-page .admin-product-controls select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

body.admin-orders-page .admin-product-controls button {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

@media (max-width: 1050px) {
    body.admin-orders-page .order-modal {
        width: min(960px, calc(100vw - 32px)) !important;
        padding: 24px !important;
    }

    body.admin-orders-page .admin-product-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.admin-orders-page .regional-procurement-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.admin-orders-page .regional-procurement-grid .regional-procurement-source-title {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 640px) {
    body.admin-orders-page .order-modal-overlay {
        padding: 12px !important;
        align-items: flex-start !important;
    }

    body.admin-orders-page .order-modal {
        width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 24px) !important;
        padding: 18px !important;
        border-radius: 22px !important;
    }

    body.admin-orders-page .admin-product-controls,
    body.admin-orders-page .regional-procurement-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================
   15.99.4 — Заявки клиентов: список без разъезда и без старой проверки базового прайса
   ========================================================= */
body.admin-orders-page .inventory-card {
    max-width: 100% !important;
    overflow: hidden !important;
}

body.admin-orders-page .admin-orders-table-wrapper,
body.admin-orders-page .inventory-table-wrapper.admin-orders-table-wrapper {
    -webkit-overflow-scrolling: touch !important;
    border-radius: 18px !important;
}

body.admin-orders-page .admin-orders-table th:nth-child(5),
body.admin-orders-page .admin-orders-table td:nth-child(5) {
    white-space: nowrap !important;
}

body.admin-orders-page .admin-orders-table .client-answer-badge {
    text-align: center !important;
}

body.admin-orders-page .admin-orders-table .table-actions {
    display: flex !important;
    justify-content: flex-end !important;
    width: 100% !important;
}

body.admin-orders-page .admin-orders-table .admin-order-date-cell,
body.admin-orders-page .admin-orders-table .admin-order-user-cell,
body.admin-orders-page .admin-orders-table .admin-order-client-cell,
body.admin-orders-page .admin-orders-table .admin-order-telegram-cell {
    line-height: 1.2 !important;
}

/* Модальное окно заявки оставляем широким, но запрещаем горизонтальный разъезд. */
body.admin-orders-page .order-modal-overlay {
    overflow: auto !important;
}

body.admin-orders-page .order-modal {
    width: min(1120px, calc(100vw - 48px)) !important;
    max-width: 1120px !important;
    overflow-x: hidden !important;
}

body.admin-orders-page .modal-product-item.admin-product-decision,
body.admin-orders-page .admin-product-main,
body.admin-orders-page .regional-procurement-box,
body.admin-orders-page .regional-procurement-grid,
body.admin-orders-page .regional-procurement-grid p {
    min-width: 0 !important;
    max-width: 100% !important;
}

@media (max-width: 768px) {

    body.admin-orders-page .admin-orders-table-wrapper,
    body.admin-orders-page .inventory-table-wrapper.admin-orders-table-wrapper {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
    }
}

/* =========================================================
   15.99.6 — таблица заявок без переноса слов и корректная роль в меню
   ========================================================= */
body.admin-orders-page .sidebar-logo p[data-jd-role-subtitle-fixed="1"] {
    white-space: nowrap !important;
}

body.admin-orders-page .admin-orders-table-wrapper,
body.admin-orders-page .inventory-table-wrapper.admin-orders-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 12px !important;
}

body.admin-orders-page .admin-orders-table,
body.admin-orders-page .inventory-table.admin-orders-table {
    max-width: none !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
}

body.admin-orders-page .admin-orders-table th,
body.admin-orders-page .admin-orders-table td {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

body.admin-orders-page .admin-orders-table th {
    line-height: 1.15 !important;
}

body.admin-orders-page .admin-orders-table th:nth-child(1),
body.admin-orders-page .admin-orders-table td:nth-child(1) {
    width: 110px !important;
}

body.admin-orders-page .admin-orders-table th:nth-child(2),
body.admin-orders-page .admin-orders-table td:nth-child(2) {
    width: 160px !important;
}

body.admin-orders-page .admin-orders-table th:nth-child(3),
body.admin-orders-page .admin-orders-table td:nth-child(3) {
    width: 160px !important;
}

body.admin-orders-page .admin-orders-table th:nth-child(4),
body.admin-orders-page .admin-orders-table td:nth-child(4) {
    width: 170px !important;
}

body.admin-orders-page .admin-orders-table th:nth-child(5),
body.admin-orders-page .admin-orders-table td:nth-child(5) {
    width: 145px !important;
}

body.admin-orders-page .admin-orders-table th:nth-child(6),
body.admin-orders-page .admin-orders-table td:nth-child(6) {
    width: 260px !important;
}

body.admin-orders-page .admin-orders-table th:nth-child(7),
body.admin-orders-page .admin-orders-table td:nth-child(7) {
    width: 220px !important;
}

body.admin-orders-page .admin-orders-table th:nth-child(8),
body.admin-orders-page .admin-orders-table td:nth-child(8) {
    width: 125px !important;
    text-align: right !important;
}

body.admin-orders-page .admin-orders-table .client-answer-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    line-height: 1.1 !important;
}

body.admin-orders-page .admin-orders-table .status-select {
    width: 190px !important;
    min-width: 190px !important;
    max-width: 190px !important;
    height: 48px !important;
}

body.admin-orders-page .admin-orders-table .table-actions,
body.admin-orders-page .admin-orders-table .admin-order-actions-cell {
    white-space: nowrap !important;
    overflow: visible !important;
}

body.admin-orders-page .admin-orders-table .delete-btn {
    width: auto !important;
    min-width: 86px !important;
    max-width: none !important;
    padding: 10px 16px !important;
    white-space: nowrap !important;
}

/* ===== JD Group 15.99.7: понятные разделы прайса клиента ===== */
body.place-order-page .category-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 18px;
    align-items: stretch;
}

body.place-order-page .category-display-card,
body.place-order-page .category-card {
    min-height: 260px;
    border-radius: 26px;
    background: #ffffff;
    border: 1px solid #dbe7f4;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

body.place-order-page .category-display-card:hover,
body.place-order-page .category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.10);
}

body.place-order-page .category-image-wrap {
    height: 138px;
    margin: 14px 14px 0;
    border-radius: 22px;
    background: linear-gradient(135deg, #f5f9ff 0%, #eaf2fb 100%);
    border: 1px solid #e0ebf6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

body.place-order-page .category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.place-order-page .category-card-content {
    padding: 16px 18px 20px;
}

body.place-order-page .category-card-content h3 {
    min-height: 0;
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.08;
    color: #070f22;
    word-break: normal;
    overflow-wrap: normal;
}

body.place-order-page .category-card-content p {
    margin: 0;
    color: #6b778a;
    font-size: 14px;
    line-height: 1.45;
}

body.place-order-page .price-item-info span {
    display: inline-flex;
    max-width: 100%;
    color: #007aff;
    font-weight: 800;
}

@media (max-width: 900px) {
    body.place-order-page .category-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    body.place-order-page .category-list {
        grid-template-columns: 1fr;
    }

    body.place-order-page .category-image-wrap {
        height: 170px;
    }
}

/* =========================================================
   15.99.8 — компактные карточки разделов прайса клиента
   ========================================================= */
body.place-order-page .price-card .category-list {
    gap: 14px !important;
}

@media (max-width: 560px) {
    body.place-order-page .price-card .category-list {
        gap: 12px !important;
}

}

/* =========================================================
   15.99.9 — аккуратные карточки клиентских разделов
   ========================================================= */
body.place-order-page .price-card .category-list {
    gap: 16px !important;
}

body.place-order-page .price-card .category-display-card,
body.place-order-page .price-card .category-card {
    max-height: none !important;
}

body.place-order-page .price-card .category-card-content h3 {
    min-height: 0 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

@media (max-width: 1200px) {
    body.place-order-page .price-card .category-list {
        gap: 14px !important;
}

}

@media (max-width: 560px) {
    body.place-order-page .price-card .category-list {
        gap: 12px !important;
}

}

/* =========================================================
   15.99.10 — ровные картинки в карточках разделов прайса
   ========================================================= */
body.place-order-page .price-card .category-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, 172px) !important;
    gap: 16px !important;
    justify-content: start !important;
    align-items: start !important;
    width: 100% !important;
}

body.place-order-page .price-card .category-display-card,
body.place-order-page .price-card .category-card {
    width: 172px !important;
    min-width: 172px !important;
    max-width: 172px !important;
    min-height: 232px !important;
    padding: 0 !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    background: #ffffff !important;
    border: 1px solid #dbe7f4 !important;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06) !important;
    display: flex !important;
    flex-direction: column !important;
}

body.place-order-page .price-card .category-image-wrap {
    position: relative !important;
    width: auto !important;
    height: 122px !important;
    margin: 12px 12px 0 !important;
    padding: 0 !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    background: linear-gradient(135deg, #f7fbff 0%, #edf5ff 100%) !important;
    border: 1px solid #e0ebf6 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 122px !important;
}

body.place-order-page .price-card .category-image {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    display: block !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: scale(1.22) !important;
    transform-origin: center center !important;
}

body.place-order-page .price-card .category-card-content {
    padding: 14px 16px 17px !important;
    text-align: left !important;
    display: block !important;
}

body.place-order-page .price-card .category-card-content h3 {
    margin: 0 0 6px !important;
    font-size: 22px !important;
    line-height: 1.12 !important;
    font-weight: 900 !important;
    color: #070f22 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.place-order-page .price-card .category-card-content p {
    margin: 0 !important;
    color: #657386 !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

body.place-order-page .price-card .category-display-card:hover,
body.place-order-page .price-card .category-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.10) !important;
}

@media (max-width: 1200px) {
    body.place-order-page .price-card .category-list {
        grid-template-columns: repeat(auto-fill, 168px) !important;
        gap: 14px !important;
    }

    body.place-order-page .price-card .category-display-card,
    body.place-order-page .price-card .category-card {
        width: 168px !important;
        min-width: 168px !important;
        max-width: 168px !important;
    }
}

@media (max-width: 900px) {
    body.place-order-page .price-card .category-list {
        grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)) !important;
    }

    body.place-order-page .price-card .category-display-card,
    body.place-order-page .price-card .category-card {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }
}

@media (max-width: 560px) {
    body.place-order-page .price-card .category-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    body.place-order-page .price-card .category-image-wrap {
        height: 112px !important;
        flex-basis: 112px !important;
    }

    body.place-order-page .price-card .category-card-content h3 {
        font-size: 20px !important;
    }

    body.place-order-page .price-card .category-card-content p {
        font-size: 12.5px !important;
    }
}

@media (max-width: 390px) {
    body.place-order-page .price-card .category-list {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================
   15.99.11 — выбранный раздел больше не остаётся над товарами
   ========================================================= */
body.place-order-page .price-card .category-list.is-hidden,
body.place-order-page .price-card #categoryList.is-hidden,
body.place-order-page #categoryList.category-list.is-hidden,
body.place-order-page #categoryList.is-hidden {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

body.place-order-page .price-card .price-list.is-hidden,
body.place-order-page .price-card #priceList.is-hidden,
body.place-order-page .price-card .price-search.is-hidden,
body.place-order-page .price-card #priceSearch.is-hidden,
body.place-order-page .price-card .category-back-btn.is-hidden,
body.place-order-page .price-card #backToCategoriesBtn.is-hidden {
    display: none !important;
}

.order-stock-note {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

/* ===== 16.20.4.1: стабильное меню без видимых прыжков при загрузке ===== */
html.jd-162041-menu-boot body:not(.auth-page) .sidebar-nav,
html.jd-162041-menu-boot body:not(.auth-page) aside.sidebar nav,
body.jd-162041-menu-boot:not(.auth-page) .sidebar-nav {
    visibility: hidden !important;
    opacity: 0 !important;
}

html.jd-162041-menu-ready body:not(.auth-page) .sidebar-nav,
body.jd-162041-menu-ready:not(.auth-page) .sidebar-nav,
html.jd-16-12-role-ready body:not(.auth-page) .sidebar-nav,
body.jd-16-12-role-ready:not(.auth-page) .sidebar-nav {
    visibility: visible !important;
    opacity: 1 !important;
}

body:not(.auth-page) .sidebar-nav a[href="site-full-test.html"] {
    font-weight: 800;
}

/* ===== 16.20.5.5: меню видно и стабильно на всех страницах ===== */
html.jd-162041-menu-boot body:not(.auth-page) .sidebar-nav,
html.jd-162041-menu-boot body:not(.auth-page) aside.sidebar nav,
body.jd-162041-menu-boot:not(.auth-page) .sidebar-nav,
html.jd-162055-menu-ready body:not(.auth-page) .sidebar-nav,
body.jd-162055-menu-ready:not(.auth-page) .sidebar-nav,
body:not(.auth-page) .sidebar.jd-162055-sidebar-fixed .sidebar-nav,
body:not(.auth-page) aside.sidebar.jd-162055-sidebar-fixed nav.sidebar-nav {
    visibility: visible !important;
    opacity: 1 !important;
}

@media (min-width: 720px) {
    body:not(.auth-page) .dashboard-page {
        display: flex !important;
        align-items: stretch !important;
        min-height: 100vh !important;
    }

    body:not(.auth-page) aside.sidebar.jd-162055-sidebar-fixed,
    body:not(.auth-page) .sidebar.jd-162055-sidebar-fixed {
        flex: 0 0 290px !important;
        width: 290px !important;
        min-width: 290px !important;
        max-width: 290px !important;
        min-height: 100vh !important;
        height: auto !important;
        max-height: none !important;
        padding: 28px !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        overflow: visible !important;
        position: relative !important;
        transform: none !important;
        box-sizing: border-box !important;
        z-index: 1000 !important;
    }

    body:not(.auth-page) aside.sidebar.jd-162055-sidebar-fixed > .sidebar-logo,
    body:not(.auth-page) .sidebar.jd-162055-sidebar-fixed > .sidebar-logo {
        flex: 0 0 auto !important;
        order: 1 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
        transform: none !important;
    }

    body:not(.auth-page) aside.sidebar.jd-162055-sidebar-fixed > nav.sidebar-nav,
    body:not(.auth-page) .sidebar.jd-162055-sidebar-fixed > nav.sidebar-nav,
    body:not(.auth-page) aside.sidebar.jd-162055-sidebar-fixed > .sidebar-nav,
    body:not(.auth-page) .sidebar.jd-162055-sidebar-fixed > .sidebar-nav {
        flex: 0 0 auto !important;
        order: 2 !important;
        width: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 32px 0 28px 0 !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        overflow: visible !important;
        position: static !important;
        inset: auto !important;
        transform: none !important;
        pointer-events: auto !important;
    }

    body:not(.auth-page) aside.sidebar.jd-162055-sidebar-fixed > .logout-btn,
    body:not(.auth-page) .sidebar.jd-162055-sidebar-fixed > .logout-btn,
    body:not(.auth-page) aside.sidebar.jd-162055-sidebar-fixed > button.logout-btn,
    body:not(.auth-page) .sidebar.jd-162055-sidebar-fixed > button.logout-btn {
        flex: 0 0 auto !important;
        order: 3 !important;
        width: 100% !important;
        margin: auto 0 0 0 !important;
        position: static !important;
        inset: auto !important;
        transform: none !important;
        pointer-events: auto !important;
    }
}

body:not(.auth-page) .sidebar.jd-162055-sidebar-fixed .sidebar-nav a[href] {
    display: flex !important;
    align-items: center !important;
    min-height: 44px !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 1002 !important;
}

body:not(.auth-page) .sidebar.jd-162055-sidebar-fixed .sidebar-nav a.active,
body:not(.auth-page) .sidebar.jd-162055-sidebar-fixed .sidebar-nav a.active-link {
    font-weight: 800 !important;
    color: #111827 !important;
}

/* ===== 16.20.5.6: жёсткое восстановление видимости бокового меню на всех страницах ===== */
html.jd-162056-menu-ready body:not(.auth-page) .sidebar,
body.jd-162056-menu-ready:not(.auth-page) .sidebar,
body:not(.auth-page) .sidebar.jd-162056-sidebar-fixed,
body:not(.auth-page) aside.sidebar.jd-162056-sidebar-fixed {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    width: 290px !important;
    min-width: 290px !important;
    max-width: 290px !important;
    flex: 0 0 290px !important;
    min-height: 100vh !important;
    height: auto !important;
    max-height: none !important;
    padding: 28px !important;
    margin: 0 !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    transform: none !important;
    z-index: 2000 !important;
    box-sizing: border-box !important;
}

html.jd-162056-menu-ready body:not(.auth-page) .sidebar .sidebar-logo,
body.jd-162056-menu-ready:not(.auth-page) .sidebar .sidebar-logo,
body:not(.auth-page) .sidebar.jd-162056-sidebar-fixed > .sidebar-logo {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    width: 100% !important;
    order: 1 !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
}

html.jd-162056-menu-ready body:not(.auth-page) .sidebar .sidebar-nav,
html.jd-162056-menu-ready body:not(.auth-page) aside.sidebar nav.sidebar-nav,
body.jd-162056-menu-ready:not(.auth-page) .sidebar .sidebar-nav,
body:not(.auth-page) .sidebar.jd-162056-sidebar-fixed > .sidebar-nav,
body:not(.auth-page) .sidebar.jd-162056-sidebar-fixed > nav.sidebar-nav,
body:not(.auth-page) aside.sidebar.jd-162056-sidebar-fixed > nav.sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 32px 0 28px 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    order: 2 !important;
    flex: 0 0 auto !important;
}

html.jd-162056-menu-ready body:not(.auth-page) .sidebar .sidebar-nav a[href],
body.jd-162056-menu-ready:not(.auth-page) .sidebar .sidebar-nav a[href],
body:not(.auth-page) .sidebar.jd-162056-sidebar-fixed .sidebar-nav a[href] {
    display: flex !important;
    align-items: center !important;
    min-height: 44px !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 2002 !important;
}

html.jd-162056-menu-ready body:not(.auth-page) .sidebar .logout-btn,
body.jd-162056-menu-ready:not(.auth-page) .sidebar .logout-btn,
body:not(.auth-page) .sidebar.jd-162056-sidebar-fixed > .logout-btn,
body:not(.auth-page) .sidebar.jd-162056-sidebar-fixed > button.logout-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    min-height: 56px !important;
    margin: auto 0 0 0 !important;
    transform: none !important;
    pointer-events: auto !important;
    order: 3 !important;
    flex: 0 0 auto !important;
}

html.jd-162056-menu-ready body:not(.auth-page) .dashboard-page,
body.jd-162056-menu-ready:not(.auth-page) .dashboard-page {
    display: flex !important;
    align-items: stretch !important;
    min-height: 100vh !important;
}

@media (max-width: 719px) {
    html.jd-162056-menu-ready body:not(.auth-page) .sidebar,
    body.jd-162056-menu-ready:not(.auth-page) .sidebar,
    body:not(.auth-page) .sidebar.jd-162056-sidebar-fixed,
    body:not(.auth-page) aside.sidebar.jd-162056-sidebar-fixed {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        min-height: auto !important;
    }
}

/* ===== 16.21.1: меню поставщика всегда выше рабочих блоков и кликабельно ===== */
@media (min-width: 720px) {
    html.jd-16211-menu-click-ready body:not(.auth-page) .dashboard-page,
    body.jd-16211-menu-click-ready:not(.auth-page) .dashboard-page {
        display: flex !important;
        align-items: stretch !important;
        position: relative !important;
        isolation: isolate !important;
    }

    html.jd-16211-menu-click-ready body:not(.auth-page) .dashboard-page > aside.sidebar,
    html.jd-16211-menu-click-ready body:not(.auth-page) .dashboard-page > .sidebar,
    body.jd-16211-menu-click-ready:not(.auth-page) .dashboard-page > aside.sidebar,
    body.jd-16211-menu-click-ready:not(.auth-page) .dashboard-page > .sidebar {
        flex: 0 0 290px !important;
        width: 290px !important;
        min-width: 290px !important;
        max-width: 290px !important;
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        z-index: 214748300 !important;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
    }

    html.jd-16211-menu-click-ready body:not(.auth-page) .dashboard-page > .dashboard-content,
    body.jd-16211-menu-click-ready:not(.auth-page) .dashboard-page > .dashboard-content {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        position: relative !important;
        z-index: 1 !important;
    }
}

html.jd-16211-menu-click-ready body:not(.auth-page) aside.sidebar,
html.jd-16211-menu-click-ready body:not(.auth-page) .sidebar,
body.jd-16211-menu-click-ready:not(.auth-page) aside.sidebar,
body.jd-16211-menu-click-ready:not(.auth-page) .sidebar {
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

html.jd-16211-menu-click-ready body:not(.auth-page) aside.sidebar nav.sidebar-nav,
html.jd-16211-menu-click-ready body:not(.auth-page) .sidebar .sidebar-nav,
body.jd-16211-menu-click-ready:not(.auth-page) aside.sidebar nav.sidebar-nav,
body.jd-16211-menu-click-ready:not(.auth-page) .sidebar .sidebar-nav {
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 214748301 !important;
}

html.jd-16211-menu-click-ready body:not(.auth-page) aside.sidebar nav.sidebar-nav a[href],
html.jd-16211-menu-click-ready body:not(.auth-page) .sidebar .sidebar-nav a[href],
body.jd-16211-menu-click-ready:not(.auth-page) aside.sidebar nav.sidebar-nav a[href],
body.jd-16211-menu-click-ready:not(.auth-page) .sidebar .sidebar-nav a[href] {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 214748302 !important;
    touch-action: manipulation !important;
}

html.jd-16211-menu-click-ready .jd-mobile-menu-backdrop,
body.jd-16211-menu-click-ready .jd-mobile-menu-backdrop,
html.jd-16211-menu-click-ready .menu-backdrop,
body.jd-16211-menu-click-ready .menu-backdrop,
html.jd-16211-menu-click-ready .sidebar-backdrop,
body.jd-16211-menu-click-ready .sidebar-backdrop {
    display: none !important;
    pointer-events: none !important;
}

/* ===== 16.21.2: клики бокового меню не перекрываются рабочими блоками ===== */
@media (min-width: 720px) {
    html.jd-16212-menu-click-ready body:not(.auth-page) .dashboard-page,
    body.jd-16212-menu-click-ready:not(.auth-page) .dashboard-page {
        display: flex !important;
        align-items: stretch !important;
        position: relative !important;
        isolation: isolate !important;
    }

    html.jd-16212-menu-click-ready body:not(.auth-page) .dashboard-page > aside.sidebar,
    html.jd-16212-menu-click-ready body:not(.auth-page) .dashboard-page > .sidebar,
    body.jd-16212-menu-click-ready:not(.auth-page) .dashboard-page > aside.sidebar,
    body.jd-16212-menu-click-ready:not(.auth-page) .dashboard-page > .sidebar {
        flex: 0 0 290px !important;
        width: 290px !important;
        min-width: 290px !important;
        max-width: 290px !important;
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        z-index: 214748360 !important;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        isolation: isolate !important;
    }

    html.jd-16212-menu-click-ready body:not(.auth-page) .dashboard-page > .dashboard-content,
    body.jd-16212-menu-click-ready:not(.auth-page) .dashboard-page > .dashboard-content {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        position: relative !important;
        z-index: 1 !important;
    }
}

html.jd-16212-menu-click-ready body:not(.auth-page) aside.sidebar,
html.jd-16212-menu-click-ready body:not(.auth-page) .sidebar,
body.jd-16212-menu-click-ready:not(.auth-page) aside.sidebar,
body.jd-16212-menu-click-ready:not(.auth-page) .sidebar,
html.jd-16212-menu-click-ready body:not(.auth-page) aside.sidebar nav.sidebar-nav,
html.jd-16212-menu-click-ready body:not(.auth-page) .sidebar .sidebar-nav,
body.jd-16212-menu-click-ready:not(.auth-page) aside.sidebar nav.sidebar-nav,
body.jd-16212-menu-click-ready:not(.auth-page) .sidebar .sidebar-nav {
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

html.jd-16212-menu-click-ready body:not(.auth-page) aside.sidebar nav.sidebar-nav,
html.jd-16212-menu-click-ready body:not(.auth-page) .sidebar .sidebar-nav,
body.jd-16212-menu-click-ready:not(.auth-page) aside.sidebar nav.sidebar-nav,
body.jd-16212-menu-click-ready:not(.auth-page) .sidebar .sidebar-nav {
    position: relative !important;
    z-index: 214748361 !important;
}

html.jd-16212-menu-click-ready body:not(.auth-page) aside.sidebar nav.sidebar-nav a[href],
html.jd-16212-menu-click-ready body:not(.auth-page) .sidebar .sidebar-nav a[href],
body.jd-16212-menu-click-ready:not(.auth-page) aside.sidebar nav.sidebar-nav a[href],
body.jd-16212-menu-click-ready:not(.auth-page) .sidebar .sidebar-nav a[href] {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 214748362 !important;
    touch-action: manipulation !important;
}

/* ===== 16.21.3: возвращаем обычное меню без внутренней прокрутки =====
   Меню должно прокручиваться вместе со страницей, а кнопка "Выйти" должна быть внизу бокового блока. */
@media (min-width: 720px) {
    html.jd-16211-menu-click-ready body:not(.auth-page) .dashboard-page,
    body.jd-16211-menu-click-ready:not(.auth-page) .dashboard-page,
    html.jd-16212-menu-click-ready body:not(.auth-page) .dashboard-page,
    body.jd-16212-menu-click-ready:not(.auth-page) .dashboard-page,
    html.jd-162056-menu-ready body:not(.auth-page) .dashboard-page,
    body.jd-162056-menu-ready:not(.auth-page) .dashboard-page,
    body:not(.auth-page) .dashboard-page {
        display: flex !important;
        align-items: stretch !important;
        min-height: 100vh !important;
        overflow: visible !important;
        isolation: isolate !important;
    }

    html.jd-16211-menu-click-ready body:not(.auth-page) .dashboard-page > aside.sidebar,
    html.jd-16211-menu-click-ready body:not(.auth-page) .dashboard-page > .sidebar,
    body.jd-16211-menu-click-ready:not(.auth-page) .dashboard-page > aside.sidebar,
    body.jd-16211-menu-click-ready:not(.auth-page) .dashboard-page > .sidebar,
    html.jd-16212-menu-click-ready body:not(.auth-page) .dashboard-page > aside.sidebar,
    html.jd-16212-menu-click-ready body:not(.auth-page) .dashboard-page > .sidebar,
    body.jd-16212-menu-click-ready:not(.auth-page) .dashboard-page > aside.sidebar,
    body.jd-16212-menu-click-ready:not(.auth-page) .dashboard-page > .sidebar,
    html.jd-162056-menu-ready body:not(.auth-page) .dashboard-page > aside.sidebar,
    html.jd-162056-menu-ready body:not(.auth-page) .dashboard-page > .sidebar,
    body.jd-162056-menu-ready:not(.auth-page) .dashboard-page > aside.sidebar,
    body.jd-162056-menu-ready:not(.auth-page) .dashboard-page > .sidebar,
    body:not(.auth-page) .dashboard-page > aside.sidebar,
    body:not(.auth-page) .dashboard-page > .sidebar {
        flex: 0 0 290px !important;
        width: 290px !important;
        min-width: 290px !important;
        max-width: 290px !important;

        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        inset: auto !important;

        height: auto !important;
        min-height: 100vh !important;
        max-height: none !important;

        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;

        display: flex !important;
        flex-direction: column !important;
        align-self: stretch !important;
        z-index: 214748360 !important;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        isolation: isolate !important;
    }

    html.jd-16212-menu-click-ready body:not(.auth-page) .sidebar .sidebar-nav,
    body.jd-16212-menu-click-ready:not(.auth-page) .sidebar .sidebar-nav,
    html.jd-16211-menu-click-ready body:not(.auth-page) .sidebar .sidebar-nav,
    body.jd-16211-menu-click-ready:not(.auth-page) .sidebar .sidebar-nav,
    html.jd-162056-menu-ready body:not(.auth-page) .sidebar .sidebar-nav,
    body.jd-162056-menu-ready:not(.auth-page) .sidebar .sidebar-nav,
    body:not(.auth-page) .sidebar .sidebar-nav {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        margin-top: 32px !important;
        margin-bottom: 28px !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        flex: 0 0 auto !important;
        position: relative !important;
        z-index: 214748361 !important;
        pointer-events: auto !important;
    }

    html.jd-16212-menu-click-ready body:not(.auth-page) .sidebar .logout-btn,
    body.jd-16212-menu-click-ready:not(.auth-page) .sidebar .logout-btn,
    html.jd-16211-menu-click-ready body:not(.auth-page) .sidebar .logout-btn,
    body.jd-16211-menu-click-ready:not(.auth-page) .sidebar .logout-btn,
    html.jd-162056-menu-ready body:not(.auth-page) .sidebar .logout-btn,
    body.jd-162056-menu-ready:not(.auth-page) .sidebar .logout-btn,
    body:not(.auth-page) .sidebar .logout-btn,
    body:not(.auth-page) .sidebar button.logout-btn {
        position: relative !important;
        inset: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        width: 100% !important;
        min-height: 56px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: auto 0 0 0 !important;
        flex: 0 0 auto !important;
        order: 3 !important;
        transform: none !important;
        pointer-events: auto !important;
        z-index: 214748362 !important;
    }

    html.jd-16212-menu-click-ready body:not(.auth-page) .dashboard-page > .dashboard-content,
    body.jd-16212-menu-click-ready:not(.auth-page) .dashboard-page > .dashboard-content,
    html.jd-16211-menu-click-ready body:not(.auth-page) .dashboard-page > .dashboard-content,
    body.jd-16211-menu-click-ready:not(.auth-page) .dashboard-page > .dashboard-content,
    body:not(.auth-page) .dashboard-page > .dashboard-content {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        position: relative !important;
        z-index: 1 !important;
    }
}

/* ===== 16.21.4: стабильная боковая панель без прыжков и внутренней прокрутки ===== */
@media (min-width: 721px) {
    html body:not(.auth-page) .dashboard-page,
    html.jd-16214-menu-shell body:not(.auth-page) .dashboard-page,
    html.jd-16214-menu-ready body:not(.auth-page) .dashboard-page,
    body.jd-16214-menu-ready:not(.auth-page) .dashboard-page {
        display: flex !important;
        align-items: stretch !important;
        min-height: 100vh !important;
        width: 100% !important;
        overflow: visible !important;
        position: relative !important;
    }

    html body:not(.auth-page) .dashboard-page > aside.sidebar,
    html body:not(.auth-page) .dashboard-page > .sidebar,
    html.jd-16214-menu-shell body:not(.auth-page) .dashboard-page > aside.sidebar,
    html.jd-16214-menu-ready body:not(.auth-page) .dashboard-page > aside.sidebar,
    body.jd-16214-menu-ready:not(.auth-page) .dashboard-page > aside.sidebar,
    body.jd-16214-menu-ready:not(.auth-page) .dashboard-page > .sidebar {
        flex: 0 0 290px !important;
        width: 290px !important;
        min-width: 290px !important;
        max-width: 290px !important;
        min-height: 100vh !important;
        height: auto !important;
        max-height: none !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        inset: auto !important;
        transform: none !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        display: flex !important;
        flex-direction: column !important;
        align-self: stretch !important;
        z-index: 50 !important;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        contain: none !important;
    }

    html body:not(.auth-page) .sidebar > .sidebar-logo,
    html body:not(.auth-page) .sidebar .sidebar-logo {
        flex: 0 0 auto !important;
        position: static !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    html body:not(.auth-page) .sidebar > .sidebar-nav,
    html body:not(.auth-page) .sidebar nav.sidebar-nav,
    html.jd-16214-menu-ready body:not(.auth-page) .sidebar > .sidebar-nav,
    body.jd-16214-menu-ready:not(.auth-page) .sidebar > .sidebar-nav {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        margin-top: 32px !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        position: static !important;
        top: auto !important;
        transform: none !important;
        pointer-events: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 60 !important;
}

    html body:not(.auth-page) .sidebar > .logout-btn,
    html body:not(.auth-page) .sidebar .logout-btn,
    html.jd-16214-menu-ready body:not(.auth-page) .sidebar > .logout-btn,
    body.jd-16214-menu-ready:not(.auth-page) .sidebar > .logout-btn {
        display: block !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        height: auto !important;
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        inset: auto !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 61 !important;
    }

    html body:not(.auth-page) .dashboard-page > .dashboard-content,
    html.jd-16214-menu-ready body:not(.auth-page) .dashboard-page > .dashboard-content,
    body.jd-16214-menu-ready:not(.auth-page) .dashboard-page > .dashboard-content {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        position: relative !important;
        z-index: 1 !important;
    }
}

html.jd-16214-menu-ready body:not(.auth-page) .sidebar-nav a[href],
body.jd-16214-menu-ready:not(.auth-page) .sidebar-nav a[href] {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 62 !important;
    touch-action: manipulation !important;
}

html.jd-16214-menu-ready .jd-mobile-menu-backdrop,
body.jd-16214-menu-ready .jd-mobile-menu-backdrop,
html.jd-16214-menu-ready .menu-backdrop,
body.jd-16214-menu-ready .menu-backdrop,
html.jd-16214-menu-ready .sidebar-backdrop,
body.jd-16214-menu-ready .sidebar-backdrop {
    display: none !important;
    pointer-events: none !important;
}

/* ===== 16.21.5: финальные правила ролей, меню и доступов ===== */
.jd-role-hidden,
[data-jd-role-hidden="1"] {
    display: none !important;
}

body.jd-role-admin .dashboard-action-card[data-admin-only],
body.jd-role-admin .dashboard-action-card[data-supplier-only],
body.jd-role-admin .dashboard-action-card[data-client-only] {
    display: flex;
}

body.jd-role-supplier .dashboard-action-card[data-client-only],
body.jd-role-supplier .dashboard-action-card[data-admin-only],
body.jd-role-regional-client .dashboard-action-card[data-supplier-only],
body.jd-role-regional-client .dashboard-action-card[data-admin-only] {
    display: none !important;
}

/* ===== 16.21.8.2: кнопка "Выйти" строго внизу бокового блока ===== */
@media (min-width: 721px) {
    html body:not(.auth-page) .dashboard-page,
    html.jd-16214-menu-ready body:not(.auth-page) .dashboard-page,
    body.jd-16214-menu-ready:not(.auth-page) .dashboard-page {
        display: flex !important;
        align-items: stretch !important;
        min-height: 100vh !important;
        height: auto !important;
        overflow: visible !important;
    }

    html body:not(.auth-page) .dashboard-page > aside.sidebar,
    html body:not(.auth-page) .dashboard-page > .sidebar,
    html.jd-16214-menu-ready body:not(.auth-page) .dashboard-page > aside.sidebar,
    body.jd-16214-menu-ready:not(.auth-page) .dashboard-page > aside.sidebar,
    body.jd-16214-menu-ready:not(.auth-page) .dashboard-page > .sidebar {
        display: flex !important;
        flex-direction: column !important;
        align-self: stretch !important;
        min-height: 100vh !important;
        height: auto !important;
        overflow: visible !important;
        overflow-y: visible !important;
    }

    html body:not(.auth-page) .sidebar > .sidebar-nav,
    html body:not(.auth-page) .sidebar nav.sidebar-nav,
    html.jd-16214-menu-ready body:not(.auth-page) .sidebar > .sidebar-nav,
    body.jd-16214-menu-ready:not(.auth-page) .sidebar > .sidebar-nav {
        flex: 0 0 auto !important;
        margin-bottom: 28px !important;
    }

    html body:not(.auth-page) .sidebar > .logout-btn,
    html body:not(.auth-page) .sidebar .logout-btn,
    html.jd-16214-menu-ready body:not(.auth-page) .sidebar > .logout-btn,
    body.jd-16214-menu-ready:not(.auth-page) .sidebar > .logout-btn,
    body:not(.auth-page) .sidebar button.logout-btn {
        margin-top: auto !important;
        margin-bottom: 0 !important;
        position: static !important;
        align-self: stretch !important;
        flex: 0 0 auto !important;
        width: 100% !important;
    }
}

/* 16.21.10: защищённые страницы не показывают содержимое без локальной авторизации */
html.jd-auth-protected-pending body {
    visibility: hidden !important;
}

/* ===== 16.21.13: мобильная стабильность, без повторной прогрузки видимой области ===== */
@media (max-width: 980px) {
    html.jd-mobile-stable,
    html.jd-mobile-stable body {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100% !important;
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        background: #eef3f8 !important;
    }

    html.jd-mobile-stable body.jd-mobile-menu-open {
        overflow: hidden !important;
        touch-action: none;
    }

    html.jd-mobile-stable .dashboard-page,
    html.jd-mobile-stable body > .dashboard-page,
    html.jd-mobile-stable .accounting-page,
    html.jd-mobile-stable .internal-market-page,
    html.jd-mobile-stable .supplier-physical-page,
    html.jd-mobile-stable .supplier-clients-page,
    html.jd-mobile-stable .supplier-accounting-page,
    html.jd-mobile-stable .regional-retail-page,
    html.jd-mobile-stable .retail-customer-page {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: visible !important;
        transform: none !important;
        contain: none !important;
        content-visibility: visible !important;
        background: #eef3f8 !important;
    }

    html.jd-mobile-stable .dashboard-content,
    html.jd-mobile-stable main,
    html.jd-mobile-stable section,
    html.jd-mobile-stable .page-content,
    html.jd-mobile-stable .supplier-physical-content,
    html.jd-mobile-stable .supplier-clients-content,
    html.jd-mobile-stable .supplier-accounting-content,
    html.jd-mobile-stable .regional-retail-content,
    html.jd-mobile-stable .retail-customer-content {
        min-height: 0 !important;
        height: auto !important;
        overflow: visible !important;
        transform: none !important;
        contain: none !important;
        content-visibility: visible !important;
        will-change: auto !important;
    }

    html.jd-mobile-stable .sidebar,
    html.jd-mobile-stable .dashboard-page > .sidebar,
    html.jd-mobile-stable aside.sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: auto !important;
        width: min(86vw, 340px) !important;
        max-width: 340px !important;
        min-width: 0 !important;
        height: var(--jd-stable-vh, 100svh) !important;
        min-height: var(--jd-stable-vh, 100svh) !important;
        max-height: var(--jd-stable-vh, 100svh) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch;
        transform: translate3d(-108%, 0, 0) !important;
        transition: none !important;
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    html.jd-mobile-stable body.jd-mobile-menu-open .sidebar,
    html.jd-mobile-stable body.jd-mobile-menu-open .dashboard-page > .sidebar,
    html.jd-mobile-stable body.jd-mobile-menu-open aside.sidebar {
        transform: translate3d(0, 0, 0) !important;
    }

    html.jd-mobile-stable .jd-mobile-menu-toggle,
    html.jd-mobile-stable .jd-mobile-menu-backdrop {
        position: fixed !important;
        transform: translate3d(0, 0, 0) !important;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    html.jd-mobile-stable .jd-mobile-menu-backdrop {
        height: var(--jd-stable-vh, 100svh) !important;
        min-height: var(--jd-stable-vh, 100svh) !important;
        max-height: var(--jd-stable-vh, 100svh) !important;
        transition: none !important;
    }

    html.jd-mobile-stable .sidebar-nav,
    html.jd-mobile-stable .sidebar > .sidebar-nav,
    html.jd-mobile-stable .sidebar > nav.sidebar-nav {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
        flex: 0 0 auto !important;
    }

    html.jd-mobile-stable .logout-btn,
    html.jd-mobile-stable .sidebar > .logout-btn {
        position: static !important;
        margin-top: 18px !important;
        flex: 0 0 auto !important;
    }

    html.jd-mobile-stable .auth-card,
    html.jd-mobile-stable .card,
    html.jd-mobile-stable .dashboard-card,
    html.jd-mobile-stable .dashboard-action-card,
    html.jd-mobile-stable .modal,
    html.jd-mobile-stable .modal-content,
    html.jd-mobile-stable [class*="card"],
    html.jd-mobile-stable [class*="panel"] {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        will-change: auto !important;
    }

    html.jd-mobile-stable .dashboard-action-card,
    html.jd-mobile-stable .card,
    html.jd-mobile-stable [class*="card"],
    html.jd-mobile-stable [class*="panel"] {
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08) !important;
    }

    html.jd-mobile-stable *,
    html.jd-mobile-stable *::before,
    html.jd-mobile-stable *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }

    html.jd-mobile-stable .sidebar *,
    html.jd-mobile-stable .jd-mobile-menu-toggle,
    html.jd-mobile-stable .jd-mobile-menu-backdrop {
        transition: none !important;
    }

    html.jd-mobile-stable .jd-responsive-table,
    html.jd-mobile-stable .inventory-table-wrapper,
    html.jd-mobile-stable .internal-market-table-wrap,
    html.jd-mobile-stable .table-wrapper,
    html.jd-mobile-stable .table-wrap,
    html.jd-mobile-stable .orders-table-wrapper,
    html.jd-mobile-stable .admin-table-wrapper,
    html.jd-mobile-stable .platform-check-table-wrap {
        -webkit-overflow-scrolling: auto !important;
        overscroll-behavior: contain !important;
    }
}

/* ===== 16.21.20.1: срочное исправление кликабельности мобильной версии =====
   Причина: старые аварийные фиксы бокового меню могли оставлять sidebar/backdrop
   поверх контента на телефоне. На мобильном закрытое меню не должно ловить касания. */
@media (max-width: 980px) {
    html.jd-mobile-tap-fixed,
    html.jd-mobile-tap-fixed body {
        touch-action: pan-x pan-y !important;
    }

    html.jd-mobile-tap-fixed body:not(.auth-page) .dashboard-content,
    html.jd-mobile-tap-fixed body:not(.auth-page) main,
    html.jd-mobile-tap-fixed body:not(.auth-page) .page-content,
    html.jd-mobile-tap-fixed body:not(.auth-page) .supplier-physical-content,
    html.jd-mobile-tap-fixed body:not(.auth-page) .supplier-clients-content,
    html.jd-mobile-tap-fixed body:not(.auth-page) .supplier-accounting-content,
    html.jd-mobile-tap-fixed body:not(.auth-page) .regional-retail-content,
    html.jd-mobile-tap-fixed body:not(.auth-page) .retail-customer-content {
        position: relative !important;
        z-index: 1 !important;
        pointer-events: auto !important;
        touch-action: auto !important;
    }

    html.jd-mobile-tap-fixed body:not(.jd-mobile-menu-open):not(.auth-page) .sidebar,
    html.jd-mobile-tap-fixed body:not(.jd-mobile-menu-open):not(.auth-page) aside.sidebar,
    html.jd-mobile-tap-fixed body:not(.jd-mobile-menu-open):not(.auth-page) .dashboard-page > .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: min(86vw, 340px) !important;
        max-width: 340px !important;
        height: var(--jd-stable-vh, 100svh) !important;
        max-height: var(--jd-stable-vh, 100svh) !important;
        transform: translate3d(-110%, 0, 0) !important;
        pointer-events: none !important;
        z-index: 10010 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    html.jd-mobile-tap-fixed body.jd-mobile-menu-open:not(.auth-page) .sidebar,
    html.jd-mobile-tap-fixed body.jd-mobile-menu-open:not(.auth-page) aside.sidebar,
    html.jd-mobile-tap-fixed body.jd-mobile-menu-open:not(.auth-page) .dashboard-page > .sidebar {
        position: fixed !important;
        transform: translate3d(0, 0, 0) !important;
        pointer-events: auto !important;
        z-index: 10030 !important;
    }

    html.jd-mobile-tap-fixed body:not(.jd-mobile-menu-open) .jd-mobile-menu-backdrop,
    html.jd-mobile-tap-fixed body:not(.jd-mobile-menu-open) .menu-backdrop,
    html.jd-mobile-tap-fixed body:not(.jd-mobile-menu-open) .sidebar-backdrop {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    html.jd-mobile-tap-fixed body.jd-mobile-menu-open .jd-mobile-menu-backdrop {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        z-index: 10020 !important;
    }

    html.jd-mobile-tap-fixed .jd-mobile-menu-toggle {
        z-index: 10040 !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }

    html.jd-mobile-tap-fixed button,
    html.jd-mobile-tap-fixed a[href],
    html.jd-mobile-tap-fixed input,
    html.jd-mobile-tap-fixed select,
    html.jd-mobile-tap-fixed textarea,
    html.jd-mobile-tap-fixed label,
    html.jd-mobile-tap-fixed [role="button"],
    html.jd-mobile-tap-fixed .clickable,
    html.jd-mobile-tap-fixed .catalog-result-item,
    html.jd-mobile-tap-fixed .jd-product-request-open {
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }
}

/* ===== 16.21.20.2: финальная мобильная кликабельность ===== */
@media (max-width: 980px) {
    html.jd-mobile-click-final,
    html.jd-mobile-click-final body {
        touch-action: pan-x pan-y !important;
        overflow-x: hidden !important;
    }

    html.jd-mobile-click-final body:not(.auth-page):not(.jd-mobile-menu-open) .sidebar,
    html.jd-mobile-click-final body:not(.auth-page):not(.jd-mobile-menu-open) aside.sidebar,
    html.jd-mobile-click-final body:not(.auth-page):not(.jd-mobile-menu-open) .dashboard-page > .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -120vw !important;
        width: min(86vw, 340px) !important;
        max-width: 340px !important;
        min-width: 0 !important;
        height: var(--jd-stable-vh, 100svh) !important;
        min-height: var(--jd-stable-vh, 100svh) !important;
        max-height: var(--jd-stable-vh, 100svh) !important;
        transform: translate3d(0, 0, 0) !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        touch-action: none !important;
        z-index: -1 !important;
    }

    html.jd-mobile-click-final body.jd-mobile-menu-open:not(.auth-page) .sidebar,
    html.jd-mobile-click-final body.jd-mobile-menu-open:not(.auth-page) aside.sidebar,
    html.jd-mobile-click-final body.jd-mobile-menu-open:not(.auth-page) .dashboard-page > .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: min(86vw, 340px) !important;
        max-width: 340px !important;
        min-width: 0 !important;
        height: var(--jd-stable-vh, 100svh) !important;
        min-height: var(--jd-stable-vh, 100svh) !important;
        max-height: var(--jd-stable-vh, 100svh) !important;
        transform: translate3d(0, 0, 0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        touch-action: auto !important;
        z-index: 214748340 !important;
    }

    html.jd-mobile-click-final body:not(.jd-mobile-menu-open) .jd-mobile-menu-backdrop,
    html.jd-mobile-click-final body:not(.jd-mobile-menu-open) .menu-backdrop,
    html.jd-mobile-click-final body:not(.jd-mobile-menu-open) .sidebar-backdrop {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        z-index: -1 !important;
    }

    html.jd-mobile-click-final body.jd-mobile-menu-open .jd-mobile-menu-backdrop {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 214748330 !important;
    }

    html.jd-mobile-click-final body:not(.auth-page) .dashboard-content,
    html.jd-mobile-click-final body:not(.auth-page) main,
    html.jd-mobile-click-final body:not(.auth-page) .page-content,
    html.jd-mobile-click-final body:not(.auth-page) .content,
    html.jd-mobile-click-final body:not(.auth-page) .main-content,
    html.jd-mobile-click-final body:not(.auth-page) .supplier-physical-content,
    html.jd-mobile-click-final body:not(.auth-page) .supplier-clients-content,
    html.jd-mobile-click-final body:not(.auth-page) .supplier-accounting-content,
    html.jd-mobile-click-final body:not(.auth-page) .regional-retail-content,
    html.jd-mobile-click-final body:not(.auth-page) .retail-customer-content,
    html.jd-mobile-click-final body:not(.auth-page) .internal-market-content {
        position: relative !important;
        z-index: 10 !important;
        pointer-events: auto !important;
        touch-action: auto !important;
    }

    html.jd-mobile-click-final .jd-mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        z-index: 214748350 !important;
    }

    html.jd-mobile-click-final button,
    html.jd-mobile-click-final a[href],
    html.jd-mobile-click-final input,
    html.jd-mobile-click-final select,
    html.jd-mobile-click-final textarea,
    html.jd-mobile-click-final label,
    html.jd-mobile-click-final [role="button"],
    html.jd-mobile-click-final .clickable,
    html.jd-mobile-click-final .catalog-result-item,
    html.jd-mobile-click-final .jd-product-request-open,
    html.jd-mobile-click-final .dashboard-action-card {
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }
}

/* ===== 16.21.20.3: чистая мобильная кликабельность без перехвата касаний ===== */
@media (max-width: 980px) {
    html.jd-mobile-clean-clicks,
    html.jd-mobile-clean-clicks body {
        touch-action: pan-x pan-y !important;
        overflow-x: hidden !important;
    }

    html.jd-mobile-clean-clicks body:not(.auth-page) .dashboard-page {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        min-width: 0 !important;
        isolation: auto !important;
    }

    html.jd-mobile-clean-clicks body:not(.auth-page):not(.jd-mobile-menu-open) .sidebar,
    html.jd-mobile-clean-clicks body:not(.auth-page):not(.jd-mobile-menu-open) aside.sidebar,
    html.jd-mobile-clean-clicks body:not(.auth-page):not(.jd-mobile-menu-open) .dashboard-page > .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -110vw !important;
        right: auto !important;
        bottom: auto !important;
        width: min(86vw, 340px) !important;
        max-width: 340px !important;
        min-width: 0 !important;
        height: var(--jd-stable-vh, 100svh) !important;
        min-height: var(--jd-stable-vh, 100svh) !important;
        max-height: var(--jd-stable-vh, 100svh) !important;
        transform: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        touch-action: none !important;
        z-index: 0 !important;
    }

    html.jd-mobile-clean-clicks body.jd-mobile-menu-open:not(.auth-page) .sidebar,
    html.jd-mobile-clean-clicks body.jd-mobile-menu-open:not(.auth-page) aside.sidebar,
    html.jd-mobile-clean-clicks body.jd-mobile-menu-open:not(.auth-page) .dashboard-page > .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        bottom: auto !important;
        width: min(86vw, 340px) !important;
        max-width: 340px !important;
        min-width: 0 !important;
        height: var(--jd-stable-vh, 100svh) !important;
        min-height: var(--jd-stable-vh, 100svh) !important;
        max-height: var(--jd-stable-vh, 100svh) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        touch-action: auto !important;
        z-index: 10030 !important;
    }

    html.jd-mobile-clean-clicks body:not(.jd-mobile-menu-open) .jd-mobile-menu-backdrop,
    html.jd-mobile-clean-clicks body:not(.jd-mobile-menu-open) .menu-backdrop,
    html.jd-mobile-clean-clicks body:not(.jd-mobile-menu-open) .sidebar-backdrop {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        z-index: 0 !important;
    }

    html.jd-mobile-clean-clicks body.jd-mobile-menu-open .jd-mobile-menu-backdrop {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 10020 !important;
    }

    html.jd-mobile-clean-clicks body:not(.auth-page) .dashboard-content,
    html.jd-mobile-clean-clicks body:not(.auth-page) main,
    html.jd-mobile-clean-clicks body:not(.auth-page) .page-content,
    html.jd-mobile-clean-clicks body:not(.auth-page) .content,
    html.jd-mobile-clean-clicks body:not(.auth-page) .main-content,
    html.jd-mobile-clean-clicks body:not(.auth-page) .supplier-physical-content,
    html.jd-mobile-clean-clicks body:not(.auth-page) .supplier-clients-content,
    html.jd-mobile-clean-clicks body:not(.auth-page) .supplier-accounting-content,
    html.jd-mobile-clean-clicks body:not(.auth-page) .regional-retail-content,
    html.jd-mobile-clean-clicks body:not(.auth-page) .retail-customer-content,
    html.jd-mobile-clean-clicks body:not(.auth-page) .internal-market-content {
        position: relative !important;
        z-index: auto !important;
        pointer-events: auto !important;
        touch-action: auto !important;
    }

    html.jd-mobile-clean-clicks .jd-mobile-menu-toggle {
        display: inline-flex !important;
        position: fixed !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        z-index: 10040 !important;
    }

    html.jd-mobile-clean-clicks button,
    html.jd-mobile-clean-clicks a[href],
    html.jd-mobile-clean-clicks input,
    html.jd-mobile-clean-clicks select,
    html.jd-mobile-clean-clicks textarea,
    html.jd-mobile-clean-clicks label,
    html.jd-mobile-clean-clicks [role="button"],
    html.jd-mobile-clean-clicks .clickable,
    html.jd-mobile-clean-clicks .catalog-result-item,
    html.jd-mobile-clean-clicks .jd-product-request-open,
    html.jd-mobile-clean-clicks .dashboard-action-card {
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }
}

/* JD Group 16.23.3 — закупка под заявку по ручной внешней позиции */
body.admin-orders-page .external-procurement-box {
    border-style: dashed;
}

body.admin-orders-page .external-procurement-summary {
    margin-top: 10px;
}

body.admin-orders-page .external-procurement-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

body.admin-orders-page .external-procurement-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body.admin-orders-page .external-procurement-form input,
body.admin-orders-page .external-procurement-form textarea {
    width: 100%;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
}

body.admin-orders-page .external-procurement-form textarea {
    min-height: 92px;
    resize: vertical;
}

body.admin-orders-page .external-procurement-wide {
    grid-column: 1 / -1;
}

body.admin-orders-page .external-procurement-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

@media (max-width: 760px) {
    body.admin-orders-page .external-procurement-form {
        grid-template-columns: 1fr;
    }

    body.admin-orders-page .external-procurement-actions {
        justify-content: stretch;
    }

    body.admin-orders-page .external-procurement-actions .regional-procurement-btn {
        width: 100%;
    }
}

/* JD Group 16.23.3.1 — читаемая светлая форма закупки под заявку */
body.admin-orders-page .external-procurement-box {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    border: 1px dashed #bcd4f4 !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06) !important;
}

body.admin-orders-page .external-procurement-box .regional-procurement-head strong {
    color: #0f172a !important;
}

body.admin-orders-page .external-procurement-box .regional-procurement-note {
    background: #eef4fb !important;
    color: #475569 !important;
}

body.admin-orders-page .external-procurement-form {
    background: #ffffff !important;
    border: 1px solid #dde8f6 !important;
    border-radius: 18px !important;
    padding: 14px !important;
}

body.admin-orders-page .external-procurement-form label {
    color: #1f2f46 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
}

body.admin-orders-page .external-procurement-form input,
body.admin-orders-page .external-procurement-form textarea {
    background: #ffffff !important;
    border: 1px solid #cfdbea !important;
    color: #0f172a !important;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03) !important;
}

body.admin-orders-page .external-procurement-form input::placeholder,
body.admin-orders-page .external-procurement-form textarea::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}

body.admin-orders-page .external-procurement-form input:focus,
body.admin-orders-page .external-procurement-form textarea:focus {
    border-color: #94c5ff !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10) !important;
}

body.admin-orders-page .external-procurement-summary p {
    background: #f1f6fc !important;
    border-color: #e1eaf5 !important;
}

body.admin-orders-page .external-procurement-summary span {
    color: #64748b !important;
}

body.admin-orders-page .external-procurement-summary strong {
    color: #0f172a !important;
}

/* =========================================================
   JD Group 16.23.3.5: аккуратная строка заявки клиента
   ========================================================= */
body.my-orders-page .client-orders-list {
    gap: 12px;
}

body.my-orders-page .client-order-row-card {
    width: 100%;
    flex: 0 0 auto;
    min-height: 112px;
    display: grid;
    grid-template-columns: minmax(210px, 1.05fr) minmax(360px, 2fr) minmax(165px, 0.75fr) minmax(142px, auto);
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f5f9ff 100%);
    border: 1px solid #dfe8f3;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

/* Карточки заявок сохраняют полную высоту, а прокручивается сам список. */
body.my-orders-page #myOrdersList > .client-order-summary-card {
    flex-shrink: 0 !important;
}

@media (min-width: 1025px) {
    body.my-orders-page .my-orders-card {
        min-height: 860px !important;
        height: auto !important;
    }

    body.my-orders-page #myOrdersList,
    body.my-orders-page .my-orders-list,
    body.my-orders-page .client-orders-list {
        height: 720px !important;
        min-height: 720px !important;
        max-height: 720px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        align-content: flex-start;
    }
}

body.my-orders-page .client-order-row-card:hover {
    background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
    border-color: #c9ddf4;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.09);
    transform: translateY(-1px);
}

body.my-orders-page .client-order-row-card:focus-visible {
    outline: 3px solid rgba(0, 122, 255, 0.22);
    outline-offset: 3px;
}

body.my-orders-page .client-order-row-card.has-admin-changes {
    padding-right: 58px;
    border-color: rgba(255, 77, 79, 0.34);
}

body.my-orders-page .client-order-row-main,
body.my-orders-page .client-order-row-title,
body.my-orders-page .client-order-row-statuses,
body.my-orders-page .client-order-row-total,
body.my-orders-page .client-order-row-action {
    min-width: 0;
}

body.my-orders-page .client-order-row-title h3 {
    margin: 5px 0 6px;
    color: #0f172a;
    font-size: 22px;
    line-height: 1.1;
    white-space: nowrap;
}

body.my-orders-page .client-order-row-title p {
    margin: 0;
    color: #64748b;
    font-size: 15px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.my-orders-page .client-order-row-title strong {
    color: #0f172a;
    font-weight: 900;
}

body.my-orders-page .client-order-row-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

body.my-orders-page .client-order-compact-chip {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 102px;
    max-width: 155px;
    min-height: 48px;
    padding: 8px 11px;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
}

body.my-orders-page .client-order-compact-chip small {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

body.my-orders-page .client-order-compact-chip strong {
    display: block;
    color: inherit;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.my-orders-page .client-order-compact-chip.is-primary {
    background: #eef6ff;
    border-color: #cfe4ff;
    color: #0f63d8;
}

body.my-orders-page .client-order-compact-chip.is-good {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #15803d;
}

body.my-orders-page .client-order-compact-chip.is-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

body.my-orders-page .client-order-compact-chip.is-danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

body.my-orders-page .client-order-compact-chip.is-muted {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

body.my-orders-page .client-order-row-total {
    text-align: right;
}

body.my-orders-page .client-order-row-total span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body.my-orders-page .client-order-row-total strong {
    display: block;
    margin-top: 3px;
    color: #0f172a;
    font-size: 23px;
    font-weight: 950;
    line-height: 1.05;
    white-space: nowrap;
}

body.my-orders-page .client-order-row-total p,
body.my-orders-page .client-order-row-total em {
    display: block;
    margin: 5px 0 0;
    color: #64748b;
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
    line-height: 1.25;
}

body.my-orders-page .client-order-row-total em {
    color: #be123c;
}

body.my-orders-page .client-order-row-total em.is-paid {
    color: #15803d;
}

body.my-orders-page .client-order-row-action {
    display: flex;
    justify-content: flex-end;
}

body.my-orders-page .client-open-order-btn {
    min-width: 132px;
    min-height: 46px;
    padding: 11px 16px;
    border-radius: 16px;
    text-align: center;
    white-space: normal;
    line-height: 1.15;
}

body.my-orders-page .client-order-row-card .order-admin-change-badge {
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    min-width: 32px;
}

body.my-orders-page .order-modal {
    max-width: 980px;
}

body.my-orders-page .modal-products-list .client-order-details-panel {
    margin-bottom: 4px;
}

@media (max-width: 1250px) {
    body.my-orders-page .client-order-row-card {
        grid-template-columns: minmax(220px, 1fr) minmax(160px, auto) minmax(132px, auto);
    }

    body.my-orders-page .client-order-row-statuses {
        grid-column: 1 / -1;
        order: 4;
    }

    body.my-orders-page .client-order-row-total {
        order: 2;
    }

    body.my-orders-page .client-order-row-action {
        order: 3;
    }
}

@media (max-width: 760px) {
    body.my-orders-page .client-order-row-card,
    body.my-orders-page .client-order-row-card.has-admin-changes {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    body.my-orders-page .client-order-row-title h3,
    body.my-orders-page .client-order-row-title p {
        white-space: normal;
    }

    body.my-orders-page .client-order-row-statuses {
        grid-column: auto;
        order: initial;
    }

    body.my-orders-page .client-order-compact-chip {
        min-width: calc(50% - 4px);
        max-width: none;
        flex: 1 1 calc(50% - 4px);
    }

    body.my-orders-page .client-order-row-total {
        text-align: left;
    }

    body.my-orders-page .client-order-row-action,
    body.my-orders-page .client-open-order-btn {
        width: 100%;
    }
}

/* =========================================================
   JD Group 16.23.5: полноценная закупка под заявку
   ========================================================= */
body.admin-orders-page .external-procurement-form select {
    width: 100%;
    border: 1px solid #cfdbea !important;
    border-radius: 12px;
    padding: 10px 12px;
    background: #ffffff !important;
    color: #0f172a !important;
    font: inherit;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03) !important;
}

body.admin-orders-page .external-procurement-form select:focus {
    border-color: #94c5ff !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10) !important;
}

body.admin-orders-page .external-procurement-live-preview {
    background: #f8fbff;
    border: 1px solid #dce8f6;
    border-radius: 18px;
    padding: 12px;
}

body.admin-orders-page .external-procurement-live-preview > strong {
    display: block;
    margin-bottom: 10px;
    color: #0f172a;
    font-weight: 900;
}

body.admin-orders-page .external-procurement-live-preview .external-procurement-summary {
    margin-top: 0;
}

/* =========================================================
   JD Group 16.23.18.3 — заявка: аккуратный IMEI-блок и автообновление
   ========================================================= */
.orders-live-status {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    margin: 8px 0 0 !important;
    padding: 7px 11px !important;
    border-radius: 999px !important;
    background: #eef6ff !important;
    color: #2563eb !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
}

.orders-live-status::before {
    content: "" !important;
    width: 7px !important;
    height: 7px !important;
    border-radius: 999px !important;
    background: currentColor !important;
    opacity: 0.8 !important;
}

.orders-live-status.is-ok {
    background: #ecfdf3 !important;
    color: #15803d !important;
}

.orders-live-status.is-loading {
    background: #fff7ed !important;
    color: #c2410c !important;
}

.orders-live-status.is-error {
    background: #fff1f2 !important;
    color: #be123c !important;
}

body.admin-orders-page .regional-procurement-imei-box {
    margin-top: 16px !important;
    padding: 16px !important;
    border: 1px solid #dbeafe !important;
    border-radius: 18px !important;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%) !important;
    overflow: hidden !important;
}

body.admin-orders-page .regional-procurement-imei-box .regional-procurement-note {
    margin-top: 12px !important;
}

body.admin-orders-page .regional-procurement-imei-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin: 14px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

body.admin-orders-page .regional-procurement-imei-item {
    display: grid !important;
    grid-template-columns: minmax(210px, 1.2fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) !important;
    gap: 10px !important;
    align-items: stretch !important;
    margin: 0 !important;
    padding: 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
}

body.admin-orders-page .regional-procurement-imei-item > div {
    min-width: 0 !important;
    padding: 10px 12px !important;
    border-radius: 13px !important;
    background: #f1f6fc !important;
}

body.admin-orders-page .regional-procurement-imei-item span,
body.admin-orders-page .regional-procurement-imei-replace label > span,
body.admin-orders-page .regional-procurement-imei-replace-head span {
    display: block !important;
    margin: 0 0 5px !important;
    color: #64748b !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.045em !important;
}

body.admin-orders-page .regional-procurement-imei-item strong {
    display: block !important;
    color: #0f172a !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
}

body.admin-orders-page .regional-procurement-imei-replace {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
    align-items: end !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin-top: 14px !important;
    padding: 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 18px !important;
    background: #f8fafc !important;
    overflow: hidden !important;
}

body.admin-orders-page .regional-procurement-imei-replace-head {
    grid-column: 1 / -1 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
    min-width: 0 !important;
    padding-bottom: 4px !important;
}

body.admin-orders-page .regional-procurement-imei-replace-head strong {
    min-width: 0 !important;
    color: #0f172a !important;
    font-size: 16px !important;
    font-weight: 950 !important;
    overflow-wrap: anywhere !important;
}

body.admin-orders-page .regional-procurement-imei-replace-head span {
    flex: 1 1 260px !important;
    min-width: 0 !important;
    text-align: right !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

body.admin-orders-page .regional-procurement-imei-replace label {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 13px !important;
    font-weight: 900 !important;
}

body.admin-orders-page .regional-procurement-imei-replace input,
body.admin-orders-page .regional-procurement-imei-replace select {
    width: 100% !important;
    min-width: 0 !important;
    height: 46px !important;
    padding: 0 13px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font: inherit !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    outline: none !important;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03) !important;
}

body.admin-orders-page .regional-procurement-imei-replace input:focus,
body.admin-orders-page .regional-procurement-imei-replace select:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12) !important;
}

body.admin-orders-page .regional-procurement-imei-replace-btn {
    grid-column: 1 / -1 !important;
    justify-self: end !important;
    width: auto !important;
    min-width: 220px !important;
    max-width: 100% !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 22px !important;
    white-space: nowrap !important;
}

body.admin-orders-page .regional-procurement-note,
body.admin-orders-page .regional-procurement-warning,
body.admin-orders-page .regional-procurement-success {
    overflow-wrap: anywhere !important;
}

body.admin-orders-page .admin-product-main > p,
body.admin-orders-page .modal-product-item.admin-product-decision > p {
    line-height: 1.35 !important;
}

body.admin-orders-page .order-modal-overlay,
body.my-orders-page .order-modal-overlay {
    scroll-behavior: smooth !important;
}

@media (max-width: 1180px) {
    body.admin-orders-page .regional-procurement-imei-replace {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.admin-orders-page .regional-procurement-imei-replace-btn {
        width: 100% !important;
        grid-column: 1 / -1 !important;
        justify-self: stretch !important;
    }
}

@media (max-width: 760px) {
    body.admin-orders-page .regional-procurement-imei-item,
    body.admin-orders-page .regional-procurement-imei-replace {
        grid-template-columns: 1fr !important;
    }

    body.admin-orders-page .regional-procurement-imei-replace-head {
        display: block !important;
    }

    body.admin-orders-page .regional-procurement-imei-replace-head span {
        margin-top: 6px !important;
    }

    body.admin-orders-page .regional-procurement-imei-replace-btn {
        grid-column: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        justify-self: stretch !important;
        white-space: normal !important;
    }

    .orders-live-status {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }
}

/* 16.23.22 — полуавтовыкуп в карточке заявки */
body.admin-orders-page .semi-auto-procurement-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.88);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

body.admin-orders-page .semi-auto-procurement-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

body.admin-orders-page .semi-auto-procurement-head strong {
    font-size: 15px;
    color: #111827;
}

body.admin-orders-page .semi-auto-procurement-comment {
    display: grid;
    gap: 7px;
    margin: 10px 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

body.admin-orders-page .semi-auto-procurement-comment textarea {
    width: 100%;
    min-height: 78px;
    resize: vertical;
    box-sizing: border-box;
    border: 1px solid rgba(148, 163, 184, 0.75);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.35;
    color: #111827;
    background: #ffffff;
    outline: none;
}

body.admin-orders-page .semi-auto-procurement-comment textarea:focus {
    border-color: rgba(37, 99, 235, 0.85);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.admin-orders-page .semi-auto-procurement-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

body.admin-orders-page .semi-auto-procurement-actions button {
    max-width: 100%;
    white-space: normal;
}

body.admin-orders-page .regional-procurement-secondary-btn,
body.admin-orders-page .regional-procurement-danger-btn {
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    min-height: 42px;
    cursor: pointer;
    font-weight: 800;
    font-size: 13px;
}

body.admin-orders-page .regional-procurement-secondary-btn {
    background: #e5e7eb;
    color: #111827;
}

body.admin-orders-page .regional-procurement-danger-btn {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 760px) {
    body.admin-orders-page .semi-auto-procurement-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    body.admin-orders-page .semi-auto-procurement-actions button {
        width: 100%;
    }
}

/* JD Group 16.23.24 — финансы региональной заявки */
.order-finance-panel .regional-procurement-grid strong,
.payment-order-finance-panel strong {
    overflow-wrap: anywhere;
}

.payment-order-finance-panel {
    margin: 16px 0;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.03);
}

.payment-order-finance-grid {
    margin-top: 10px;
}

.danger-text {
    color: #dc2626 !important;
}

/* JD Group 16.23.25 — отмены, возвраты, обмены и откаты */
.order-reversal-panel {
    border-color: rgba(244, 63, 94, 0.22);
}

.order-reversal-panel.is-canceled {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.08), rgba(255, 255, 255, 0.98));
}

.order-reversal-panel.is-exchange {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.98));
}

.order-reversal-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.order-reversal-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    font-size: 13px;
    color: #64748b;
}

.order-reversal-form label span {
    font-weight: 700;
    color: #334155;
}

.order-reversal-form input,
.order-reversal-form select {
    width: 100%;
    min-width: 0;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
    color: #0f172a;
}

.order-reversal-submit {
    min-height: 42px;
    align-self: end;
}

.order-reversal-preview {
    margin-top: 12px;
}

.client-order-reversal-box {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin: 14px 0;
    padding: 14px;
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: 16px;
    background: rgba(244, 63, 94, 0.06);
}

.client-order-reversal-box h4 {
    margin: 4px 0;
}

.client-order-reversal-box p {
    margin: 0;
    color: #64748b;
}

.client-order-reversal-box strong {
    white-space: nowrap;
    color: #be123c;
}

@media (max-width: 760px) {
    .order-reversal-form {
        grid-template-columns: 1fr;
    }

    .order-reversal-submit {
        width: 100%;
    }

    .client-order-reversal-box {
        flex-direction: column;
    }

    .client-order-reversal-box strong {
        white-space: normal;
    }
}

/* ===== 16.23.26: внутренние уведомления сайта ===== */
.jd-site-notification-bell {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: #111827;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
    cursor: pointer;
    z-index: 214748200;
    text-decoration: none;
    font-size: 22px;
}
.jd-site-notification-bell:hover { transform: translateY(-1px); }
.jd-site-notification-bell-badge,
.jd-menu-notification-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.jd-site-notification-bell-badge.is-hidden,
.jd-menu-notification-badge.is-hidden { display: none; }
.sidebar-nav a[href="notifications.html"] { position: relative; }
.jd-menu-notification-badge { margin-left: auto; }

@keyframes jdNotifyToastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.jd-notifications-toolbar { align-items: flex-start; gap: 18px; }
.jd-notifications-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.jd-notifications-select,
.jd-notifications-toggle {
    min-height: 42px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    padding: 0 14px;
    font-weight: 700;
}
.jd-notifications-toggle { display: inline-flex; align-items: center; gap: 8px; }
.jd-notifications-list { display: grid; gap: 12px; margin-top: 18px; }
.jd-notification-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #94a3b8;
    border-radius: 18px;
    background: #fff;
}
.jd-notification-card.is-unread { background: #f8fbff; border-color: #bfdbfe; }
.jd-notification-card.success { border-left-color: #22c55e; }
.jd-notification-card.warning { border-left-color: #f59e0b; }
.jd-notification-card.danger { border-left-color: #ef4444; }
.jd-notification-topline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.jd-notification-type { color: #2563eb; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.jd-notification-date { color: #64748b; font-size: 12px; }
.jd-notification-card h3 { margin: 0 0 6px; font-size: 16px; color: #0f172a; }
.jd-notification-card p { margin: 0; color: #475569; line-height: 1.45; }
.jd-notification-card-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.jd-notification-link,
.jd-notification-read-btn {
    min-height: 38px;
    border-radius: 12px;
    border: 1px solid #dbe4f0;
    background: #fff;
    color: #0f172a;
    padding: 9px 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}
.jd-notification-link { background: #111827; color: #fff; border-color: #111827; }
@media (max-width: 780px) {
    .jd-site-notification-bell { right: 14px; bottom: 14px; width: 50px; height: 50px; }
    
    .jd-notification-card { grid-template-columns: 1fr; }
    .jd-notification-card-actions { justify-content: stretch; }
    .jd-notification-link, .jd-notification-read-btn { width: 100%; text-align: center; }
    .jd-notifications-actions { justify-content: stretch; }
    .jd-notifications-select, .jd-notifications-toggle, .jd-notifications-actions .telegram-btn { width: 100%; }
}

/* ===== 16.23.26.6: dashboard menu stabilization ===== */
html.jd-dashboard-menu-stable-16-23-26-6 .dashboard-page > .sidebar,
body.jd-dashboard-menu-stable-16-23-26-6 .dashboard-page > .sidebar,
body.jd-dashboard-menu-stable-16-23-26-6 aside.sidebar {
    display: flex !important;
    flex-direction: column !important;
    width: 290px !important;
    min-width: 290px !important;
    flex: 0 0 290px !important;
    min-height: 100vh !important;
    align-self: flex-start !important;
    position: sticky !important;
    top: 0 !important;
    overflow: visible !important;
}

body.jd-dashboard-menu-stable-16-23-26-6 .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-top: 32px !important;
    overflow: visible !important;
}

body.jd-dashboard-menu-stable-16-23-26-6 .sidebar-nav a[href="notifications.html"] {
    display: flex !important;
    align-items: center !important;
}

body.jd-dashboard-menu-stable-16-23-26-6 .sidebar-nav .jd-menu-notification-badge,
body.jd-dashboard-menu-stable-16-23-26-6 .sidebar-nav .admin-menu-badge,
body.jd-dashboard-menu-stable-16-23-26-6 .sidebar-nav .chat-unread-badge,
body.jd-dashboard-menu-stable-16-23-26-6 .sidebar-nav .my-orders-unread-badge {
    display: none !important;
}

body.jd-dashboard-menu-stable-16-23-26-6 .logout-btn {
    margin-top: auto !important;
}

@media (max-width: 900px) {
    html.jd-dashboard-menu-stable-16-23-26-6 .dashboard-page > .sidebar,
    body.jd-dashboard-menu-stable-16-23-26-6 .dashboard-page > .sidebar,
    body.jd-dashboard-menu-stable-16-23-26-6 aside.sidebar {
        position: sticky !important;
        top: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
        min-height: 0 !important;
    }

    body.jd-dashboard-menu-stable-16-23-26-6 .sidebar-nav {
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }
}

/* ===== 16.23.27.1: безопасная основа Telegram на странице уведомлений ===== */
.jd-telegram-panel {
    margin-bottom: 18px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.98));
}
.jd-telegram-panel-head { align-items: flex-start; gap: 18px; }
.jd-telegram-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.jd-telegram-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.jd-telegram-status-card {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    background: #fff;
    padding: 14px;
}
.jd-telegram-status-card span,
.jd-telegram-code-card span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 5px;
}
.jd-telegram-status-card strong {
    color: #0f172a;
    font-size: 16px;
    word-break: break-word;
}
.jd-telegram-link-box { margin-top: 14px; }
.jd-telegram-link-box.is-hidden { display: none; }
.jd-telegram-code-card {
    border: 1px dashed rgba(37, 99, 235, 0.38);
    border-radius: 18px;
    background: #fff;
    padding: 16px;
    display: grid;
    gap: 10px;
}
.jd-telegram-code-card strong {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    border-radius: 14px;
    background: #111827;
    color: #fff;
    padding: 10px 14px;
    font-size: 22px;
    letter-spacing: 0.06em;
    word-break: break-all;
}
.jd-telegram-code-card p,
.jd-telegram-note {
    margin: 0;
    color: #475569;
    line-height: 1.5;
}
.jd-telegram-note { margin-top: 12px; font-size: 13px; }
#telegramStatusText.is-error { color: #b91c1c; font-weight: 800; }
@media (max-width: 780px) {
    .jd-telegram-panel-head { flex-direction: column; }
    .jd-telegram-actions { width: 100%; justify-content: stretch; }
    .jd-telegram-actions .telegram-btn { width: 100%; }
    .jd-telegram-status-grid { grid-template-columns: 1fr; }
}

/* ===== 16.23.27.5: аккуратное оформление Telegram-кода ===== */
.jd-telegram-code-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.jd-telegram-code-main {
    display: grid;
    gap: 8px;
    min-width: 0;
}
.jd-telegram-code-card .jd-telegram-code-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    border-radius: 14px;
    background: #111827;
    color: #fff;
    padding: 10px 16px;
    font-size: 22px;
    letter-spacing: 0.06em;
    line-height: 1.1;
    word-break: break-all;
}
.jd-telegram-copy-btn {
    min-height: 42px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.jd-telegram-copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.12);
    background: rgba(37, 99, 235, 0.12);
}
.jd-telegram-copy-btn.is-copied {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.26);
    color: #15803d;
}
.jd-telegram-code-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 2px;
}
.jd-telegram-code-card .jd-telegram-open-bot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 44px;
    border-radius: 14px;
    padding: 12px 18px;
    justify-self: flex-start;
}
.jd-telegram-code-expire {
    display: inline-flex !important;
    align-items: center;
    min-height: 36px;
    margin: 0 !important;
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
@media (max-width: 780px) {
    .jd-telegram-code-head {
        flex-direction: column;
    }
    .jd-telegram-copy-btn,
    .jd-telegram-code-card .jd-telegram-open-bot {
        width: 100%;
    }
    .jd-telegram-code-card .jd-telegram-code-value {
        width: 100%;
    }
}

/* ===== 16.23.27.6: проверка привязки Telegram после отправки кода боту ===== */
.jd-telegram-code-card .jd-telegram-check-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 44px;
    border-radius: 14px;
    padding: 12px 18px;
    justify-self: flex-start;
}
@media (max-width: 780px) {
    .jd-telegram-code-card .jd-telegram-check-link {
        width: 100%;
    }
}

/* ===== 16.23.27.6.3: автопроверка Telegram-привязки ===== */
.jd-telegram-wait-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin-top: 2px !important;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8 !important;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 800;
}
.jd-telegram-wait-status.is-error {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c !important;
}

/* ===== 16.23.27.8: аккуратные состояния Telegram-уведомлений ===== */
.jd-telegram-status-card.is-ok {
    border-color: rgba(34, 197, 94, 0.26);
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.96), #fff);
}
.jd-telegram-status-card.is-warning {
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), #fff);
}
.jd-telegram-status-card.is-muted {
    border-color: rgba(148, 163, 184, 0.24);
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.96), #fff);
}
.jd-telegram-status-card.is-ok strong { color: #15803d; }
.jd-telegram-status-card.is-warning strong { color: #b45309; }
.jd-telegram-status-card.is-muted strong { color: #475569; }
#telegramToggleEnabled.is-enabled {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    border-color: rgba(22, 163, 74, 0.28);
    box-shadow: 0 12px 26px rgba(22, 163, 74, 0.18);
}
.jd-telegram-code-card.is-error {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(254, 242, 242, 0.96);
}

/* v0.9.5.2 — локальная нумерация заявок поставщика */
.admin-order-number-heading,
.admin-order-number-cell { width: 74px; min-width: 74px; text-align: center; }
.admin-order-number-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; height: 44px; padding: 0 10px; border-radius: 14px;
    background: #eef4ff; border: 1px solid #cfe0ff; color: #1e5fe8;
    font-size: 16px; font-weight: 900; letter-spacing: .02em;
}
.admin-order-row.jd-workflow-target .admin-order-number-badge {
    background: #2563eb; color: #fff; border-color: #2563eb;
    box-shadow: 0 0 0 5px rgba(37,99,235,.15);
}
@media (max-width: 800px) {
    .admin-order-number-heading, .admin-order-number-cell { width: 58px; min-width: 58px; }
    .admin-order-number-badge { min-width: 38px; height: 38px; border-radius: 12px; font-size: 14px; }
}

/* v0.9.5.3 — отдельные столбцы статуса и действий в заявках поставщика */
body.admin-orders-page .admin-orders-table,
body.admin-orders-page .inventory-table.admin-orders-table {
    width: 1585px !important;
    min-width: 1585px !important;
}

body.admin-orders-page .admin-orders-table th:nth-child(8),
body.admin-orders-page .admin-orders-table td:nth-child(8),
body.admin-orders-page .admin-orders-table .admin-order-status-cell {
    width: 230px !important;
    min-width: 230px !important;
    max-width: 230px !important;
    text-align: left !important;
    overflow: hidden !important;
}

body.admin-orders-page .admin-orders-table th:nth-child(9),
body.admin-orders-page .admin-orders-table td:nth-child(9),
body.admin-orders-page .admin-orders-table .admin-order-actions-cell {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
    text-align: center !important;
    overflow: hidden !important;
}

body.admin-orders-page .admin-orders-table .admin-order-status-cell .status-select {
    display: block !important;
    width: 190px !important;
    min-width: 190px !important;
    max-width: 190px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

body.admin-orders-page .admin-orders-table .admin-order-actions-cell .table-actions {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
}

@media (max-width: 768px) {
    body.admin-orders-page .admin-orders-table,
    body.admin-orders-page .inventory-table.admin-orders-table {
        width: 1585px !important;
        min-width: 1585px !important;
    }
}

/* Fix 84-1: списки с прокруткой занимают всю высоту блока, но карточки внутри не растягиваются,
   когда позиций мало (например, после поиска) — прижимаются к верху и сохраняют свой размер. */
#imTabPrices #imPriceList,
.internal-market-section [id^="im"][id$="List"],
#autoRestockCartItems.auto-restock-scroll-list,
#myOrdersList.client-orders-list {
    align-content: start !important;
    grid-auto-rows: max-content;
}

/* Fix 85-1: подпись сотрудника в боковом меню */

.jd-employee-badge { margin: 4px 0 12px; padding: 8px 12px; border-radius: 12px; background: rgba(37, 99, 235, .1); color: inherit; font-size: 13px; line-height: 1.35; }
.jd-employee-badge strong { display: block; font-size: 14px; }
.sidebar > .jd-employee-badge { order: 2 !important; flex: 0 0 auto !important; margin: 16px 0 -12px !important; }
html[data-theme="dark"] .jd-employee-badge { background: rgba(96, 165, 250, .12); }
/* Fix 85-2: сообщение «раздел недоступен для вашей роли» */
.jd-no-access-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 2147483600; max-width: min(520px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; background: #111827; color: #fff; font-size: 14px; line-height: 1.4; box-shadow: 0 12px 32px rgba(0,0,0,.25); }
html[data-theme="dark"] .jd-no-access-toast { background: #e5e7eb; color: #0f172a; }

/* Fix 85-3: смена в боковом меню */
.sidebar > .jd-shift-box { order: 2 !important; flex: 0 0 auto !important; margin: 16px 0 -12px !important; }
.jd-shift-box { padding: 10px 12px; border: 1px solid rgba(148, 163, 184, .35); border-radius: 14px; font-size: 13px; line-height: 1.35; }
.jd-shift-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.jd-shift-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.jd-shift-dot.is-pause { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.jd-shift-dot.is-off { background: #94a3b8; box-shadow: none; }
.jd-shift-row { display: flex; gap: 6px; }
.sidebar .jd-shift-box .jd-shift-btn { flex: 1 1 0; width: 100%; min-height: 34px; margin: 0; padding: 0 10px; border: 1px solid rgba(148, 163, 184, .45); border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: none; }
.sidebar .jd-shift-box .jd-shift-btn.is-main { background: #111827; border-color: #111827; color: #fff; }
html[data-theme="dark"] .sidebar .jd-shift-box .jd-shift-btn.is-main { background: #e5e7eb; border-color: #e5e7eb; color: #0f172a; }
.sidebar .jd-shift-box .jd-shift-btn:disabled { opacity: .6; }
.sidebar > .jd-employee-badge + .jd-shift-box, .sidebar > .jd-shift-box { margin-top: 12px !important; }
.sidebar > .jd-employee-badge:has(+ .jd-shift-box) { margin-bottom: 0 !important; }

/* Fix 86-2: страница внутри окна «Центра дня» */
html.jd-embed.jd-embed.jd-embed body aside.sidebar.sidebar, html.jd-embed.jd-embed.jd-embed body .dashboard-page > .sidebar.sidebar,
html.jd-embed.jd-embed.jd-embed body .jd-mobile-menu-toggle.jd-mobile-menu-toggle, html.jd-embed.jd-embed.jd-embed body .jd-mobile-menu-backdrop,
html.jd-embed.jd-embed.jd-embed body .menu-backdrop, html.jd-embed.jd-embed.jd-embed body .sidebar-backdrop { display: none !important; }
html.jd-embed.jd-embed.jd-embed body .dashboard-page.dashboard-page { display: block !important; min-height: 0 !important; padding: 0 !important; }
html.jd-embed.jd-embed.jd-embed body .dashboard-page > .dashboard-content.dashboard-content,
html.jd-embed.jd-embed.jd-embed body .dashboard-content.dashboard-content { margin: 0 !important; padding: 16px !important; width: 100% !important; max-width: none !important; box-sizing: border-box !important; left: auto !important; }

/* ===== Fix 88-4: кнопки — видно, что на кнопку навели, нажали и что идёт сохранение ===== */
.primary-btn, .secondary-btn, .dc-btn {
    cursor: pointer;
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.primary-btn:hover:not(:disabled), .secondary-btn:hover:not(:disabled) {
    filter: brightness(1.12);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .18);
}
html[data-theme="dark"] .primary-btn:hover:not(:disabled), html[data-theme="dark"] .secondary-btn:hover:not(:disabled) {
    filter: brightness(1.3);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
}
.primary-btn:active:not(:disabled), .secondary-btn:active:not(:disabled) {
    transform: translateY(0);
    filter: brightness(.95);
    box-shadow: none;
}
.primary-btn:focus-visible, .secondary-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
.primary-btn:disabled, .secondary-btn:disabled {
    cursor: not-allowed;
    opacity: .6;
}
button.jd-busy, input.jd-busy {
    cursor: progress !important;
    opacity: .75 !important;
    position: relative;
}
button.jd-busy::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    vertical-align: -2px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: jd-busy-spin .7s linear infinite;
}
@keyframes jd-busy-spin { to { transform: rotate(360deg); } }
