:root {
    color-scheme: light;
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-muted: #f7f9fc;
    --border: #d9e0ea;
    --border-strong: #c2ccda;
    --text: #172033;
    --muted: #5b667a;
    --accent: #185adb;
    --accent-hover: #1449b0;
    --danger: #b42318;
    --success: #067647;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

button,
input,
select {
    font: inherit;
}

.hidden {
    display: none !important;
}

.shell {
    min-height: 100vh;
    padding: 16px 20px 20px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
    white-space: nowrap;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.session-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-user {
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
    color: var(--muted);
}

.login-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
}

.login-form,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.login-form {
    width: 100%;
    max-width: 420px;
    padding: 36px 40px 32px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.login-brand-logo {
    display: block;
    width: 88px;
    height: 88px;
    object-fit: contain;
    flex-shrink: 0;
    margin-right: -14px;
}

.topbar-logo {
    display: block;
    height: 56px;
    width: 56px;
    object-fit: contain;
    flex-shrink: 0;
    mix-blend-mode: multiply;
    margin-right: -14px;
}

.login-brand-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.login-brand-sub {
    font-size: 14px;
    color: var(--muted);
    margin-top: 2px;
}

.login-submit {
    width: 100%;
    min-height: 46px;
    font-size: 15px;
    margin-top: 4px;
}

.app-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(420px, 1fr);
    gap: 20px;
    align-items: start;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin: 0;
}

.tab-button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.tab-button.is-active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.receiving-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.receiving-layout.is-detail-open {
    grid-template-columns: minmax(0, 1fr);
}

.receiving-layout:not(.is-detail-open) .receiving-detail-panel {
    display: none;
}

.receiving-layout.is-detail-open .receiving-list-panel {
    display: none;
}

.panel {
    min-width: 0;
}

.panel-list,
.panel-detail {
    min-height: 680px;
}

.panel-operations {
    grid-column: 1 / -1;
}

.panel-operations .panel-header {
    flex-wrap: nowrap;
    align-items: center;
}

.panel-operations .panel-heading {
    flex-shrink: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.receiving-master-header {
    align-items: center;
    justify-content: flex-start;
}

.receiving-detail-header {
    align-items: flex-end;
}

.receiving-master-header .panel-header-actions {
    align-self: center;
    align-items: center;
}

.receiving-detail-header .panel-heading {
    flex: 0 0 auto;
}

.receiving-detail-header .panel-header-actions {
    align-items: center;
    flex-wrap: nowrap;
}

.receiving-detail-header .ghost-button,
.receiving-master-header .ghost-button {
    min-height: 34px;
    padding: 0 12px;
    white-space: nowrap;
}

.receiving-list-heading {
    flex-wrap: wrap;
}

.receiving-list-actions {
    margin-left: 4px;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.receiving-list-actions .ghost-button,
.receiving-list-actions .primary-button {
    min-width: 142px;
    min-height: 36px;
    padding: 0 12px;
    white-space: nowrap;
}

.panel-header h2,
.history-block h3 {
    margin: 0;
    font-size: 18px;
}

.panel-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: #175cd3;
    border: 1px solid #cfe0ff;
    font-size: 13px;
    font-weight: 600;
}

.subsection-header,
.panel-header-actions,
.panel-footer,
.pager,
.pager-actions {
    display: flex;
    align-items: center;
}

.subsection-header,
.panel-footer {
    justify-content: space-between;
    gap: 16px;
}

.subsection-header {
    margin-bottom: 12px;
}

.panel-header-actions,
.pager,
.pager-actions {
    gap: 10px;
}

.panel-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: flex-end;
}

.toolbar-search {
    flex: 1 1 100%;
    width: 100%;
}

.operations-toolbar {
    flex-wrap: nowrap;
    align-items: center;
    align-self: center;
}

.operations-toolbar .toolbar-search {
    flex: 1 1 160px;
    min-width: 120px;
    width: auto;
}

.operations-filter-select {
    flex-shrink: 0;
    width: auto;
    min-width: 130px;
}

.panel-footer {
    padding: 14px 18px 16px;
    border-top: 1px solid var(--border);
}

.pager {
    flex-wrap: wrap;
}

.pager-info {
    color: var(--muted);
    font-size: 14px;
}

.search-row {
    display: flex;
    gap: 10px;
    flex: 1 1 320px;
    width: auto;
    max-width: 420px;
    min-width: 0;
    align-items: center;
}

.search-row input {
    flex: 1 1 auto;
    min-width: 0;
}

.search-submit-button {
    flex: 0 0 auto;
    min-width: 42px;
    padding: 0 12px;
}

.field {
    display: grid;
    gap: 6px;
}

.field label {
    color: var(--muted);
    font-size: 14px;
}

.field-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
}

