@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        filter: none !important;
    }

    .motion-row-enter,
    .motion-row-exit,
    .motion-flash,
    .motion-success-pop,
    .motion-number-pop,
    .motion-text-swap,
    .motion-shake,
    .motion-panel-open,
    .motion-panel-closing,
    .motion-dropdown-open,
    .motion-dropdown-closing,
    .dashboard-card:hover,
    .dashboard-grid:hover .dashboard-card:not(:hover),
    .nav a:hover,
    .nav a:focus,
    .nav a[aria-current="page"] {
        transform: none !important;
    }
}

@media (max-width: 1440px) {
    .app-shell {
        grid-template-columns: 204px minmax(0, 1fr);
    }

    .sidebar {
        padding: 16px 10px;
    }

    .topbar {
        padding: 18px var(--page-padding-compact);
    }

    .content {
        padding: var(--page-padding-compact);
    }

    .panel {
        padding: var(--card-padding-compact);
    }

    .data-table th,
    .data-table td {
        padding: 10px 14px;
    }
}

@media (max-width: 1280px) {
    .app-shell {
        grid-template-columns: 196px minmax(0, 1fr);
    }

    .sidebar {
        padding: 14px 10px;
    }

    .brand {
        width: 144px;
        min-height: 70px;
        margin-bottom: 10px;
    }

    .brand__logo {
        max-height: 70px;
    }

    .nav a {
        min-height: 34px;
        font-size: 13px;
    }
}

