:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #17202a;
    background: #f5f6f8;
    line-height: 1.5;
}

* { box-sizing: border-box; }

body { margin: 0; }

a { color: #2457c5; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 64px;
}

.container.narrow { width: min(820px, calc(100% - 32px)); }

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

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: 20px; }

.eyebrow {
    margin-bottom: 4px;
    color: #68707c;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.back-link { display: inline-block; margin-bottom: 8px; }

.card {
    background: white;
    border: 1px solid #e3e6eb;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 3px 14px rgb(20 30 50 / 4%);
}

.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }

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

th, td {
    padding: 14px 16px;
    border-bottom: 1px solid #eceef2;
    text-align: left;
    white-space: nowrap;
}

th {
    background: #fafbfc;
    color: #626b78;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

tbody tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.button:hover { text-decoration: none; }
.button.primary { color: white; background: #2457c5; }
.button.secondary { color: #26313f; background: #eef0f3; }
.button:disabled { opacity: .5; cursor: not-allowed; }

.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef0f3;
    font-size: 12px;
    font-weight: 700;
}

.badge.accent { background: #e9efff; color: #244fa9; }
.badge.warning { background: #fff4d6; color: #755600; }
.badge.large { padding: 7px 12px; }

.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.details {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 10px 16px;
    margin: 0;
}
.details dt { color: #6b7480; }
.details dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-weight: 550;
}

.money { font-size: 34px; font-weight: 750; margin-bottom: 8px; }
.muted, .hint { color: #727b87; }

.notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 9px;
}
.notice.success { background: #eaf8ef; color: #216139; }
.notice.warning { background: #fff5da; color: #6e5400; }
.notice.error { background: #fdecec; color: #8c2828; }
.notice p:last-child { margin-bottom: 0; }

.form { padding: 26px; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.form label { display: flex; flex-direction: column; gap: 7px; font-weight: 600; }
.form label.full-width { grid-column: 1 / -1; }

input, select, textarea {
    width: 100%;
    border: 1px solid #cfd4dc;
    border-radius: 8px;
    padding: 10px 11px;
    background: white;
    color: inherit;
    font: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid #bdd0ff;
    border-color: #5d83df;
}

textarea { resize: vertical; }
.hint { font-size: 12px; font-weight: 400; }
.field-error { color: #a83232; font-size: 12px; font-weight: 500; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #eceef2;
}

.table-card-actions {
    margin-top: 0;
    padding: 18px 20px 20px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 0;
}

.section-heading h2,
.section-heading h3 {
    margin-bottom: 0;
}

.card:not(.table-card) > .section-heading {
    padding: 0;
    margin-bottom: 18px;
}

.embedded-form {
    padding: 0;
    margin-top: 18px;
}

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

.subsection-heading .hint {
    text-align: right;
}


.nested-card {
    margin-top: 18px;
    background: #fafbfc;
    box-shadow: none;
}

.nested-card > .section-heading {
    padding: 0;
    margin-bottom: 16px;
}

.nested-card > .form {
    padding: 0;
}

.nested-card > .notice:last-child {
    margin-bottom: 0;
}

@media (max-width: 720px) {
    .container { padding-top: 24px; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .two-columns, .form-grid { grid-template-columns: 1fr; }
    .form label.full-width { grid-column: auto; }
    .details { grid-template-columns: 1fr; gap: 2px; }
    .details dd { margin-bottom: 10px; }
    .subsection-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
    .subsection-heading .hint { text-align: left; }
}

.admin-nav {
    background: #ffffff;
    border-bottom: 1px solid #e3e6eb;
}

.admin-nav-inner {
    width: min(1180px, calc(100% - 32px));
    min-height: 58px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.brand {
    margin-right: 28px;
    flex: 0 0 auto;
    white-space: nowrap;
    color: #17202a;
    font-weight: 800;
    letter-spacing: -.02em;
}

.brand:hover { text-decoration: none; }

.nav-links {
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
    display: flex;
    align-items: stretch;
    gap: 4px;
    min-height: 58px;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: #5e6875;
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover {
    color: #17202a;
    text-decoration: none;
}

.nav-links a.active {
    color: #2457c5;
    border-bottom-color: #2457c5;
}

/* The panel is outside the scrolling links and out of normal document flow. */
.nav-more { flex: 0 0 auto; align-self: stretch; position: relative; }
.nav-more > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 58px;
    padding: 0 10px;
    color: #5e6875;
    font-size: 14px;
    font-weight: 650;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    list-style: none;
}
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary:hover { color: #17202a; }
.nav-more[open] > summary { color: #2457c5; border-bottom-color: #2457c5; }
.nav-more[open] > summary > span { transform: rotate(180deg); }
.nav-more.active > summary { color: #2457c5; border-bottom-color: #2457c5; }
.nav-more > summary:focus-visible, .nav-more-panel > a:focus-visible {
    outline: 2px solid #5d83df;
    outline-offset: -2px;
}
.nav-more-panel {
    position: absolute;
    z-index: 100;
    top: calc(100% + 6px);
    right: 0;
    width: 260px;
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 130px);
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid #e3e6eb;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgb(20 30 50 / 16%);
}
.nav-more:not([open]) > .nav-more-panel { display: none; }
.nav-more-panel > a {
    display: block;
    padding: 10px 12px;
    border-radius: 7px;
    color: #5e6875;
    font-size: 14px;
    font-weight: 650;
}
.nav-more-panel > a:hover { background: #f5f6f8; color: #17202a; text-decoration: none; }
.nav-more-panel > a.active { background: #e9efff; color: #2457c5; }

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spaced { margin-top: 18px; }
.empty-inline { padding: 8px 20px 22px; color: #727b87; }
.wrap { white-space: pre-wrap; }
.block { display: block; }
.code { margin-top: 6px; margin-bottom: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.badge.success-badge { background: #eaf8ef; color: #216139; }
.badge.danger-badge { background: #fdecec; color: #8c2828; }

.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: 10px !important;
}

.checkbox-label input {
    width: auto;
    margin: 0;
}

@media (max-width: 720px) {
    .admin-nav-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0 8px;
        padding-top: 12px;
    }

    .admin-nav-inner > .brand { grid-column: 1 / -1; }
    .nav-links { width: 100%; overflow-x: auto; }
    .nav-more { grid-column: 2; grid-row: 2; position: static; }

    .nav-links a {
        white-space: nowrap;
    }

    .button-row {
        width: 100%;
    }
}

.form-section {
    padding: 4px 0 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid #eceef2;
}

.form-section:last-of-type {
    margin-bottom: 0;
    border-bottom: 0;
}

.form-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.form-section-heading h2,
.form-section-heading p {
    margin-bottom: 0;
}

.form-section-heading > .muted {
    max-width: 360px;
    font-size: 13px;
}

.form-details > summary {
    color: #596372;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.form-section > .form-details > summary {
    font-size: 14px;
}

.form-details[open] > summary {
    margin-bottom: 14px;
}

.form-details > .form-grid {
    margin-top: 14px;
}

.choice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.choice-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    gap: 10px !important;
    padding: 14px;
    border: 1px solid #d7dce4;
    border-radius: 10px;
    cursor: pointer;
    background: #fafbfc;
}

.choice-card:has(input:checked) {
    border-color: #5d83df;
    background: #f2f6ff;
}

.choice-card input {
    width: auto;
    margin: 3px 0 0;
}

.choice-card span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.choice-card small {
    color: #727b87;
    font-weight: 400;
}

[hidden] {
    display: none !important;
}

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

    .form-section-heading {
        flex-direction: column;
        gap: 6px;
    }
}

.order-items-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
}

.button.compact {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
}

.order-items-list {
    display: grid;
    gap: 14px;
}

.order-item-card {
    padding: 16px;
    border: 1px solid #dde2e9;
    border-radius: 10px;
    background: #fafbfc;
}

.order-item-card .form-grid {
    gap: 14px;
}

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

.text-button {
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.text-button.danger {
    color: #a83232;
}

@media (max-width: 720px) {
    .order-items-heading {
        align-items: stretch;
        flex-direction: column;
    }
}

.device-assignment-cell {
    min-width: 320px;
}

.device-assignment-summary {
    margin-bottom: 8px;
    font-weight: 650;
}

.device-assignment-list {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.device-assignment-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.device-assignment-row form {
    margin: 0;
}

.device-assignment-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.device-assignment-form select {
    min-width: 220px;
}

@media (max-width: 720px) {
    .device-assignment-cell {
        min-width: 260px;
    }

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


.delivery-address-block,
.cdek-address-block {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eceef2;
}

.compact-inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.compact-inline-form input {
    flex: 1 1 360px;
}

.compact-inline-form .muted {
    flex: 1 1 auto;
    margin: 0;
}

@media (max-width: 720px) {
    .compact-inline-form {
        align-items: stretch;
        flex-direction: column;
    }
}


.address-autocomplete {
    position: relative;
    width: 100%;
    min-width: 0;
}

.address-autocomplete > input[type="text"] {
    width: 100%;
}

.address-autocomplete.disabled {
    opacity: 0.7;
}

.address-suggestions {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    overflow: hidden;
    border: 1px solid #d9dde5;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(20, 28, 45, 0.14);
}

.address-suggestion {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #eceef2;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.address-suggestion:last-child {
    border-bottom: 0;
}

.address-suggestion:hover,
.address-suggestion:focus {
    background: #f4f6f9;
    outline: none;
}

.address-edit-form .address-autocomplete {
    flex: 1 1 520px;
}

.warning-text {
    color: #8a5a00;
}

@media (max-width: 720px) {
    .address-autocomplete,
    .address-edit-form .address-autocomplete {
        width: 100%;
        flex-basis: auto;
    }
}


.dashboard-subtitle {
    margin: 8px 0 0;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.dashboard-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 128px;
    padding: 18px;
    border: 1px solid #e3e6eb;
    border-radius: 14px;
    background: #fff;
    color: inherit;
    box-shadow: 0 3px 14px rgb(20 30 50 / 4%);
}

.dashboard-metric:hover {
    border-color: #c8d2e3;
    text-decoration: none;
}

.dashboard-metric.warning {
    border-color: #ead79e;
    background: #fffaf0;
}

.dashboard-metric.danger {
    border-color: #efbaba;
    background: #fff5f5;
}

.dashboard-metric-value {
    font-size: 30px;
    font-weight: 780;
    line-height: 1.1;
}

.dashboard-metric-label {
    font-weight: 700;
}

.dashboard-metric small {
    margin-top: auto;
    color: #727b87;
}

.dashboard-status-list {
    display: grid;
}

.dashboard-status-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid #eceef2;
    color: inherit;
}

.dashboard-status-list a:first-child {
    padding-top: 0;
}

.dashboard-status-list a:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.dashboard-status-list a:hover {
    color: #2457c5;
    text-decoration: none;
}

.dashboard-status-list strong {
    min-width: 34px;
    text-align: right;
    font-size: 18px;
}

.dashboard-action-list {
    display: grid;
}

.dashboard-action {
    display: grid;
    grid-template-columns: 5px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 66px;
    padding: 10px 18px 10px 0;
    border-top: 1px solid #eceef2;
    color: inherit;
}

.dashboard-action:hover {
    background: #fafbfc;
    text-decoration: none;
}

.dashboard-action-indicator {
    width: 5px;
    align-self: stretch;
    background: #bdc5d0;
}

.dashboard-action.warning .dashboard-action-indicator {
    background: #d8a522;
}

.dashboard-action.danger .dashboard-action-indicator {
    background: #c74848;
}

.dashboard-action-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.dashboard-action-content small {
    overflow: hidden;
    color: #727b87;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-action-arrow {
    color: #8a929e;
    font-size: 20px;
}

.filter-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.filter-presets a {
    padding: 7px 11px;
    border: 1px solid #d9dde5;
    border-radius: 999px;
    background: #fff;
    color: #596372;
    font-size: 14px;
    font-weight: 650;
}

.filter-presets a:hover,
.filter-presets a.active {
    border-color: #9eb4e7;
    background: #eef3ff;
    color: #2457c5;
    text-decoration: none;
}

.filter-card {
    margin-bottom: 14px;
    padding: 16px;
}

.filter-form {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr)) auto;
    align-items: end;
    gap: 12px;
}

.filter-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #5e6875;
    font-size: 12px;
    font-weight: 700;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
}

.list-summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 0 2px 12px;
    font-size: 13px;
}

@media (max-width: 960px) {
    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .filter-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .dashboard-metrics,
    .filter-form {
        grid-template-columns: 1fr;
    }

    .filter-search {
        grid-column: auto;
    }

    .dashboard-action-content small {
        white-space: normal;
    }

    .list-summary {
        flex-direction: column;
        gap: 4px;
    }
}


.quality-subtitle {
    margin: 8px 0 0;
}

.quality-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quality-filter-form {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr));
    align-items: end;
    gap: 12px;
}

.quality-filter-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #5e6875;
    font-size: 12px;
    font-weight: 700;
}

.quality-filter-search {
    grid-column: span 2;
}

.quality-case-table td {
    vertical-align: top;
}

.quality-problem-cell {
    min-width: 280px;
    max-width: 420px;
    white-space: normal;
}

.quality-problem,
.quality-root-cause {
    margin-top: 7px;
    white-space: pre-wrap;
}

.quality-root-cause {
    color: #555f6d;
    font-size: 13px;
}

@media (max-width: 1080px) {
    .quality-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 720px) {
    .quality-metrics,
    .quality-filter-form {
        grid-template-columns: 1fr;
    }

    .quality-filter-search {
        grid-column: auto;
    }
}


.inventory-compact-form,
.inventory-bom-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.inventory-compact-form label,
.inventory-bom-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #5e6875;
    font-size: 12px;
    font-weight: 700;
}

.inventory-compact-form .full-width,
.inventory-bom-form .full-width {
    grid-column: 1 / -1;
}

.inventory-compact-form .form-actions,
.inventory-bom-form .form-actions {
    grid-column: 1 / -1;
    margin-top: 4px;
    padding-top: 12px;
}

.inventory-adjust-form {
    display: grid;
    grid-template-columns: minmax(110px, .8fr) minmax(90px, .6fr) minmax(150px, 1fr) auto;
    gap: 7px;
    min-width: 520px;
}

.inventory-adjust-form input,
.inventory-adjust-form select {
    min-width: 0;
}

@media (max-width: 720px) {
    .inventory-compact-form,
    .inventory-bom-form {
        grid-template-columns: 1fr;
    }

    .inventory-compact-form .full-width,
    .inventory-bom-form .full-width,
    .inventory-compact-form .form-actions,
    .inventory-bom-form .form-actions {
        grid-column: auto;
    }
}

.diagnosis-results {
    margin-top: 22px;
}

.diagnosis-results > .hint {
    margin-bottom: 12px;
}

.diagnosis-result-list {
    display: grid;
    gap: 10px;
}

.diagnosis-result-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding: 12px 0;
    border-top: 1px solid #eceef2;
}

.diagnosis-result-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.diagnosis-comment {
    grid-column: 1 / -1;
    min-width: 0;
}

.diagnosis-comment summary {
    display: inline-block;
    color: #596372;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.diagnosis-comment input {
    display: block;
    width: 100%;
    min-width: 0;
    margin-top: 8px;
    box-sizing: border-box;
}

.diagnosis-result-form .button {
    max-width: 100%;
}

.diagnosis-confirmed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    padding: 14px 0 2px;
    border-top: 1px solid #eceef2;
}

@media (max-width: 860px) {
    .diagnosis-result-form {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .diagnosis-result-form .button {
        width: 100%;
    }

    .diagnosis-confirmed {
        align-items: flex-start;
        flex-direction: column;
    }
}

.delivery-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.delivery-method-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid #e3e6eb;
    border-radius: 12px;
    background: #fff;
}

.delivery-method-card > h3 {
    margin-top: 0;
    margin-bottom: 6px;
}

.delivery-method-card > .hint {
    margin-bottom: 14px;
}

.delivery-method-card .form {
    margin-top: 0;
}

.pickup-search-form {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px dashed #d8dde5;
    border-radius: 10px;
    background: #fafbfc;
}

.pickup-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.pickup-search-row .address-autocomplete {
    min-width: 0;
}

.pickup-search-row .button {
    white-space: nowrap;
}

.delivery-api-block {
    margin: 14px 0 18px;
}

.delivery-api-form {
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #e3e6eb;
    border-radius: 12px;
    background: #fafbfc;
}

.delivery-api-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.delivery-api-primary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    min-width: 0;
}

.delivery-api-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, .65fr);
    gap: 10px;
    min-width: 0;
}

.delivery-api-primary label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    color: #5e6875;
    font-size: 12px;
    font-weight: 700;
}

.delivery-api-primary input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.delivery-api-advanced summary {
    color: #596372;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.delivery-api-advanced .form-grid {
    margin-top: 10px;
}

.compact-row {
    gap: 8px;
    margin-top: 5px;
}

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

@media (max-width: 720px) {
    .pickup-search-row,
    .delivery-api-primary,
    .delivery-api-fields {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .delivery-api-primary .button {
        width: 100%;
    }
}


.weekly-sales-section {
    margin-bottom: 18px;
}

.weekly-sales-heading {
    padding: 0 2px 10px;
}

.weekly-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.weekly-chart-card {
    min-width: 0;
    padding: 18px;
}

.weekly-chart-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.weekly-chart-card-heading h3 {
    margin: 0 0 4px;
}

.weekly-chart-scroll {
    overflow-x: auto;
    padding-bottom: 4px;
}

.weekly-chart {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(70px, 1fr);
    gap: 8px;
    min-width: max(100%, calc(var(--weeks) * 78px));
    padding: 8px 2px 0;
}

.weekly-chart-column {
    display: grid;
    grid-template-rows: 28px 190px 42px;
    gap: 6px;
    min-width: 0;
    padding: 4px 3px 0;
    border-radius: 8px;
}

.weekly-chart-column.current {
    background: #f6f8fc;
}

.weekly-chart-value {
    overflow: hidden;
    color: #4f5967;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weekly-chart-money {
    font-size: 11px;
}

.weekly-chart-bar-area {
    display: flex;
    align-items: flex-end;
    min-height: 0;
    border-bottom: 1px solid #dce1e8;
    background:
        linear-gradient(to top, transparent 24%, #eef1f5 25%, transparent 26%),
        linear-gradient(to top, transparent 49%, #eef1f5 50%, transparent 51%),
        linear-gradient(to top, transparent 74%, #eef1f5 75%, transparent 76%);
}

.weekly-chart-bar {
    width: 100%;
    border-radius: 6px 6px 2px 2px;
    background: #4f78d1;
    transition: height 120ms ease;
}

.weekly-chart-bar.amount {
    background: #447c62;
}

.weekly-chart-bar.zero {
    height: 2px !important;
    background: #dfe4eb;
}

.weekly-chart-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    color: #657080;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.weekly-chart-label small {
    color: #2457c5;
    font-weight: 700;
}

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

/* Preserve context after same-page form submissions. Feedback becomes a floating toast
   only when the page is being restored after a form submit, so normal page notices
   keep their existing in-flow presentation. */
.page-feedback-stack {
    position: fixed;
    z-index: 500;
    top: 16px;
    right: 20px;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.page-feedback-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    border: 1px solid rgb(23 32 42 / 8%);
    box-shadow: 0 12px 34px rgb(20 30 50 / 18%);
    pointer-events: auto;
    transition: opacity 160ms ease, transform 160ms ease;
}

.page-feedback-toast.leaving {
    opacity: 0;
    transform: translateY(-6px);
}

.page-feedback-toast-content {
    flex: 1 1 auto;
    min-width: 0;
}

.page-feedback-close {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin: -3px -4px -3px 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: currentColor;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: .65;
}

.page-feedback-close:hover,
.page-feedback-close:focus-visible {
    background: rgb(0 0 0 / 6%);
    opacity: 1;
    outline: none;
}

@media (max-width: 720px) {
    .page-feedback-stack {
        top: 10px;
        right: 10px;
        width: calc(100vw - 20px);
    }
}

.batch-inventory-actions {
    justify-content: flex-end;
}

.batch-device-status {
    display: flex;
    align-items: center;
    gap: 14px;
}

.batch-device-status form {
    margin: 0;
}

.batch-device-badge {
    align-items: center;
    min-height: 24px;
    line-height: 1;
}

.compact-action {
    min-height: 32px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 13px;
}


.product-resource-list {
    display: grid;
    gap: 10px;
}

.product-resource-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    padding: 14px 0;
    border-bottom: 1px solid #eceef2;
}

.product-resource-item:last-child {
    border-bottom: 0;
}

.product-resource-copy {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.product-resource-copy strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.product-instruction-text {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #eceef2;
}

@media (max-width: 720px) {
    .product-resource-item {
        align-items: stretch;
        flex-direction: column;
    }

    .product-resource-item .button {
        width: 100%;
    }
}


/* Partner create scenario cards contain no content below the heading.
   Remove the generic heading bottom margin and center the action vertically. */
.partner-create-action-heading {
    align-items: center;
    margin-bottom: 0;
}

.partner-create-action-heading .button {
    flex: 0 0 auto;
}

@media (max-width: 720px) {
    .partner-create-action-heading {
        align-items: stretch;
    }

    .partner-create-action-heading .button {
        width: 100%;
    }
}


.device-picking-box {
    margin-top: 12px;
    white-space: normal;
    padding: 12px;
    border: 1px solid #e3e6eb;
    border-radius: 12px;
    background: #fafbfc;
}

.device-pick-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

.device-pick-input {
    flex: 1 1 260px;
    min-width: 220px;
}

.qr-scanner-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgb(0 0 0 / 72%);
}

.qr-scanner-panel {
    width: min(520px, 100%);
    padding: 18px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 60px rgb(0 0 0 / 35%);
}

.qr-scanner-video {
    display: block;
    width: 100%;
    max-height: 65vh;
    margin: 12px 0;
    border-radius: 10px;
    background: #000;
}

@media (max-width: 720px) {
    .device-pick-form .button,
    .device-pick-input {
        width: 100%;
    }
}


.partner-device-verification {
    padding: 12px 14px;
    border: 1px solid #e3e6eb;
    border-radius: 12px;
    background: #fafbfc;
}

.partner-device-verification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.partner-device-verification-head > div {
    min-width: 0;
}

.partner-device-verification-head strong {
    margin-left: 6px;
    overflow-wrap: anywhere;
}

.partner-device-verification-panel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e3e6eb;
}

.partner-device-verification-panel > .hint {
    margin: 0 0 8px;
}

.partner-device-verification-result {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 14px;
    line-height: 1.4;
}

.partner-device-verification-result.success {
    background: #edf8f1;
    color: #23663b;
}

.partner-device-verification-result.warning {
    background: #fff7e8;
    color: #7c5610;
}

.partner-device-verification-result.error {
    background: #fff0f0;
    color: #a12c2c;
}

.partner-device-verification-result .button-row {
    margin-top: 9px;
}

@media (max-width: 720px) {
    .partner-device-verification-head {
        align-items: stretch;
        flex-direction: column;
    }

    .partner-device-verification-head .button {
        width: 100%;
    }
}


/* Partner portal: tables remain for desktop, compact records replace horizontal scrolling on phones. */
.partner-mobile-list {
    display: none;
}

.partner-mobile-record {
    min-width: 0;
    padding: 16px;
    border-bottom: 1px solid #eceef2;
}

.partner-mobile-record:last-child {
    border-bottom: 0;
}

.partner-mobile-record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.partner-mobile-record-title {
    min-width: 0;
}

.partner-mobile-record-title strong,
.partner-mobile-record-title a {
    display: block;
    overflow-wrap: anywhere;
}

.partner-mobile-record-title small {
    display: block;
    margin-top: 2px;
}

.partner-mobile-record-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.partner-mobile-field {
    min-width: 0;
}

.partner-mobile-field.full {
    grid-column: 1 / -1;
}

.partner-mobile-label {
    display: block;
    margin-bottom: 2px;
    color: #727b87;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.partner-mobile-value {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.partner-mobile-value.money-value {
    white-space: nowrap;
}

.partner-mobile-actions {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.partner-mobile-actions form {
    display: grid;
    gap: 8px;
    margin: 0;
}

.partner-mobile-actions .button {
    width: 100%;
}

.partner-mobile-summary-total {
    font-size: 20px;
    font-weight: 760;
}

@media (max-width: 720px) {
    .partner-desktop-table {
        display: none;
    }

    .partner-mobile-list {
        display: block;
    }

    .partner-mobile-record-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .partner-mobile-field.full {
        grid-column: auto;
    }

    .partner-mobile-record-head {
        margin-bottom: 10px;
    }

    .partner-mobile-summary-total {
        font-size: 22px;
    }
}


/* Admin mobile lists: keep dense tables on desktop, switch to readable cards on phones. */
.admin-mobile-list {
    display: none;
}

.admin-mobile-record {
    min-width: 0;
    padding: 16px;
    border-bottom: 1px solid #eceef2;
}

.admin-mobile-record:last-child {
    border-bottom: 0;
}

.admin-mobile-record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.admin-mobile-record-title {
    min-width: 0;
}

.admin-mobile-record-title strong,
.admin-mobile-record-title a {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-mobile-record-title small {
    display: block;
    margin-top: 2px;
}

.admin-mobile-record-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.admin-mobile-field {
    min-width: 0;
}

.admin-mobile-field.full {
    grid-column: 1 / -1;
}

.admin-mobile-label {
    display: block;
    margin-bottom: 2px;
    color: #727b87;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.admin-mobile-value {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.admin-mobile-value.money-value {
    white-space: nowrap;
}

.admin-mobile-actions {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.admin-mobile-actions .button,
.admin-mobile-actions form {
    width: 100%;
}

@media (max-width: 720px) {
    .admin-desktop-table {
        display: none;
    }

    .admin-mobile-list {
        display: block;
    }

    .admin-mobile-record-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .admin-mobile-field.full {
        grid-column: auto;
    }

    .admin-mobile-record-head {
        margin-bottom: 10px;
    }

    .page-header > .button,
    .page-header > .button-row,
    .page-header .button-row .button {
        width: 100%;
    }

    .page-header .button-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dashboard-metric {
        min-height: 108px;
    }

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

    .filter-actions .button,
    .filter-actions .text-button {
        width: 100%;
        text-align: center;
    }

    .nav-links {
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }
}


/* Dense detail tables: stack cells vertically on phones while preserving every action. */
@media (max-width: 720px) {
    .mobile-stack-table {
        overflow: visible;
    }

    .mobile-stack-table table,
    .mobile-stack-table tbody,
    .mobile-stack-table tr,
    .mobile-stack-table td {
        display: block;
        width: 100%;
    }

    .mobile-stack-table thead {
        display: none;
    }

    .mobile-stack-table tr {
        padding: 12px 16px;
        border-bottom: 1px solid #eceef2;
    }

    .mobile-stack-table tr:last-child {
        border-bottom: 0;
    }

    .mobile-stack-table td {
        min-width: 0 !important;
        padding: 5px 0;
        border: 0;
        white-space: normal;
        text-align: left !important;
        overflow-wrap: anywhere;
    }

    .mobile-stack-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        color: #727b87;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .03em;
        text-transform: uppercase;
    }

    .mobile-stack-table .button-row,
    .mobile-stack-table form.button-row {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .mobile-stack-table .button-row .button,
    .mobile-stack-table form.button-row .button,
    .mobile-stack-table select,
    .mobile-stack-table input {
        width: 100%;
        max-width: 100%;
    }

    .card > form.spaced > .button {
        width: 100%;
    }
}


@media (max-width: 720px) {
    .mobile-payment-table td:nth-child(1)::before { content: "Дата"; }
    .mobile-payment-table td:nth-child(2)::before { content: "Тип"; }
    .mobile-payment-table td:nth-child(3)::before { content: "Сумма"; }
    .mobile-payment-table td:nth-child(4)::before { content: "Комментарий"; }
    .mobile-payment-table td:nth-child(5)::before { content: "Состояние"; }
    .mobile-payment-table td:nth-child(6)::before { content: "Действия"; }

    .mobile-shipment-table td:nth-child(1)::before { content: "Создана"; }
    .mobile-shipment-table td:nth-child(2)::before { content: "Перевозчик"; }
    .mobile-shipment-table td:nth-child(3)::before { content: "Статус"; }
    .mobile-shipment-table td:nth-child(4)::before { content: "Номер / трек"; }
    .mobile-shipment-table td:nth-child(5)::before { content: "Маршрут"; }

    .mobile-vehicle-table td:nth-child(1)::before { content: "Автомобиль"; }
    .mobile-vehicle-table td:nth-child(2)::before { content: "Пробег"; }

    .mobile-support-table td:nth-child(1)::before { content: "Обращение"; }
    .mobile-support-table td:nth-child(2)::before { content: "Тип"; }
    .mobile-support-table td:nth-child(3)::before { content: "Статус"; }
    .mobile-support-table td:nth-child(4)::before { content: "Описание"; }
    .mobile-support-table td:nth-child(5)::before { content: "Замена"; }

    .mobile-event-table td:nth-child(1)::before { content: "Дата"; }
    .mobile-event-table td:nth-child(2)::before { content: "Событие"; }
    .mobile-event-table td:nth-child(3)::before { content: "Описание"; }
    .mobile-event-table.order-events td:nth-child(3)::before { content: "Переход"; }
    .mobile-event-table.order-events td:nth-child(4)::before { content: "Описание"; }

    .mobile-component-table td:nth-child(1)::before { content: "Компонент"; }
    .mobile-component-table td:nth-child(2)::before { content: "На устройство"; }
    .mobile-component-table td:nth-child(3)::before { content: "На складе"; }
    .mobile-component-table td:nth-child(4)::before { content: "Статус"; }

    .mobile-replacement-table td:nth-child(1)::before { content: "Обращение"; }
    .mobile-replacement-table td:nth-child(2)::before { content: "Цепочка"; }
    .mobile-replacement-table td:nth-child(3)::before { content: "Статус"; }

    .mobile-payment-table td::before,
    .mobile-shipment-table td::before,
    .mobile-vehicle-table td::before,
    .mobile-support-table td::before,
    .mobile-event-table td::before,
    .mobile-component-table td::before,
    .mobile-replacement-table td::before {
        display: block;
        margin-bottom: 2px;
        color: #727b87;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .03em;
        text-transform: uppercase;
    }
}


@media (max-width: 720px) {
    .mobile-inventory-components td:nth-child(1)::before { content: "Компонент"; }
    .mobile-inventory-components td:nth-child(2)::before { content: "В наличии"; }
    .mobile-inventory-components td:nth-child(3)::before { content: "В пути"; }
    .mobile-inventory-components td:nth-child(4)::before { content: "После поставок"; }
    .mobile-inventory-components td:nth-child(5)::before { content: "Страховой запас"; }
    .mobile-inventory-components td:nth-child(6)::before { content: "Расход 30 дней"; }
    .mobile-inventory-components td:nth-child(7)::before { content: "Запас, дней"; }
    .mobile-inventory-components td:nth-child(8)::before { content: "Закупить"; }
    .mobile-inventory-components td:nth-child(9)::before { content: "Движение"; }

    .mobile-bom-table td:nth-child(1)::before { content: "Товар"; }
    .mobile-bom-table td:nth-child(2)::before { content: "Компонент"; }
    .mobile-bom-table td:nth-child(3)::before { content: "На 1 устройство"; }
    .mobile-bom-table td:nth-child(4)::before { content: "Действие"; }

    .mobile-movement-table td:nth-child(1)::before { content: "Дата"; }
    .mobile-movement-table td:nth-child(2)::before { content: "Компонент"; }
    .mobile-movement-table td:nth-child(3)::before { content: "Операция"; }
    .mobile-movement-table td:nth-child(4)::before { content: "Изменение"; }
    .mobile-movement-table td:nth-child(5)::before { content: "Остаток"; }
    .mobile-movement-table td:nth-child(6)::before { content: "Комментарий"; }

    .mobile-partner-open td:nth-child(1)::before { content: "Выбрать"; }
    .mobile-partner-open td:nth-child(2)::before { content: "Заказ"; }
    .mobile-partner-open td:nth-child(3)::before { content: "Схема"; }
    .mobile-partner-open td:nth-child(4)::before { content: "Оплату принял"; }
    .mobile-partner-open td:nth-child(5)::before { content: "Устройств"; }
    .mobile-partner-open td:nth-child(6)::before { content: "Условие"; }
    .mobile-partner-open td:nth-child(7)::before { content: "Мы должны"; }
    .mobile-partner-open td:nth-child(8)::before { content: "Нам должны"; }
    .mobile-partner-open td:nth-child(9)::before { content: "Остаётся нам"; }
    .mobile-partner-open td:nth-child(10)::before { content: "Действие"; }

    .mobile-partner-closed td:nth-child(1)::before { content: "Заказ"; }
    .mobile-partner-closed td:nth-child(2)::before { content: "Схема"; }
    .mobile-partner-closed td:nth-child(3)::before { content: "Оплату принял"; }
    .mobile-partner-closed td:nth-child(4)::before { content: "Мы должны"; }
    .mobile-partner-closed td:nth-child(5)::before { content: "Нам должны"; }
    .mobile-partner-closed td:nth-child(6)::before { content: "Итог"; }
    .mobile-partner-closed td:nth-child(7)::before { content: "Статус"; }

    .mobile-reconciliation-table td:nth-child(1)::before { content: "Дата"; }
    .mobile-reconciliation-table td:nth-child(2)::before { content: "Операций"; }
    .mobile-reconciliation-table td:nth-child(3)::before { content: "Мы должны"; }
    .mobile-reconciliation-table td:nth-child(4)::before { content: "Нам должны"; }
    .mobile-reconciliation-table td:nth-child(5)::before { content: "Баланс"; }

    .mobile-partner-summary td:nth-child(1)::before { content: "Заказ"; }
    .mobile-partner-summary td:nth-child(2)::before { content: "Начислено нам"; }
    .mobile-partner-summary td:nth-child(3)::before { content: "К выплате партнёру"; }

    .mobile-statement-payments td:nth-child(1)::before { content: "Дата"; }
    .mobile-statement-payments td:nth-child(2)::before { content: "Направление"; }
    .mobile-statement-payments td:nth-child(3)::before { content: "Сумма"; }
    .mobile-statement-payments td:nth-child(4)::before { content: "Состояние"; }
    .mobile-statement-payments td:nth-child(5)::before { content: "Комментарий"; }

    .mobile-statement-stock td:nth-child(1)::before { content: "SN"; }
    .mobile-statement-stock td:nth-child(2)::before { content: "Товар"; }
    .mobile-statement-stock td:nth-child(3)::before { content: "Передано"; }
    .mobile-statement-stock td:nth-child(4)::before { content: "Получено"; }
    .mobile-statement-stock td:nth-child(5)::before { content: "Состояние"; }

    .mobile-statement-reconciliations td:nth-child(1)::before { content: "Дата / ID"; }
    .mobile-statement-reconciliations td:nth-child(2)::before { content: "Операций"; }
    .mobile-statement-reconciliations td:nth-child(3)::before { content: "В пользу владельца"; }
    .mobile-statement-reconciliations td:nth-child(4)::before { content: "В пользу партнёра"; }
    .mobile-statement-reconciliations td:nth-child(5)::before { content: "После взаимозачёта"; }
    .mobile-statement-reconciliations td:nth-child(6)::before { content: "Комментарий"; }

    .mobile-statement-operations td:nth-child(1)::before { content: "Дата / заказ"; }
    .mobile-statement-operations td:nth-child(2)::before { content: "SN реализации"; }
    .mobile-statement-operations td:nth-child(3)::before { content: "Схема / количество"; }
    .mobile-statement-operations td:nth-child(4)::before { content: "Стоимость товаров"; }
    .mobile-statement-operations td:nth-child(5)::before { content: "Оплату принял"; }
    .mobile-statement-operations td:nth-child(6)::before { content: "Начислено владельцу"; }
    .mobile-statement-operations td:nth-child(7)::before { content: "К выплате партнёру"; }
    .mobile-statement-operations td:nth-child(8)::before { content: "Расчёт"; }

    .mobile-support-shipment-table td:nth-child(1)::before { content: "Тип"; }
    .mobile-support-shipment-table td:nth-child(2)::before { content: "Перевозчик"; }
    .mobile-support-shipment-table td:nth-child(3)::before { content: "Трек"; }
    .mobile-support-shipment-table td:nth-child(4)::before { content: "Маршрут"; }
    .mobile-support-shipment-table td:nth-child(5)::before { content: "API"; }
    .mobile-support-shipment-table td:nth-child(6)::before { content: "Кто платит"; }
    .mobile-support-shipment-table td:nth-child(7)::before { content: "Стоимость"; }
    .mobile-support-shipment-table td:nth-child(8)::before { content: "Статус"; }
    .mobile-support-shipment-table td:nth-child(9)::before { content: "Отправлено"; }
    .mobile-support-shipment-table td:nth-child(10)::before { content: "Доставлено"; }

    .mobile-support-events td:nth-child(1)::before { content: "Дата"; }
    .mobile-support-events td:nth-child(2)::before { content: "Тип"; }
    .mobile-support-events td:nth-child(3)::before { content: "Переход"; }
    .mobile-support-events td:nth-child(4)::before { content: "Автор"; }
    .mobile-support-events td:nth-child(5)::before { content: "Сообщение"; }

    .mobile-analytics-products td:nth-child(1)::before { content: "Товар"; }
    .mobile-analytics-products td:nth-child(2)::before { content: "Заказы"; }
    .mobile-analytics-products td:nth-child(3)::before { content: "Штук"; }
    .mobile-analytics-products td:nth-child(4)::before { content: "Сумма"; }
    .mobile-analytics-products td:nth-child(5)::before { content: "Себестоимость"; }
    .mobile-analytics-products td:nth-child(6)::before { content: "Валовая прибыль"; }
    .mobile-analytics-products td:nth-child(7)::before { content: "Валовая маржа"; }
    .mobile-analytics-products td:nth-child(8)::before { content: "Обращения"; }
    .mobile-analytics-products td:nth-child(9)::before { content: "Дефекты с SN"; }
    .mobile-analytics-products td:nth-child(10)::before { content: "Замены"; }

    .mobile-batch-signal-table td:nth-child(1)::before { content: "Партия"; }
    .mobile-batch-signal-table td:nth-child(2)::before { content: "Товар"; }
    .mobile-batch-signal-table td:nth-child(3)::before { content: "Причина сигнала"; }
    .mobile-batch-signal-table td:nth-child(4)::before { content: "Продано / выдано"; }
    .mobile-batch-signal-table td:nth-child(5)::before { content: "Дефекты"; }
    .mobile-batch-signal-table td:nth-child(6)::before { content: "Доля"; }
    .mobile-batch-signal-table td:nth-child(7)::before { content: "Обращения"; }
    .mobile-batch-signal-table td:nth-child(8)::before { content: "Замены"; }

    .mobile-quality-cases td:nth-child(1)::before { content: "Дата / обращение"; }
    .mobile-quality-cases td:nth-child(2)::before { content: "Устройство"; }
    .mobile-quality-cases td:nth-child(3)::before { content: "Версия"; }
    .mobile-quality-cases td:nth-child(4)::before { content: "Проблема"; }
    .mobile-quality-cases td:nth-child(5)::before { content: "Результат"; }
    .mobile-quality-cases td:nth-child(6)::before { content: "Замена"; }

    .mobile-quality-batches td:nth-child(1)::before { content: "Партия"; }
    .mobile-quality-batches td:nth-child(2)::before { content: "Товар / версия"; }
    .mobile-quality-batches td:nth-child(3)::before { content: "Устройств"; }
    .mobile-quality-batches td:nth-child(4)::before { content: "Продано / выдано"; }
    .mobile-quality-batches td:nth-child(5)::before { content: "Дефекты"; }
    .mobile-quality-batches td:nth-child(6)::before { content: "Доля дефектов"; }
    .mobile-quality-batches td:nth-child(7)::before { content: "Обращения"; }
    .mobile-quality-batches td:nth-child(8)::before { content: "Замены"; }

    .mobile-stack-table .inventory-adjust-form {
        min-width: 0;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .mobile-stack-table .inventory-delete-form {
        margin-top: 8px;
    }

    .mobile-stack-table .close-one-settlement {
        width: 100%;
    }

    .mobile-stack-table input[type="checkbox"] {
        width: auto;
    }
}


@media (max-width: 720px) {
    /* All generated mobile table labels must look like labels, not run into values. */
    .mobile-stack-table td::before {
        display: block;
        margin-bottom: 3px;
        color: #727b87;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.25;
        letter-spacing: .03em;
        text-transform: uppercase;
    }

    /* Open partner settlements are used frequently, so render each row as a compact card. */
    .mobile-partner-open tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px 18px;
        padding: 16px;
    }

    .mobile-partner-open td {
        padding: 0;
    }

    .mobile-partner-open td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .mobile-partner-open td:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 2;
        font-size: 17px;
        font-weight: 700;
    }

    .mobile-partner-open td:nth-child(3),
    .mobile-partner-open td:nth-child(4) {
        grid-column: 1 / -1;
    }

    .mobile-partner-open td:nth-child(5),
    .mobile-partner-open td:nth-child(6),
    .mobile-partner-open td:nth-child(7),
    .mobile-partner-open td:nth-child(8),
    .mobile-partner-open td:nth-child(9) {
        min-width: 0;
    }

    .mobile-partner-open td:nth-child(10) {
        grid-column: 1 / -1;
        padding-top: 4px;
    }

    .mobile-partner-open td:nth-child(10)::before {
        display: none;
    }

    .mobile-partner-open .close-one-settlement {
        min-height: 44px;
        width: 100%;
    }

    .mobile-partner-open input[type="checkbox"] {
        width: 22px;
        height: 22px;
        margin: 2px 0 0;
    }

    .mobile-partner-open td:nth-child(1)::before {
        display: inline-block;
        margin: 0 8px 0 0;
        vertical-align: 4px;
    }
}