.field-page-size label {
    white-space: nowrap;
}

.field-page-size select {
    width: 110px;
}

input,
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--text);
}

input:focus,
select:focus {
    outline: 2px solid rgba(24, 90, 219, 0.16);
    border-color: var(--accent);
}

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
}

.primary-button {
    background: var(--accent);
    color: #fff;
}

.primary-button:hover {
    background: var(--accent-hover);
}

.ghost-button {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
}

.ghost-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.danger-button {
    color: var(--danger);
}

.compact-button {
    min-height: 34px;
    padding: 0 10px;
}

.edit-inline-button {
    min-height: auto;
    padding: 4px;
    line-height: 1;
    flex-shrink: 0;
}

.button-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.state-text {
    padding: 16px 18px;
    color: var(--muted);
}

.state-text.compact {
    padding: 0;
}

.panel-padding {
    padding: 16px 18px;
}

.error-text {
    margin-top: 10px;
    color: var(--danger);
}

.success-text {
    color: var(--success);
}

.table-wrap {
    overflow: auto;
}

.receiving-list-panel .data-table {
    font-size: 16px;
}

.receiving-list-panel .data-table th,
.receiving-list-panel .data-table td {
    padding: 14px 14px;
    vertical-align: middle;
    font-size: 16px;
    line-height: 1.35;
}

.receiving-list-panel .data-table th {
    font-size: 15px;
}

.receiving-list-panel .data-table th:nth-child(5),
.receiving-list-panel .data-table th:nth-child(6),
.receiving-list-panel .data-table th:nth-child(7),
.receiving-list-panel .data-table th:nth-child(8),
.receiving-list-panel .data-table td:nth-child(5),
.receiving-list-panel .data-table td:nth-child(6),
.receiving-list-panel .data-table td:nth-child(7),
.receiving-list-panel .data-table td:nth-child(8) {
    text-align: right;
}

.receiving-list-panel .table-actions-cell {
    width: 1%;
    text-align: right;
    vertical-align: middle;
}

.receiving-list-panel .table-actions {
    justify-content: flex-end;
}