@media (min-width: 1101px) and (max-width: 1280px) {
    .warehouses-page > .table-wrap,
    .buyers-page > .table-wrap,
    .employees-page .table-wrap,
    .transfers-page > .table-wrap,
    .returns-page > .table-wrap,
    .receive-transactions-page > .table-wrap,
    .write-offs-page > .table-wrap,
    .receive-reconciliation-history > .table-wrap,
    .receive-reconciliation-table-wrap {
        overflow-x: hidden;
    }

    .incoming-transfers-page > .table-wrap {
        overflow: visible;
    }

    .compact-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed;
        font-size: 10.5px;
    }

    .compact-table th,
    .compact-table td {
        min-width: 0;
        height: 34px;
        padding: 5px 4px;
        overflow-wrap: normal;
        word-break: normal;
    }

    .compact-table th {
        font-size: 9.5px;
        line-height: 1.15;
        white-space: normal;
    }

    .compact-table th[data-compact-label] {
        font-size: 0;
    }

    .compact-table th[data-compact-label]::after {
        content: attr(data-compact-label);
        font-size: 9.5px;
    }

    .compact-table .compact-cell--nowrap,
    .compact-table .compact-cell--ellipsis {
        max-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap !important;
    }

    .compact-table .compact-cell--nowrap > *,
    .compact-table .compact-cell--ellipsis > * {
        max-width: 100%;
    }

    .compact-table .badge,
    .compact-table .transfer-status {
        max-width: 100%;
        min-height: 20px;
        padding: 2px 5px;
        overflow: hidden;
        font-size: 9.5px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .compact-table .button,
    .compact-table button,
    .compact-table input {
        min-height: 28px;
        padding: 4px 6px;
        font-size: 10px;
        white-space: nowrap;
    }

    .compact-table .row-actions .button {
        display: block;
        width: 100%;
        margin: 0 0 4px;
        padding-inline: 3px;
    }

    .compact-table .row-actions .button:last-child {
        margin-bottom: 0;
    }

    .warehouses-table th:nth-child(1),
    .warehouses-table td:nth-child(1) { width: 5%; }
    .warehouses-table th:nth-child(2),
    .warehouses-table td:nth-child(2) { width: 13%; }
    .warehouses-table th:nth-child(3),
    .warehouses-table td:nth-child(3) { width: 17%; }
    .warehouses-table th:nth-child(4),
    .warehouses-table td:nth-child(4) { width: 17%; }
    .warehouses-table th:nth-child(5),
    .warehouses-table td:nth-child(5) { width: 11%; }
    .warehouses-table th:nth-child(6),
    .warehouses-table td:nth-child(6) { width: 24%; }
    .warehouses-table th:nth-child(7),
    .warehouses-table td:nth-child(7) { width: 13%; }

    .buyers-table th:nth-child(1),
    .buyers-table td:nth-child(1) { width: 6%; }
    .buyers-table th:nth-child(2),
    .buyers-table td:nth-child(2) { width: 23%; }
    .buyers-table th:nth-child(3),
    .buyers-table td:nth-child(3) { width: 15%; }
    .buyers-table th:nth-child(4),
    .buyers-table td:nth-child(4) { width: 9%; }
    .buyers-table th:nth-child(5),
    .buyers-table td:nth-child(5) { width: 29%; }
    .buyers-table th:nth-child(6),
    .buyers-table td:nth-child(6) { width: 18%; }

    .employees-table th:nth-child(1),
    .employees-table td:nth-child(1) { width: 5%; }
    .employees-table th:nth-child(2),
    .employees-table td:nth-child(2) { width: 17%; }
    .employees-table th:nth-child(3),
    .employees-table td:nth-child(3) { width: 11%; }
    .employees-table th:nth-child(4),
    .employees-table td:nth-child(4) { width: 20%; }
    .employees-table th:nth-child(5),
    .employees-table td:nth-child(5) { width: 13%; }
    .employees-table th:nth-child(6),
    .employees-table td:nth-child(6) { width: 15%; }
    .employees-table th:nth-child(7),
    .employees-table td:nth-child(7) { width: 7%; }
    .employees-table th:nth-child(8),
    .employees-table td:nth-child(8) { width: 12%; }

    .returns-table th:nth-child(1),
    .returns-table td:nth-child(1) { width: 4%; }
    .returns-table th:nth-child(2),
    .returns-table td:nth-child(2) { width: 5%; }
    .returns-table th:nth-child(3),
    .returns-table td:nth-child(3) { width: 5%; }
    .returns-table th:nth-child(4),
    .returns-table td:nth-child(4) { width: 10%; }
    .returns-table th:nth-child(5),
    .returns-table td:nth-child(5) { width: 15%; }
    .returns-table th:nth-child(6),
    .returns-table td:nth-child(6) { width: 10%; }
    .returns-table th:nth-child(7),
    .returns-table td:nth-child(7) { width: 10%; }
    .returns-table th:nth-child(8),
    .returns-table td:nth-child(8) { width: 6%; }
    .returns-table th:nth-child(9),
    .returns-table td:nth-child(9) { width: 7%; }
    .returns-table th:nth-child(10),
    .returns-table td:nth-child(10) { width: 8%; }
    .returns-table th:nth-child(11),
    .returns-table td:nth-child(11) { width: 8%; }
    .returns-table th:nth-child(12),
    .returns-table td:nth-child(12) { width: 12%; }

    .admin-transfers-table th:nth-child(1),
    .admin-transfers-table td:nth-child(1) { width: 10%; }
    .admin-transfers-table th:nth-child(2),
    .admin-transfers-table td:nth-child(2) { width: 6%; }
    .admin-transfers-table th:nth-child(3),
    .admin-transfers-table td:nth-child(3) { width: 8%; }
    .admin-transfers-table th:nth-child(4),
    .admin-transfers-table td:nth-child(4) { width: 8%; }
    .admin-transfers-table th:nth-child(5),
    .admin-transfers-table td:nth-child(5) { width: 13%; }
    .admin-transfers-table th:nth-child(6),
    .admin-transfers-table td:nth-child(6) { width: 5%; }
    .admin-transfers-table th:nth-child(7),
    .admin-transfers-table td:nth-child(7) { width: 7%; }
    .admin-transfers-table th:nth-child(8),
    .admin-transfers-table td:nth-child(8) { width: 10%; }
    .admin-transfers-table th:nth-child(9),
    .admin-transfers-table td:nth-child(9) { width: 8%; }
    .admin-transfers-table th:nth-child(10),
    .admin-transfers-table td:nth-child(10) { width: 8%; }
    .admin-transfers-table th:nth-child(11),
    .admin-transfers-table td:nth-child(11) { width: 6%; }
    .admin-transfers-table th:nth-child(12),
    .admin-transfers-table td:nth-child(12) { width: 5%; }
    .admin-transfers-table th:nth-child(13),
    .admin-transfers-table td:nth-child(13) { width: 6%; }

    .incoming-transfers-table th:nth-child(1),
    .incoming-transfers-table td:nth-child(1) { width: 9%; }
    .incoming-transfers-table th:nth-child(2),
    .incoming-transfers-table td:nth-child(2) { width: 12%; }
    .incoming-transfers-table th:nth-child(3),
    .incoming-transfers-table td:nth-child(3) { width: 14%; }
    .incoming-transfers-table th:nth-child(4),
    .incoming-transfers-table td:nth-child(4) { width: 7%; }
    .incoming-transfers-table th:nth-child(5),
    .incoming-transfers-table td:nth-child(5) { width: 10%; }
    .incoming-transfers-table th:nth-child(6),
    .incoming-transfers-table td:nth-child(6) { width: 13%; }
    .incoming-transfers-table th:nth-child(7),
    .incoming-transfers-table td:nth-child(7) { width: 20%; }
    .incoming-transfers-table th:nth-child(8),
    .incoming-transfers-table td:nth-child(8) { width: 15%; }

    .incoming-transfers-table--inspect th:nth-child(1),
    .incoming-transfers-table--inspect td:nth-child(1) { width: 8%; }
    .incoming-transfers-table--inspect th:nth-child(2),
    .incoming-transfers-table--inspect td:nth-child(2) { width: 11%; }
    .incoming-transfers-table--inspect th:nth-child(3),
    .incoming-transfers-table--inspect td:nth-child(3) { width: 13%; }
    .incoming-transfers-table--inspect th:nth-child(4),
    .incoming-transfers-table--inspect td:nth-child(4) { width: 6%; }
    .incoming-transfers-table--inspect th:nth-child(5),
    .incoming-transfers-table--inspect td:nth-child(5) { width: 8%; }
    .incoming-transfers-table--inspect th:nth-child(6),
    .incoming-transfers-table--inspect td:nth-child(6) { width: 9%; }
    .incoming-transfers-table--inspect th:nth-child(7),
    .incoming-transfers-table--inspect td:nth-child(7) { width: 12%; }
    .incoming-transfers-table--inspect th:nth-child(8),
    .incoming-transfers-table--inspect td:nth-child(8) { width: 18%; }
    .incoming-transfers-table--inspect th:nth-child(9),
    .incoming-transfers-table--inspect td:nth-child(9) { width: 15%; }

    .incoming-transfers-table .transfer-actions-cell {
        position: relative;
        width: auto;
        overflow: visible;
    }

    .transfer-action-menu {
        position: relative;
    }

    .transfer-action-menu > summary {
        display: inline-flex;
        width: 100%;
        justify-content: center;
        cursor: pointer;
    }

    .transfer-action-menu:not([open]) > .transfer-actions {
        display: none !important;
    }

    .transfer-action-menu[open] > .transfer-actions {
        position: absolute;
        top: calc(100% + 4px);
        right: 0;
        z-index: 20;
        display: grid !important;
        width: 178px;
        min-width: 0;
        gap: 4px;
        padding: 6px;
        border: 1px solid var(--border);
        border-radius: var(--radius-input);
        background: var(--panel);
        box-shadow: var(--shadow-hover);
    }

    .transfer-action-menu[open] > .transfer-actions .button {
        width: 100%;
        margin: 0;
    }

    .transfer-document-details-table th:nth-child(1),
    .transfer-document-details-table td:nth-child(1) { width: 7%; }
    .transfer-document-details-table th:nth-child(2),
    .transfer-document-details-table td:nth-child(2) { width: 29%; }
    .transfer-document-details-table th:nth-child(3),
    .transfer-document-details-table td:nth-child(3) { width: 10%; }
    .transfer-document-details-table th:nth-child(4),
    .transfer-document-details-table td:nth-child(4) { width: 13%; }
    .transfer-document-details-table th:nth-child(5),
    .transfer-document-details-table td:nth-child(5) { width: 27%; }
    .transfer-document-details-table th:nth-child(6),
    .transfer-document-details-table td:nth-child(6) { width: 14%; }

    .transfer-document-details-table--inspect th:nth-child(1),
    .transfer-document-details-table--inspect td:nth-child(1) { width: 5%; }
    .transfer-document-details-table--inspect th:nth-child(2),
    .transfer-document-details-table--inspect td:nth-child(2) { width: 25%; }
    .transfer-document-details-table--inspect th:nth-child(3),
    .transfer-document-details-table--inspect td:nth-child(3) { width: 8%; }
    .transfer-document-details-table--inspect th:nth-child(4),
    .transfer-document-details-table--inspect td:nth-child(4) { width: 10%; }
    .transfer-document-details-table--inspect th:nth-child(5),
    .transfer-document-details-table--inspect td:nth-child(5) { width: 9%; }
    .transfer-document-details-table--inspect th:nth-child(6),
    .transfer-document-details-table--inspect td:nth-child(6) { width: 14%; }
    .transfer-document-details-table--inspect th:nth-child(7),
    .transfer-document-details-table--inspect td:nth-child(7) { width: 19%; }
    .transfer-document-details-table--inspect th:nth-child(8),
    .transfer-document-details-table--inspect td:nth-child(8) { width: 10%; }

    .receive-transactions-table th:nth-child(1),
    .receive-transactions-table td:nth-child(1) { width: 6%; }
    .receive-transactions-table th:nth-child(2),
    .receive-transactions-table td:nth-child(2) { width: 10%; }
    .receive-transactions-table th:nth-child(3),
    .receive-transactions-table td:nth-child(3) { width: 12%; }
    .receive-transactions-table th:nth-child(4),
    .receive-transactions-table td:nth-child(4) { width: 16%; }
    .receive-transactions-table th:nth-child(5),
    .receive-transactions-table td:nth-child(5) { width: 10%; }
    .receive-transactions-table th:nth-child(6),
    .receive-transactions-table td:nth-child(6) { width: 12%; }
    .receive-transactions-table th:nth-child(7),
    .receive-transactions-table td:nth-child(7) { width: 9%; }
    .receive-transactions-table th:nth-child(8),
    .receive-transactions-table td:nth-child(8) { width: 9%; }
    .receive-transactions-table th:nth-child(9),
    .receive-transactions-table td:nth-child(9) { width: 5%; }
    .receive-transactions-table th:nth-child(10),
    .receive-transactions-table td:nth-child(10) { width: 6%; }
    .receive-transactions-table th:nth-child(11),
    .receive-transactions-table td:nth-child(11) { width: 5%; }

    .receive-transaction-details-table th:nth-child(1),
    .receive-transaction-details-table td:nth-child(1) { width: 5%; }
    .receive-transaction-details-table th:nth-child(2),
    .receive-transaction-details-table td:nth-child(2) { width: 10%; }
    .receive-transaction-details-table th:nth-child(3),
    .receive-transaction-details-table td:nth-child(3) { width: 12%; }
    .receive-transaction-details-table th:nth-child(4),
    .receive-transaction-details-table td:nth-child(4) { width: 17%; }
    .receive-transaction-details-table th:nth-child(5),
    .receive-transaction-details-table td:nth-child(5) { width: 10%; }
    .receive-transaction-details-table th:nth-child(6),
    .receive-transaction-details-table td:nth-child(6) { width: 12%; }
    .receive-transaction-details-table th:nth-child(7),
    .receive-transaction-details-table td:nth-child(7) { width: 7%; }
    .receive-transaction-details-table th:nth-child(8),
    .receive-transaction-details-table td:nth-child(8) { width: 7%; }
    .receive-transaction-details-table th:nth-child(9),
    .receive-transaction-details-table td:nth-child(9) { width: 5%; }
    .receive-transaction-details-table th:nth-child(10),
    .receive-transaction-details-table td:nth-child(10) { width: 7%; }
    .receive-transaction-details-table th:nth-child(11),
    .receive-transaction-details-table td:nth-child(11) { width: 8%; }

    .write-offs-table th:nth-child(1),
    .write-offs-table td:nth-child(1) { width: 8%; }
    .write-offs-table th:nth-child(2),
    .write-offs-table td:nth-child(2) { width: 11%; }
    .write-offs-table th:nth-child(3),
    .write-offs-table td:nth-child(3) { width: 22%; }
    .write-offs-table th:nth-child(4),
    .write-offs-table td:nth-child(4) { width: 12%; }
    .write-offs-table th:nth-child(5),
    .write-offs-table td:nth-child(5),
    .write-offs-table th:nth-child(6),
    .write-offs-table td:nth-child(6),
    .write-offs-table th:nth-child(7),
    .write-offs-table td:nth-child(7) { width: 7%; }
    .write-offs-table th:nth-child(8),
    .write-offs-table td:nth-child(8) { width: 10%; }
    .write-offs-table th:nth-child(9),
    .write-offs-table td:nth-child(9) { width: 16%; }

    .write-off-details-table th:nth-child(1),
    .write-off-details-table td:nth-child(1) { width: 4%; }
    .write-off-details-table th:nth-child(2),
    .write-off-details-table td:nth-child(2) { width: 9%; }
    .write-off-details-table th:nth-child(3),
    .write-off-details-table td:nth-child(3) { width: 5%; }
    .write-off-details-table th:nth-child(4),
    .write-off-details-table td:nth-child(4) { width: 8%; }
    .write-off-details-table th:nth-child(5),
    .write-off-details-table td:nth-child(5) { width: 16%; }
    .write-off-details-table th:nth-child(6),
    .write-off-details-table td:nth-child(6) { width: 8%; }
    .write-off-details-table th:nth-child(7),
    .write-off-details-table td:nth-child(7),
    .write-off-details-table th:nth-child(8),
    .write-off-details-table td:nth-child(8),
    .write-off-details-table th:nth-child(9),
    .write-off-details-table td:nth-child(9) { width: 6%; }
    .write-off-details-table th:nth-child(10),
    .write-off-details-table td:nth-child(10),
    .write-off-details-table th:nth-child(11),
    .write-off-details-table td:nth-child(11),
    .write-off-details-table th:nth-child(12),
    .write-off-details-table td:nth-child(12),
    .write-off-details-table th:nth-child(13),
    .write-off-details-table td:nth-child(13) { width: 8%; }

    .receive-reconciliation-history-table th:nth-child(1),
    .receive-reconciliation-history-table td:nth-child(1) { width: 6%; }
    .receive-reconciliation-history-table th:nth-child(2),
    .receive-reconciliation-history-table td:nth-child(2) { width: 13%; }
    .receive-reconciliation-history-table th:nth-child(3),
    .receive-reconciliation-history-table td:nth-child(3) { width: 14%; }
    .receive-reconciliation-history-table th:nth-child(4),
    .receive-reconciliation-history-table td:nth-child(4) { width: 17%; }
    .receive-reconciliation-history-table th:nth-child(5),
    .receive-reconciliation-history-table td:nth-child(5) { width: 25%; }
    .receive-reconciliation-history-table th:nth-child(6),
    .receive-reconciliation-history-table td:nth-child(6) { width: 8%; }
    .receive-reconciliation-history-table th:nth-child(7),
    .receive-reconciliation-history-table td:nth-child(7) { width: 9%; }
    .receive-reconciliation-history-table th:nth-child(8),
    .receive-reconciliation-history-table td:nth-child(8) { width: 8%; }

    .receive-reconciliation-history-table .receive-reconciliation-point-list {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .receive-reconciliation-table thead tr:nth-child(2),
    .receive-reconciliation-table .receive-reconciliation-point-group-heading,
    .receive-reconciliation-table .receive-reconciliation-point-cell {
        display: none;
    }

    .receive-reconciliation-table .receive-reconciliation-compact-points {
        display: table-cell;
        width: 25%;
    }

    .receive-reconciliation-table thead tr:first-child > th:first-child,
    .receive-reconciliation-table tbody > tr > td:first-child { width: 24%; }
    .receive-reconciliation-table .receive-reconciliation-invoice-column,
    .receive-reconciliation-table tbody > tr > td:nth-child(2) { width: 16%; }
    .receive-reconciliation-table .receive-reconciliation-invoice-column + .receive-reconciliation-invoice-column,
    .receive-reconciliation-table tbody > tr > td:nth-child(3) { width: 13%; }
    .receive-reconciliation-table .receive-reconciliation-total-column { width: 7%; }
    .receive-reconciliation-table .receive-reconciliation-difference-column { width: 7%; }
    .receive-reconciliation-table .receive-reconciliation-result-column { width: 8%; }

    .receive-reconciliation-table tbody td:first-child {
        min-width: 0;
        max-width: none;
    }

    .receive-reconciliation-table input {
        width: 100%;
        padding-inline: 3px;
    }

    .receive-reconciliation-result-column .receive-reconciliation-reason {
        display: none;
    }

    .schedule-table-wrap {
        overflow-x: hidden;
    }

    .schedule-table {
        width: 100%;
        min-width: 0;
        font-size: 9px;
    }

    .schedule-table__employee-column {
        width: 110px;
    }

    .schedule-table__day-column {
        width: calc((100% - 110px) / var(--schedule-day-count, 31));
    }

    .schedule-table th,
    .schedule-table td {
        width: auto;
        min-width: 0;
    }

    .schedule-table__sticky {
        width: 110px;
        min-width: 110px;
        max-width: 110px;
    }

    .schedule-table__employee {
        padding-inline: 5px;
    }
}

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

    .sales-page .sales-products {
        order: 1;
    }

    .sales-page .sales-cart {
        order: 2;
    }
}

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

    .sales-kpi-dashboard__header,
    .sales-kpi-tables {
        grid-template-columns: 1fr;
    }

    .sales-kpi-dashboard__header {
        display: grid;
    }

    .sales-kpi-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .period-toggle {
        justify-self: start;
    }
}