.receiving-list-panel .compact-button {
    min-width: 112px;
    min-height: 36px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.data-table thead th {
    position: sticky;
    top: 0;
    background: var(--surface-muted);
    color: var(--muted);
    font-weight: 600;
    z-index: 1;
}

.data-table tbody tr.is-clickable {
    cursor: pointer;
}

.data-table tbody tr.is-clickable:hover,
.data-table tbody tr.is-selected {
    background: #eef4ff;
}

.data-table tfoot tr.totals-row td {
    border-top: 2px solid var(--border);
    border-bottom: none;
    background: var(--surface-muted);
    font-size: 14px;
}

.table-message td {
    color: var(--muted);
    text-align: center;
    padding: 18px 14px;
    background: var(--surface-muted);
}

.detail-layout {
    padding: 14px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.compact-detail-grid {
    grid-template-columns:
        minmax(110px, 1.2fr)
        minmax(80px, 0.65fr)
        minmax(80px, 0.65fr)
        minmax(110px, 1.2fr)
        minmax(100px, 1fr)
        minmax(100px, 1fr);
}

.metric-wide {
    grid-column: span 2;
}

.loyalty-metric {
    grid-column: span 2;
}

.metric {
    padding: 8px 10px;
    background: #fbfcfe;
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 0;
}

.metric-label {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
}

.metric strong {
    display: block;
    font-size: 13px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.metric-with-icon {
    display: flex !important;
    align-items: center;
    gap: 6px;
}

.info-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    color: var(--muted);
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

.customer-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.customer-back-button {
    display: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(23, 32, 51, 0.38);
}

.modal-panel {
    width: min(620px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(23, 32, 51, 0.22);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 17px;
}

.modal-form {
    margin: 0;
    border: 0;
    border-radius: 0;
}

.adjustment-form {
    padding: 12px;
    margin-bottom: 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.form-section-label {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: end;
}

.field-grow {
    flex: 1 1 auto;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.history-block {
    min-width: 0;
}

.history-block .table-wrap {
    border: 1px solid var(--border);
    border-radius: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.pill.admin {
    background: #eff8ff;
    color: #175cd3;
}

.pill.system {
    background: #f2f4f7;
    color: #344054;
}

.delta-positive {
    color: var(--success);
    font-weight: 600;
}

.delta-negative {
    color: var(--danger);
    font-weight: 600;
}

.receiving-detail {
    padding: 10px 12px 12px;
}

.receiving-header-fields {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex: 1 1 760px;
    min-width: 0;
}

.receiving-header-fields .field {
    margin: 0;
}

.receiving-title-field {
    flex: 1 1 220px;
    max-width: 320px;
}

.receiving-title-field input {
    min-height: 34px;
}

.receiving-file-field {
    flex: 1 1 220px;
    max-width: 300px;
}

.receiving-file-field input[type="file"] {
    min-height: 34px;
    padding-top: 6px;
}

.receiving-actions-field {
    flex: 0 0 auto;
}

.receiving-actions-field > label {
    visibility: hidden;
}

.receiving-delivery-field {
    flex: 0 0 115px;
}

.receiving-delivery-field input {
    min-height: 34px;
}

.receiving-total-field {
    flex: 0 0 125px;
}

.receiving-total-field input {
    min-height: 34px;
    background: var(--surface-muted);
    color: var(--text);
}

.receiving-table-wrap {
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 68vh;
}

.receiving-table-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
}

.receiving-pretable-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    margin: 0 0 8px;
    min-height: 36px;
}

.undo-button,
.redo-button,
.compact-action-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 10px;
}

.shortcut-label {
    color: var(--muted);
    font-size: 12px;
}

.archive-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #f2f4f7;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.table-actions-cell {
    white-space: nowrap;
}

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

.receiving-table {
    min-width: 1880px;
}

.receiving-table th,
.receiving-table td {
    padding: 8px;
    vertical-align: middle;
}

.receiving-table input,
.receiving-table select {
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 6px;
}

.receiving-table tbody tr:focus-within {
    background: #fff8e5;
}

.receiving-table tbody tr.is-existing-product {
    background: #eef9f0;
}

.receiving-table tbody tr.is-existing-product:focus-within {
    background: #e0f4e5;
}

.receiving-table tbody tr.is-duplicate-article,
.receiving-table tbody tr.is-existing-product.is-duplicate-article {
    background: #fff1f0;
}

.receiving-table tbody tr.is-duplicate-article:focus-within,
.receiving-table tbody tr.is-existing-product.is-duplicate-article:focus-within {
    background: #ffe4e2;
}

.receiving-table tbody tr.is-validation-error {
    background: #fff7ed;
}

.receiving-table tbody tr.is-validation-error:focus-within {
    background: #ffedd5;
}

.receiving-table tbody tr.is-duplicate-article.is-validation-error,
.receiving-table tbody tr.is-existing-product.is-duplicate-article.is-validation-error {
    background: #fff1f0;
}

.article-input {
    min-width: 120px;
}

.article-input.is-duplicate,
.receiving-table .is-required-missing {
    border-color: #d92d20;
    box-shadow: 0 0 0 1px #d92d20;
}

.article-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
}

.product-status {
    display: none;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 50%;
    background: #12b76a;
    position: relative;
}

.product-status.is-found {
    display: inline-block;
}

.product-status.is-found::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 3px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.receiving-name-input {
    min-width: 360px;
}

.group-select {
    min-width: 240px;
}

.money-input {
    min-width: 135px;
}

.quantity-input {
    min-width: 90px;
}

.real-cost-cell,
.markup-cell,
.source-file-cell {
    white-space: nowrap;
}

.supplier-input {
    min-width: 320px;
}

.source-file-cell {
    width: 44px;
    min-width: 44px;
    overflow: visible;
    text-align: center;
    position: relative;
}

.file-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #475467;
}

.file-icon {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-tooltip {
    position: relative;
}

.icon-tooltip[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    z-index: 20;
    max-width: 360px;
    width: max-content;
    padding: 6px 8px;
    border-radius: 6px;
    background: #172033;
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
    white-space: normal;
    box-shadow: 0 8px 20px rgba(23, 32, 51, 0.18);
}

.icon-tooltip[data-tooltip=""]:hover::after {
    display: none;
}

.payout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.payouts-toolbar-panel .panel-header {
    flex-wrap: nowrap;
}

.payout-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.payout-month-input {
    width: 175px;
}

.payout-employee-select {
    width: 220px;
}

.payout-periods {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.payout-total {
    font-size: 22px;
    line-height: 1.2;
    white-space: nowrap;
}

.payout-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 10px;
    padding: 14px;
}

.payout-metric strong {
    font-size: 16px;
}

.payout-subsection {
    padding: 0 14px 14px;
}

.payout-subsection .subsection-header {
    margin: 4px 0 10px;
}

.payout-subsection h3 {
    margin: 0;
    font-size: 16px;
}

.payout-birthday-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    padding: 14px;
}

.payout-birthday-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fbfcfe;
}