@media (max-width: 1100px) {
    .app-shell {
        align-content: start;
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 50;
        align-self: start;
        min-height: 0;
        max-height: none;
        overflow: visible;
        padding: 12px 16px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .sidebar-header .brand {
        flex: 0 1 128px;
        width: 128px;
        min-height: 70px;
        margin-bottom: 0;
    }

    .sidebar-header .brand__logo {
        max-height: 70px;
    }

    .nav-toggle {
        display: inline-grid;
        flex: 0 0 auto;
    }

    .js-ready .nav {
        display: none;
    }

    .js-ready .sidebar.is-nav-open .nav {
        display: grid;
        animation: motion-panel-in var(--motion-medium) var(--motion-ease) both;
    }

    .nav {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        min-width: 0;
        max-height: min(420px, calc(100vh - 104px));
        margin-top: 12px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: 2px;
    }

    .nav-group,
    .nav-group__links,
    .nav a {
        min-width: 0;
    }

    .nav a:hover,
    .nav a:focus,
    .nav a[aria-current="page"] {
        transform: none;
    }
}

@media (max-width: 1100px) {
    .table-wrap {
        overflow-x: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .js-ready .data-table {
        display: block;
        width: 100%;
        border-collapse: separate;
    }

    .js-ready .sales-product-table,
    .js-ready .sales-cart-table {
        min-width: 0;
        table-layout: auto;
    }

    .js-ready .sales-statistics-page .sales-report-table,
    .js-ready .sales-statistics-page .sales-items-table,
    .js-ready .sales-statistics-page .sales-kpi-warehouse-table,
    .js-ready .sales-statistics-page .sales-kpi-low-stock-table {
        min-width: 0;
    }

    .sales-statistics-page .sales-summary-table td {
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .js-ready .returns-table {
        min-width: 0;
    }

    .js-ready .receive-transactions-table,
    .js-ready .receive-transaction-details-table,
    .js-ready .receive-reconciliation-table,
    .js-ready .write-offs-table,
    .js-ready .write-off-details-table,
    .js-ready .admin-transfer-documents-table,
    .js-ready .admin-transfers-page .admin-transfer-details-table,
    .js-ready .incoming-transfers-table,
    .js-ready .incoming-transfers-page .transfer-document-details-table {
        min-width: 0;
    }

    .js-ready .admin-transfer-documents-table,
    .js-ready .admin-transfers-page .admin-transfer-details-table,
    .js-ready .incoming-transfers-table,
    .js-ready .incoming-transfers-page .transfer-document-details-table {
        width: 100%;
        table-layout: auto;
    }

    .js-ready .incoming-transfers-table .transfer-actions-cell {
        width: auto;
    }

    .js-ready .sales-product-table th,
    .js-ready .sales-product-table td,
    .js-ready .sales-cart-table th,
    .js-ready .sales-cart-table td,
    .js-ready .sales-statistics-page .data-table th,
    .js-ready .sales-statistics-page .data-table td,
    .js-ready .returns-table th,
    .js-ready .returns-table td,
    .js-ready .returns-table td:not(:nth-child(5)):not(:nth-child(6)):not(:nth-child(12)) {
        width: auto;
        overflow-wrap: anywhere;
        white-space: normal;
        word-break: normal;
    }

    .js-ready .sales-statistics-page .data-table td.empty-state {
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .js-ready .sales-statistics-page .sales-report-table > tbody > tr:not(.sales-report-details-row) > td:last-child,
    .js-ready .sales-statistics-page .sales-items-table > tbody > tr:not(.sales-return-editor-row) > td:last-child {
        width: auto;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .js-ready .data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .js-ready .data-table tbody {
        display: grid;
        gap: var(--grid-gap);
    }

    .js-ready .data-table tr {
        display: grid;
        min-width: 0;
        padding: var(--card-padding-compact);
        border: 1px solid var(--border);
        border-radius: var(--radius-card);
        background: var(--panel);
        box-shadow: var(--shadow);
    }

    .js-ready .inventory-table tr.inventory-row-pending,
    .js-ready .inventory-table tr.inventory-row-ok,
    .js-ready .inventory-table tr.inventory-row-mismatch {
        border-color: var(--inventory-row-accent);
        background: var(--inventory-row-bg);
        box-shadow: inset 4px 0 0 var(--inventory-row-accent), var(--shadow);
    }

    .js-ready .inventory-table tr.inventory-row-pending td,
    .js-ready .inventory-table tr.inventory-row-ok td,
    .js-ready .inventory-table tr.inventory-row-mismatch td {
        background: transparent;
    }

    .js-ready .inventory-table tr.inventory-row-pending td:first-child,
    .js-ready .inventory-table tr.inventory-row-ok td:first-child,
    .js-ready .inventory-table tr.inventory-row-mismatch td:first-child {
        box-shadow: none;
    }

    .js-ready .data-table td {
        display: grid;
        grid-template-columns: minmax(108px, 34%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        min-width: 0;
        height: auto;
        padding: 8px 0;
        border-bottom: 1px solid var(--border);
    }

    .js-ready .data-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 600;
        line-height: 1.25;
        text-transform: uppercase;
        overflow-wrap: normal;
    }

    .js-ready .data-table td:not([data-label]) {
        grid-template-columns: 1fr;
    }

    .js-ready .data-table td:not([data-label])::before,
    .js-ready .data-table td[colspan]::before,
    .js-ready .data-table td.empty-state::before {
        content: none;
    }

    .js-ready .data-table td[colspan],
    .js-ready .data-table td.empty-state {
        display: block;
        padding: 12px;
        border-bottom: 0;
        text-align: center;
    }

    .js-ready .data-table td:last-child {
        border-bottom: 0;
    }

    .js-ready .receive-reconciliation-table .receive-reconciliation-point-column--start {
        margin-top: 4px;
        padding-top: 12px;
        border-top: 2px solid var(--page-module-border, var(--module-reports-border));
        border-left: 0;
    }

    .js-ready .receive-reconciliation-table .receive-reconciliation-point-column--end {
        margin-bottom: 4px;
        padding-bottom: 12px;
        border-right: 0;
        border-bottom: 2px solid var(--page-module-border, var(--module-reports-border));
    }

    .js-ready .receive-reconciliation-table .receive-reconciliation-compact-points {
        display: none;
    }

    .js-ready .data-table td.row-actions .button,
    .js-ready .data-table td[data-label="Действие"] .button {
        width: 100%;
        margin: 0 0 8px;
    }

    .js-ready .data-table td.row-actions .button:last-child,
    .js-ready .data-table td[data-label="Действие"] .button:last-child {
        margin-bottom: 0;
    }

    .js-ready .receive-group-row,
    .js-ready .write-off-group-row,
    .js-ready .transfer-document-row,
    .js-ready .sales-report-row {
        cursor: pointer;
    }

    .js-ready .receive-group-toggle-cell,
    .js-ready .write-off-group-toggle-cell,
    .js-ready .transfer-document-toggle-cell,
    .js-ready .sales-report-toggle-cell {
        width: auto;
        min-width: 0;
        max-width: none;
        white-space: normal;
    }

    .js-ready .receive-group-toggle-content,
    .js-ready .write-off-group-toggle-content {
        align-self: start;
        justify-self: start;
    }

    .js-ready .receive-group-details-row,
    .js-ready .write-off-group-details-row,
    .js-ready .transfer-document-details-row,
    .js-ready .sales-report-details-row,
    .js-ready .sales-kpi-warehouse-details-row,
    .js-ready .sales-return-editor-row {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .js-ready .receive-group-details-row > td,
    .js-ready .write-off-group-details-row > td,
    .js-ready .transfer-document-details-row > td,
    .js-ready .sales-report-details-row > td,
    .js-ready .sales-kpi-warehouse-details-row > td,
    .js-ready .sales-return-editor-row > td {
        display: block;
        padding: 0;
        border-bottom: 0;
        background: transparent;
    }

    .js-ready .sales-statistics-page .sales-return-editor-row > td {
        padding-top: 10px;
        text-align: left;
    }

    .js-ready .receive-group-details,
    .js-ready .write-off-group-details,
    .js-ready .transfer-document-details,
    .js-ready .sales-report-details {
        padding: 10px 0 0;
    }

    .js-ready .incoming-transfers-table .transfer-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        min-width: 0;
        gap: 8px;
    }

    .js-ready .incoming-transfers-table .transfer-action-menu {
        width: 100%;
    }

    .js-ready .incoming-transfers-table .transfer-actions .button {
        width: 100%;
        margin: 0;
        white-space: normal;
    }

    .js-ready .incoming-transfers-page .transfer-document-details {
        overflow: visible;
        border-left: 0;
    }

    .js-ready .admin-transfers-page .transfer-document-details {
        overflow: visible;
        border-left: 0;
    }

    .incoming-transfers-page .transfer-correction-editor {
        margin: 12px 0 0;
    }

    .incoming-transfers-page .transfer-correction-editor__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .incoming-transfers-page .transfer-correction-editor__actions .button {
        width: 100%;
        min-width: 0;
    }

    .incoming-transfers-page .transfer-correction-editor__help {
        justify-self: stretch;
        text-align: left;
    }
}

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

    .shift-count-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .incoming-transfers-page .transfer-correction-editor__actions {
        grid-template-columns: 1fr;
    }

    .topbar,
    .content {
        padding: 12px;
    }

    .sales-kpi-dashboard {
        padding: 14px;
    }

    .sales-kpi-cards,
    .period-toggle {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .period-toggle__button {
        white-space: normal;
    }

    .sales-statistics-page .sales-return-editor__header {
        align-items: stretch;
        flex-direction: column;
    }

    .sales-date-filter {
        grid-template-columns: 1fr;
    }

    .sales-statistics-page .sales-return-editor__header .button {
        align-self: start;
    }

    .topbar {
        align-items: start;
        flex-direction: column;
        gap: 8px;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .topbar-actions {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .topbar-actions .topbar-link,
    .topbar-actions .button {
        flex: 0 0 auto;
        width: auto;
        min-height: 30px;
        padding: 4px 8px;
        font-size: 13px;
        white-space: nowrap;
    }

    .topbar-actions form {
        flex: 0 0 auto;
        width: auto;
    }

    .toolbar,
    .crud-form {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .shift-panel__main,
    .cash-counts-section__header {
        display: grid;
        align-items: start;
    }

    .shift-panel__actions {
        justify-content: stretch;
    }

    .shift-count-row {
        grid-template-columns: 1fr;
    }

    .panel,
    .auth-panel,
    .crud-form {
        padding: 16px;
    }

    .search-field,
    .search-field-small,
    .warehouse-filter {
        width: 100%;
        min-width: 0;
    }

    .sales-toolbar .buyer-picker {
        grid-template-columns: minmax(0, 1fr) var(--control-height);
    }

    .sales-toolbar .buyer-picker__selection {
        grid-column: 1 / -1;
        width: 100%;
        max-width: none;
        min-height: 34px;
        line-height: 32px;
    }

    .sales-cart .sales-toolbar,
    .sales-cart .sales-buyer-form {
        grid-template-columns: 1fr;
    }

    .sales-payment-mode,
    .sales-mixed-payment-editor {
        grid-template-columns: 1fr;
    }

    .sales-payment-mixed-toggle {
        width: 100%;
        white-space: normal;
    }

    .button {
        width: 100%;
    }

    .settings-sync-card {
        padding: 16px;
    }

    .settings-sync-card__heading,
    .settings-sync-connection__heading,
    .settings-sync-connection__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-sync-fields {
        grid-template-columns: 1fr;
    }

    .settings-sync-field--password {
        grid-column: auto;
    }

    .settings-sync-card__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-sync-confirm {
        max-width: none;
    }

    .settings-sync-summary dl {
        grid-template-columns: 1fr;
    }

    .sales-cart .sales-toolbar .button,
    .sales-cart .sales-buyer-form .button {
        justify-self: stretch;
        width: 100%;
    }

    .receive-total {
        justify-content: space-between;
        width: 100%;
    }

    .receive-secondary-workflow__header {
        align-items: stretch;
        flex-direction: column;
    }

    .receive-secondary-workflow__header .button {
        width: 100%;
    }

    .definition-list div,
    .sales-totals div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .sales-totals dd {
        text-align: left;
    }

    .sales-confirm-dialog__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .sales-change-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .sales-change-row strong {
        text-align: left;
    }

    .sales-payment-breakdown dl div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .sales-payment-breakdown dd {
        text-align: left;
    }

    .schedule-color-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .js-ready .sales-product-table td,
    .js-ready .sales-cart-table td {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .sidebar {
        padding: 12px;
    }

    .nav {
        grid-template-columns: 1fr;
    }

    .topbar,
    .content {
        padding: 12px;
    }

    .crud-form {
        padding: 12px;
    }

    .panel,
    .auth-panel {
        padding: 14px;
    }

    .sidebar-header .brand {
        flex-basis: 116px;
        width: 116px;
        min-height: 64px;
    }

    .sidebar-header .brand__logo {
        max-height: 64px;
    }

    .auth-brand__logo {
        width: min(100%, 190px);
        max-height: 104px;
    }

    .js-ready .data-table tr {
        padding: 14px;
    }

    .js-ready .data-table td {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* Shared month grid and vacation summary, including the administrator view. */
.schedule-month__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    align-items: start;
    gap: 16px;
    min-width: 0;
}

.schedule-vacations {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--panel);
    overflow-wrap: anywhere;
    font-size: 13px;
}

.schedule-vacations h3 { margin: 0 0 10px; font-size: 15px; }
.schedule-vacations p { margin: 0; }
.schedule-vacations ul { margin: 0; padding: 0; list-style: none; }
.schedule-vacations li + li { margin-top: 10px; }
.employee-vacations { min-width: 0; }
.employee-vacations [hidden] { display: none !important; }
.vacation-balance { font-weight: 600; }
.vacation-period-list, [data-vacation-requests] { display: grid; gap: 8px; }
.vacation-period-row, .vacation-request-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}
.vacation-request-row > span { min-width: 0; overflow-wrap: anywhere; }
.vacation-requests-section { margin-bottom: 24px; }
[data-vacation-refresh] { margin-top: 8px; }

@media (min-width: 1101px) {
    .schedule-month__layout .schedule-table { width: 100%; min-width: 0; font-size: 10px; }
    .schedule-month__layout .schedule-table-wrap { overflow-x: hidden; }
    .schedule-month__layout .schedule-table__employee-column { width: 90px; }
    .schedule-month__layout .schedule-table__day-column { width: calc((100% - 90px) / var(--schedule-day-count, 31)); }
    .schedule-month__layout .schedule-table th,
    .schedule-month__layout .schedule-table td { width: auto; min-width: 0; }
    .schedule-month__layout .schedule-table__sticky { width: 90px; min-width: 90px; max-width: 90px; }
    .schedule-month__layout .schedule-table__employee { padding-inline: 4px; }
}

@media (max-width: 1100px) {
    .schedule-month__layout { grid-template-columns: minmax(0, 1fr); }
    .schedule-vacations { width: 100%; }
}

/* Transfer cancellation keeps the existing compact document columns. */
.admin-transfers-page .transfer-cancel-button {
    display: block;
    width: 100%;
    min-width: 0;
    height: auto;
    margin-top: 4px;
    padding: 4px;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 11px;
}
.transfer-status--cancelled {
    color: var(--muted);
    background: var(--panel);
    border-color: var(--border);
}
.transfer-cancellation-detail {
    padding: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
}
.transfer-cancellation-detail .field-help,
.transfer-movement-comment {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
}
.transfer-cancel-dialog textarea {
    width: 100%;
    resize: vertical;
}
.transfer-cancel-dialog p {
    margin: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
    .js-ready .admin-transfer-documents-table > tbody > .transfer-document-row > td,
    .js-ready .admin-transfers-page .admin-transfer-details-table td {
        width: auto;
    }
    .admin-transfers-page .transfer-cancel-button {
        font-size: 13px;
        padding: 8px;
    }
}

/* Vacation decisions and immutable updates fit both sidebar and mobile layouts. */
.nav .notification-badge { margin-left: auto; flex-shrink: 0; }
.vacation-request-row { align-items: flex-start; flex-wrap: wrap; }
.vacation-request-row > div { min-width: 0; flex: 1 1 280px; }
.vacation-review-editor { display: grid; gap: 10px; }
.vacation-review-editor .row-actions { flex-wrap: wrap; }
.vacation-comment-field { flex: 1 1 260px; }
.vacation-comment, .vacation-event p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.vacation-updates { margin: 20px 0; }
[data-vacation-events] { display: grid; gap: 8px; margin-bottom: 12px; }
.vacation-event { display: block; }
.vacation-review-editor textarea, .vacation-comment-field textarea { width: 100%; box-sizing: border-box; }

/* Compact employee vacation planner. Self-service vacation styles remain unchanged. */
.vacation-planner-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.vacation-planner-toolbar h2 { margin-bottom: 6px; }
.vacation-planner-toolbar p { margin: 0; }
.vacation-planner-rules { font-size: 13px; color: var(--text-muted, #64748b); margin: 16px 0; }
.vacation-employee-list { display: grid; gap: 10px; }
.vacation-employee { min-width: 0; border: 1px solid var(--border, #e2e8f0); border-radius: 12px; background: var(--surface, #fff); }
.vacation-employee-header { display: flex; gap: 12px; align-items: center; padding: 12px 16px; }
.vacation-employee-toggle { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; border: 0; background: none; padding: 4px; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.vacation-employee-toggle:focus-visible, .vacation-pending-badge:focus-visible, .vacation-scale-scroll:focus-visible { outline: 3px solid #0f766e; outline-offset: 3px; }
.vacation-employee-name { display: flex; gap: 10px; align-items: center; font-weight: 650; overflow-wrap: anywhere; }
.vacation-chevron { font-size: 24px; line-height: 1; transition: transform 150ms ease; }
.vacation-employee-toggle[aria-expanded="true"] .vacation-chevron { transform: rotate(90deg); }
.vacation-employee-summary { font-size: 13px; padding-left: 22px; color: var(--text-muted, #64748b); overflow-wrap: anywhere; }
.vacation-pending-badge { flex: 0 0 auto; background: #dc2626; color: #fff; border: 0; border-radius: 18px; padding: 8px 12px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.vacation-pending-badge:disabled { opacity: .6; cursor: wait; }
.vacation-employee-panel { padding: 0 20px 20px; border-top: 1px solid var(--border, #e2e8f0); }
.vacation-employee-panel > .toolbar { margin-top: 16px; }
.vacation-planner [data-vacation-filters] .search-field { flex: 0 1 190px; }
.vacation-employee-panel h3 { font-size: 15px; margin: 20px 0 10px; }
.vacation-planner .vacation-period-row { flex-wrap: wrap; }
.vacation-planner .toolbar, .vacation-planner .row-actions { flex-wrap: wrap; }
.vacation-planner .search-field { min-width: 0; }
.vacation-planner .vacation-period-form input[type="date"] { width: 100%; }
.vacation-planner [data-vacation-status] { overflow-wrap: anywhere; }
.vacation-year-settings { margin-top: 20px; border-top: 1px solid var(--border, #e2e8f0); padding-top: 14px; }
.vacation-year-settings > summary { cursor: pointer; font-weight: 600; }
.vacation-year-settings .toolbar { margin-top: 14px; }
.vacation-year-settings p { font-size: 13px; }
.vacation-planner .vacation-planner-request { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
.vacation-planner-request > p { margin: 0; }
.vacation-planner-request > div { width: 100%; }
.vacation-comparison { min-width: 0; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; margin: 12px 0; }
.vacation-comparison h4 { font-size: 14px; margin: 0 0 8px; }
.vacation-comparison-legend { font-size: 12px; margin: 0 0 10px; }
.vacation-scale-scroll { overflow-x: auto; max-width: 100%; padding-bottom: 8px; }
.vacation-scale-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: center; gap: 0; min-height: 36px; border-bottom: 1px solid #e2e8f0; }
.vacation-scale-name { position: sticky; left: 0; z-index: 1; background: #f8fafc; font-size: 12px; padding-right: 8px; overflow-wrap: anywhere; min-height: 28px; display: flex; align-items: center; }
.vacation-scale-track { position: relative; height: 28px; margin-right: 10px; }
.vacation-scale-tick { position: absolute; font-size: 9px; top: 4px; }
.vacation-scale-bar { position: absolute; top: 3px; height: 22px; border-radius: 4px; min-width: 3px; }
.vacation-scale-bar.is-selected { background: #0f766e; }
.vacation-scale-bar.is-confirmed { background: var(--vacation-color, #e889e5); }
.vacation-scale-bar.is-overlap { background: repeating-linear-gradient(135deg, #92400e 0, #92400e 2px, #fde68a 2px, #fde68a 6px); border: 1px solid #92400e; box-sizing: border-box; }
.vacation-comparison-list { margin: 10px 0 0; padding-left: 20px; font-size: 13px; }
.vacation-comparison-list li { margin: 5px 0; overflow-wrap: anywhere; }
.vacation-comparison-list .has-overlap { font-weight: 600; }
@media (max-width: 600px) {
    .vacation-employee-header { align-items: flex-start; padding: 10px; gap: 6px; flex-wrap: wrap; }
    .vacation-employee-toggle { flex-basis: 100%; }
    .vacation-pending-badge { margin-left: 26px; }
    .vacation-employee-panel { padding: 0 12px 16px; }
    .vacation-planner .vacation-period-form .search-field, .vacation-planner .vacation-year-settings .search-field { flex: 1 1 100%; }
    .vacation-planner .toolbar input, .vacation-planner .toolbar textarea { max-width: 100%; box-sizing: border-box; }
    .vacation-planner .vacation-planner-request { padding: 10px; }
    .vacation-comparison { padding: 10px; }
}