.payout-birthday-item strong,
.payout-birthday-item span {
    display: block;
}

.payout-birthday-item span {
    color: var(--muted);
    font-size: 13px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.success-badge {
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.warning-badge {
    color: #93370d;
    background: #fffaeb;
    border: 1px solid #fedf89;
}

.payment-date-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #abefc6;
    background: #ecfdf3;
    color: #067647;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .app-layout,
    .receiving-layout {
        grid-template-columns: 1fr;
    }

    .panel-list,
    .panel-detail {
        min-height: auto;
    }

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

    .compact-detail-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .metric-wide {
        grid-column: span 1;
    }

    .loyalty-metric {
        grid-column: span 2;
    }

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

    .customer-back-button {
        display: inline-flex;
    }

    .app-layout.is-mobile-detail-open .panel-list {
        display: none;
    }
}

@media (max-width: 900px) {
    .receiving-header-fields {
        flex-wrap: wrap;
    }

    .receiving-delivery-field,
    .receiving-total-field {
        flex: 1 1 calc(50% - 10px);
        min-width: 0;
    }
}

@media (max-width: 720px) {
    .shell {
        padding: 12px;
    }

    .topbar {
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
    }

    .brand-block {
        flex: 1 1 auto;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
    }

    .topbar h1 {
        font-size: 17px;
        flex: 1 1 auto;
    }

    .admin-tabs {
        flex: 1 1 100%;
        gap: 6px;
    }

    .tab-button {
        flex: 1;
        min-height: 34px;
        font-size: 13px;
        padding: 0 6px;
        border-radius: 6px;
    }

    .session-box {
        flex: 0 0 auto;
        gap: 0;
    }

    .session-user {
        display: none;
    }

    .session-box .ghost-button {
        min-height: 34px;
        padding: 0 10px;
        font-size: 13px;
    }

    .panel-header,
    .subsection-header,
    .panel-footer,
    .form-row,
    .form-actions,
    .customer-actions-row,
    .panel-header-actions,
    .payout-filters,
    .receiving-header-fields,
    .receiving-toolbar,
    .receiving-summary,
    .pager,
    .pager-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-row {
        flex: 0 0 auto;
        max-width: none;
        width: 100%;
        flex-direction: row;
        align-items: center;
    }

    .search-submit-button .button-label-text {
        display: none;
    }

    .search-submit-button {
        min-width: 42px;
        width: 42px;
        padding: 0;
        justify-content: center;
    }

    .receiving-header-fields {
        min-width: 0;
        flex-wrap: wrap;
    }

    .receiving-title-field,
    .receiving-file-field,
    .receiving-delivery-field,
    .receiving-total-field {
        max-width: none;
        flex: 1 1 100%;
    }

    .receiving-actions-field {
        width: 100%;
    }

    .receiving-actions-field > label {
        display: none;
    }

    .receiving-actions-field .panel-header-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .receiving-summary {
        display: flex;
    }

    .field-page-size {
        width: 100%;
    }

    .payouts-toolbar-panel .panel-header {
        flex-wrap: wrap;
    }

    .payout-filters {
        width: 100%;
        min-width: 0;
        flex-wrap: nowrap;
        flex-shrink: 1;
    }

    .payout-month-input,
    .payout-employee-select {
        width: 100%;
        min-width: 0;
    }

    .payout-filters .ghost-button,
    .payout-filters .primary-button {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

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

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

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

    .customer-actions-row .primary-button,
    .customer-actions-row .ghost-button {
        width: 100%;
        justify-content: center;
    }

    .pager {
        align-items: stretch;
    }

    .pager-actions {
        flex-direction: row;
    }

    .pager-actions .ghost-button {
        flex: 1;
        justify-content: center;
    }

    .modal-panel {
        border-radius: 12px;
    }

    .panel-operations .panel-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .operations-toolbar {
        flex-wrap: wrap;
        flex-direction: row;
        width: 100%;
    }

    .operations-toolbar .toolbar-search {
        flex: 1 1 100%;
        width: 100%;
    }

    .operations-filter-select {
        flex: 1 1 calc(50% - 5px);
        width: auto;
    }

    .login-form {
        padding: 28px 24px 24px;
    }
}

@media (max-width: 560px) {
    .detail-grid,
    .compact-detail-grid,
    .payout-summary-grid {
        grid-template-columns: 1fr;
    }

    .loyalty-metric,
    .metric-wide {
        grid-column: span 1;
    }

    /* Таблица операций: скрыть Баланс(5), Источник(6), Кто(7) */
    .panel-operations .data-table th:nth-child(5),
    .panel-operations .data-table td:nth-child(5),
    .panel-operations .data-table th:nth-child(6),
    .panel-operations .data-table td:nth-child(6),
    .panel-operations .data-table th:nth-child(7),
    .panel-operations .data-table td:nth-child(7) {
        display: none;
    }

    /* История клиента: скрыть Баланс(4), Кто(5) */
    .history-block .data-table th:nth-child(4),
    .history-block .data-table td:nth-child(4),
    .history-block .data-table th:nth-child(5),
    .history-block .data-table td:nth-child(5) {
        display: none;
    }

    /* Список клиентов: скрыть Карта(3) */
    .panel-list .data-table th:nth-child(3),
    .panel-list .data-table td:nth-child(3) {
        display: none;
    }

    /* Список приёмок: скрыть Добавил(3), Изменил(4), С доставкой(7), Доставка(8) */
    .receiving-list-panel .data-table th:nth-child(3),
    .receiving-list-panel .data-table td:nth-child(3),
    .receiving-list-panel .data-table th:nth-child(4),
    .receiving-list-panel .data-table td:nth-child(4),
    .receiving-list-panel .data-table th:nth-child(7),
    .receiving-list-panel .data-table td:nth-child(7),
    .receiving-list-panel .data-table th:nth-child(8),
    .receiving-list-panel .data-table td:nth-child(8) {
        display: none;
    }

    .shell {
        padding: 8px;
    }

    .panel-header {
        padding: 12px 14px;
    }

    .panel-footer {
        padding: 10px 14px 12px;
    }

    .detail-layout {
        padding: 10px;
    }
}
