/*
 * Единая таблица стилей проекта АИС ГРЗ.
 *
 * Порядок секций сохраняет прежний каскад:
 * app.css -> office.css -> cashbox.css -> login.css.
 * Для будущих тем переопределяйте переменные внутри html[data-theme="..."]
 * без изменения шаблонов и компонентных селекторов.
 */

:root,
html[data-theme="light"] {
    color-scheme: light;
    --theme-page-bg: #f5f6f8;
    --theme-page-panel: #f3f4f6;
    --theme-surface: #ffffff;
    --theme-surface-soft: #f8f9fa;
    --theme-surface-cool: #f8fafc;
    --theme-surface-subtle: #f7f9fc;
    --theme-surface-muted: #f9fafb;
    --theme-surface-raised: #fbfcfe;
    --theme-surface-hover: #f1f3f5;
    --theme-border: #e5e7eb;
    --theme-border-strong: #d9dee8;
    --theme-border-soft: #eef0f2;
    --theme-text: #212529;
    --theme-text-strong: #111827;
    --theme-text-deep: #0f172a;
    --theme-text-secondary: #495057;
    --theme-text-mid: #374151;
    --theme-text-muted: #6c757d;
    --theme-text-muted-cool: #64748b;
    --theme-text-muted-soft: #6b7280;
    --theme-accent: #2da192;
    --theme-accent-hover: #32a896;
    --theme-accent-ripple: #42b8a6;
    --theme-accent-text: #ffffff;
    --theme-danger-soft: #fff1f1;
    --theme-warning-soft: #fff7e6;
    --theme-success-soft: #ecfdf3;
    --theme-info-soft: #eef2ff;
    --theme-positive: #157347;
    --theme-writeoff: #198754;
    --theme-negative: #b42318;
    --theme-lock-overlay: rgba(255, 255, 255, .88);
    --theme-shadow: 0 .5rem 1.25rem rgba(15, 23, 42, .06);
    --theme-radius: 1rem;
}

.order-customer-truncate {
    max-width: 220px;
}

/* ==========================================================================
   Базовая оболочка приложения
   ========================================================================== */
:root {
            --app-bg: var(--theme-page-bg);
            --app-surface: var(--theme-surface);
            --app-border: var(--theme-border);
            --app-muted: var(--theme-text-muted);
            --app-text: var(--theme-text);
            --app-shadow: var(--theme-shadow);
            --app-radius: var(--theme-radius);
        }

        html, body {
            min-height: 100%;
        }

        body {
            padding-top: 76px;
            background: var(--app-bg);
            color: var(--app-text);
        }

        .app-navbar {
            background: var(--theme-surface);
            border-bottom: 1px solid var(--app-border);
            box-shadow: 0 .25rem 1rem rgba(15, 23, 42, .04);
            backdrop-filter: blur(8px);
        }

        .app-navbar .navbar-brand {
            font-weight: 700;
            letter-spacing: .02em;
            color: var(--app-text);
        }

        .app-navbar .nav-link {
            color: var(--theme-text-secondary);
            font-weight: 500;
            border-radius: .65rem;
            padding: .5rem .75rem;
        }

        .app-navbar .nav-link:hover,
        .app-navbar .nav-link:focus,
        .app-navbar .nav-link.show {
            color: var(--app-text);
            background: var(--theme-surface-hover);
        }

        .app-navbar .dropdown-menu {
            border: 1px solid var(--app-border);
            border-radius: .85rem;
            box-shadow: var(--app-shadow);
            padding: .45rem;
        }

        .app-navbar .dropdown-item {
            border-radius: .6rem;
            padding: .55rem .75rem;
            font-weight: 500;
        }

        .app-navbar .dropdown-item:hover,
        .app-navbar .dropdown-item:focus {
            background: var(--theme-surface-hover);
        }

        .app-user-box {
            color: var(--app-muted);
            font-size: .9rem;
            white-space: nowrap;
        }

        .app-main {
            width: 100%;
        }

        .app-content {
            max-width: 1440px;
            margin: 0 auto;
            padding-left: 1.25rem;
            padding-right: 1.25rem;
        }

        .card,
        .app-card {
            border: 1px solid var(--app-border);
            border-radius: var(--app-radius);
            box-shadow: var(--app-shadow);
        }

        .card-header {
            border-bottom: 1px solid var(--app-border);
        }

        .table thead th {
            background: var(--theme-surface-soft);
            color: var(--theme-text-secondary);
            font-size: .78rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .03em;
            border-bottom: 1px solid var(--app-border);
            white-space: nowrap;
        }

        .table tbody td {
            border-color: var(--theme-border-soft);
        }

        .btn {
            font-weight: 500;
            border-radius: .65rem;
        }

        .form-control,
        .form-select {
            border-radius: .65rem;
            border-color: var(--theme-border-strong);
        }

        .form-control:focus,
        .form-select:focus {
            border-color: #9aa4b2;
            box-shadow: 0 0 0 .2rem rgba(33, 37, 41, .08);
        }

        .form-label {
            font-size: .82rem;
            font-weight: 600;
            color: var(--theme-text-secondary);
        }

        .alert {
            border-radius: .85rem;
            border: 1px solid transparent;
            box-shadow: 0 .25rem .75rem rgba(15, 23, 42, .04);
        }

        .alert-error {
            --bs-alert-color: #842029;
            --bs-alert-bg: #f8d7da;
            --bs-alert-border-color: #f5c2c7;
        }

        .footer {
            margin-top: 3rem;
            padding: 1.25rem 0;
            background: var(--app-surface);
            border-top: 1px solid var(--app-border);
            text-align: center;
            color: var(--app-muted);
            font-size: .9rem;
        }

        @media (max-width: 991.98px) {
            body {
                padding-top: 68px;
            }

            .app-content {
                padding-left: .85rem;
                padding-right: .85rem;
            }

            .app-navbar .navbar-collapse {
                padding-top: .75rem;
            }
        }

/* ==========================================================================
   Интерфейс производственного раздела
   ========================================================================== */
/* blank_list.html */
.office-page{--office-border:var(--theme-border);--office-muted:#6c757d;--office-shadow:0 .5rem 1.25rem rgba(15,23,42,.06)}
    .office-page .page-header,.office-page .office-card{background:var(--theme-surface);border:1px solid var(--office-border);border-radius:1rem;box-shadow:var(--office-shadow)}
    .office-page .page-header{padding:1.25rem}.office-page .office-card{overflow:hidden}.office-page .office-card-body{padding:1.25rem}
    .office-page .form-label{font-size:.78rem;font-weight:600;color:var(--theme-text-secondary);margin-bottom:.35rem}.office-page .table{margin-bottom:0}.office-page .table thead th{background:var(--theme-surface-soft);color:var(--theme-text-secondary);font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;border-bottom:1px solid var(--office-border);white-space:nowrap}.office-page .table tbody td{vertical-align:middle;border-color:var(--theme-border-soft)}.office-page .actions-wrap{display:flex;flex-wrap:wrap;gap:.35rem;justify-content:flex-end}.office-page .empty-state{padding:2.5rem 1rem;color:var(--office-muted)}.office-page .section-title{background:var(--theme-surface-soft);border-bottom:1px solid var(--office-border);padding:.9rem 1.25rem;font-weight:700}.office-page code{background:var(--theme-surface-soft);border:1px solid var(--theme-border);border-radius:.35rem;padding:.15rem .35rem;color:var(--theme-text-secondary)}@media(max-width:991.98px){.office-page .actions-wrap{justify-content:flex-start}}

/* customer_confirm_delete.html */
.office-page{--office-border:var(--theme-border);--office-muted:#6c757d;--office-shadow:0 .5rem 1.25rem rgba(15,23,42,.06)}
    .office-page .page-header,.office-page .office-card{background:var(--theme-surface);border:1px solid var(--office-border);border-radius:1rem;box-shadow:var(--office-shadow)}
    .office-page .page-header{padding:1.25rem}.office-page .office-card{overflow:hidden}.office-page .office-card-body{padding:1.25rem}
    .office-page .form-label{font-size:.78rem;font-weight:600;color:var(--theme-text-secondary);margin-bottom:.35rem}.office-page .form-control,.office-page .form-select{border-color:var(--theme-border-strong)}
    .office-page .table{margin-bottom:0}.office-page .table thead th{background:var(--theme-surface-soft);color:var(--theme-text-secondary);font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;border-bottom:1px solid var(--office-border);white-space:nowrap}.office-page .table tbody td{vertical-align:middle;border-color:var(--theme-border-soft)}
    .office-page .actions-wrap{display:flex;flex-wrap:wrap;gap:.35rem;justify-content:flex-end}.office-page .empty-state{padding:2.5rem 1rem;color:var(--office-muted)}
    .office-page .metric{background:var(--theme-surface-soft);border:1px solid var(--office-border);border-radius:.85rem;padding:1rem}
    .office-page code{background:var(--theme-surface-soft);border:1px solid var(--theme-border);border-radius:.35rem;padding:.15rem .35rem;color:var(--theme-text-secondary)}
    @media(max-width:991.98px){.office-page .actions-wrap{justify-content:flex-start}}

/* customer_form.html */
.office-page{--office-border:var(--theme-border);--office-muted:#6c757d;--office-shadow:0 .5rem 1.25rem rgba(15,23,42,.06)}
    .office-page .page-header,.office-page .office-card{background:var(--theme-surface);border:1px solid var(--office-border);border-radius:1rem;box-shadow:var(--office-shadow)}
    .office-page .page-header{padding:1.25rem}.office-page .office-card{overflow:hidden}.office-page .office-card-body{padding:1.25rem}
    .office-page .form-label{font-size:.78rem;font-weight:600;color:var(--theme-text-secondary);margin-bottom:.35rem}.office-page .form-control,.office-page .form-select{border-color:var(--theme-border-strong)}
    .office-page .table{margin-bottom:0}.office-page .table thead th{background:var(--theme-surface-soft);color:var(--theme-text-secondary);font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;border-bottom:1px solid var(--office-border);white-space:nowrap}.office-page .table tbody td{vertical-align:middle;border-color:var(--theme-border-soft)}
    .office-page .actions-wrap{display:flex;flex-wrap:wrap;gap:.35rem;justify-content:flex-end}.office-page .empty-state{padding:2.5rem 1rem;color:var(--office-muted)}
    .office-page .metric{background:var(--theme-surface-soft);border:1px solid var(--office-border);border-radius:.85rem;padding:1rem}
    .office-page code{background:var(--theme-surface-soft);border:1px solid var(--theme-border);border-radius:.35rem;padding:.15rem .35rem;color:var(--theme-text-secondary)}
    @media(max-width:991.98px){.office-page .actions-wrap{justify-content:flex-start}}

/* customer_list.html */
.office-page{--office-border:var(--theme-border);--office-muted:#6c757d;--office-shadow:0 .5rem 1.25rem rgba(15,23,42,.06)}
    .office-page .page-header,.office-page .office-card{background:var(--theme-surface);border:1px solid var(--office-border);border-radius:1rem;box-shadow:var(--office-shadow)}
    .office-page .page-header{padding:1.25rem}.office-page .office-card{overflow:hidden}.office-page .office-card-body{padding:1.25rem}
    .office-page .form-label{font-size:.78rem;font-weight:600;color:var(--theme-text-secondary);margin-bottom:.35rem}.office-page .form-control,.office-page .form-select{border-color:var(--theme-border-strong)}
    .office-page .table{margin-bottom:0}.office-page .table thead th{background:var(--theme-surface-soft);color:var(--theme-text-secondary);font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;border-bottom:1px solid var(--office-border);white-space:nowrap}.office-page .table tbody td{vertical-align:middle;border-color:var(--theme-border-soft)}
    .office-page .actions-wrap{display:flex;flex-wrap:wrap;gap:.35rem;justify-content:flex-end}.office-page .empty-state{padding:2.5rem 1rem;color:var(--office-muted)}
    .office-page .metric{background:var(--theme-surface-soft);border:1px solid var(--office-border);border-radius:.85rem;padding:1rem}
    .office-page code{background:var(--theme-surface-soft);border:1px solid var(--theme-border);border-radius:.35rem;padding:.15rem .35rem;color:var(--theme-text-secondary)}
    @media(max-width:991.98px){.office-page .actions-wrap{justify-content:flex-start}}

/* employee_form.html */
.office-page{--office-border:var(--theme-border);--office-muted:#6c757d;--office-shadow:0 .5rem 1.25rem rgba(15,23,42,.06)}
    .office-page .page-header,.office-page .office-card{background:var(--theme-surface);border:1px solid var(--office-border);border-radius:1rem;box-shadow:var(--office-shadow)}
    .office-page .page-header{padding:1.25rem}.office-page .office-card{overflow:hidden}.office-page .office-card-body{padding:1.25rem}
    .office-page .form-label{font-size:.78rem;font-weight:600;color:var(--theme-text-secondary);margin-bottom:.35rem}.office-page .form-control,.office-page .form-select{border-color:var(--theme-border-strong)}
    .office-page .table{margin-bottom:0}.office-page .table thead th{background:var(--theme-surface-soft);color:var(--theme-text-secondary);font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;border-bottom:1px solid var(--office-border);white-space:nowrap}.office-page .table tbody td{vertical-align:middle;border-color:var(--theme-border-soft)}
    .office-page .actions-wrap{display:flex;flex-wrap:wrap;gap:.35rem;justify-content:flex-end}.office-page .empty-state{padding:2.5rem 1rem;color:var(--office-muted)}
    .office-page .metric{background:var(--theme-surface-soft);border:1px solid var(--office-border);border-radius:.85rem;padding:1rem}
    .office-page code{background:var(--theme-surface-soft);border:1px solid var(--theme-border);border-radius:.35rem;padding:.15rem .35rem;color:var(--theme-text-secondary)}
    @media(max-width:991.98px){.office-page .actions-wrap{justify-content:flex-start}}

/* employee_list.html */
.office-page{--office-border:var(--theme-border);--office-muted:#6c757d;--office-shadow:0 .5rem 1.25rem rgba(15,23,42,.06)}
    .office-page .page-header,.office-page .office-card{background:var(--theme-surface);border:1px solid var(--office-border);border-radius:1rem;box-shadow:var(--office-shadow)}
    .office-page .page-header{padding:1.25rem}.office-page .office-card{overflow:hidden}.office-page .office-card-body{padding:1.25rem}
    .office-page .form-label{font-size:.78rem;font-weight:600;color:var(--theme-text-secondary);margin-bottom:.35rem}.office-page .form-control,.office-page .form-select{border-color:var(--theme-border-strong)}
    .office-page .table{margin-bottom:0}.office-page .table thead th{background:var(--theme-surface-soft);color:var(--theme-text-secondary);font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;border-bottom:1px solid var(--office-border);white-space:nowrap}.office-page .table tbody td{vertical-align:middle;border-color:var(--theme-border-soft)}
    .office-page .actions-wrap{display:flex;flex-wrap:wrap;gap:.35rem;justify-content:flex-end}.office-page .empty-state{padding:2.5rem 1rem;color:var(--office-muted)}
    .office-page .metric{background:var(--theme-surface-soft);border:1px solid var(--office-border);border-radius:.85rem;padding:1rem}
    .office-page code{background:var(--theme-surface-soft);border:1px solid var(--theme-border);border-radius:.35rem;padding:.15rem .35rem;color:var(--theme-text-secondary)}
    @media(max-width:991.98px){.office-page .actions-wrap{justify-content:flex-start}}

/* order_confirm_delete.html */
.office-page{--office-border:var(--theme-border);--office-muted:#6c757d;--office-shadow:0 .5rem 1.25rem rgba(15,23,42,.06)}
    .office-page .page-header,.office-page .office-card{background:var(--theme-surface);border:1px solid var(--office-border);border-radius:1rem;box-shadow:var(--office-shadow)}
    .office-page .page-header{padding:1.25rem}.office-page .office-card{overflow:hidden}.office-page .office-card-body{padding:1.25rem}
    .office-page .form-label{font-size:.78rem;font-weight:600;color:var(--theme-text-secondary);margin-bottom:.35rem}.office-page .table{margin-bottom:0}.office-page .table thead th{background:var(--theme-surface-soft);color:var(--theme-text-secondary);font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;border-bottom:1px solid var(--office-border);white-space:nowrap}.office-page .table tbody td{vertical-align:middle;border-color:var(--theme-border-soft)}.office-page .actions-wrap{display:flex;flex-wrap:wrap;gap:.35rem;justify-content:flex-end}.office-page .empty-state{padding:2.5rem 1rem;color:var(--office-muted)}.office-page .section-title{background:var(--theme-surface-soft);border-bottom:1px solid var(--office-border);padding:.9rem 1.25rem;font-weight:700}.office-page code{background:var(--theme-surface-soft);border:1px solid var(--theme-border);border-radius:.35rem;padding:.15rem .35rem;color:var(--theme-text-secondary)}@media(max-width:991.98px){.office-page .actions-wrap{justify-content:flex-start}}

/* order_detail.html */
.office-page{--office-border:var(--theme-border);--office-muted:#6c757d;--office-shadow:0 .5rem 1.25rem rgba(15,23,42,.06)}.office-page .page-header,.office-page .office-card{background:var(--theme-surface);border:1px solid var(--office-border);border-radius:1rem;box-shadow:var(--office-shadow)}.office-page .page-header{padding:1.25rem}.office-page .office-card{overflow:hidden}.office-page .office-card-body{padding:1.25rem}.office-page .section-title{background:var(--theme-surface-soft);border-bottom:1px solid var(--office-border);padding:.9rem 1.25rem;font-weight:700}.office-page .info-table th{width:42%;color:var(--theme-text-muted);font-weight:600}.office-page .table{margin-bottom:0}.office-page .table td,.office-page .table th{border-color:var(--theme-border-soft)}.office-page code{background:var(--theme-surface-soft);border:1px solid var(--theme-border);border-radius:.35rem;padding:.15rem .35rem;color:var(--theme-text-secondary)}.status-badge{border:1px solid transparent;font-weight:600;padding:.45rem .65rem}.status-new{background:var(--theme-info-soft);color:#3730a3;border-color:var(--theme-border-strong)}.status-production{background:var(--theme-warning-soft);color:#8a5a00;border-color:#ffe4ad}.status-ready{background:var(--theme-success-soft);color:#087443;border-color:#bbf7d0}.status-issued{background:var(--theme-surface-hover);color:var(--theme-text-secondary);border-color:var(--theme-border-strong)}

/* order_edit.html */
.office-page{--office-border:var(--theme-border);--office-muted:#6c757d;--office-shadow:0 .5rem 1.25rem rgba(15,23,42,.06)}.office-page .page-header,.office-page .office-card{background:var(--theme-surface);border:1px solid var(--office-border);border-radius:1rem;box-shadow:var(--office-shadow)}.office-page .page-header{padding:1.25rem}.office-page .office-card{overflow:hidden}.office-page .office-card-body{padding:1.25rem}.office-page .section-title{background:var(--theme-surface-soft);border-bottom:1px solid var(--office-border);padding:.9rem 1.25rem;font-weight:700}.office-page .form-label{font-size:.78rem;font-weight:600;color:var(--theme-text-secondary);margin-bottom:.35rem}.office-page .table{margin-bottom:0}.office-page .table thead th{background:var(--theme-surface-soft);color:var(--theme-text-secondary);font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;border-bottom:1px solid var(--office-border);white-space:nowrap}.office-page .table tbody td{vertical-align:middle;border-color:var(--theme-border-soft)}.office-page .empty-state{padding:2.5rem 1rem;color:var(--office-muted)}.office-page code{background:var(--theme-surface-soft);border:1px solid var(--theme-border);border-radius:.35rem;padding:.15rem .35rem;color:var(--theme-text-secondary)}

/* order_form.html */
.order-form-page {
        --of-border: var(--theme-border);
        --of-muted: #6c757d;
        --of-soft: #f8f9fa;
        --of-shadow: 0 .5rem 1.25rem rgba(15, 23, 42, .06);
    }

    .order-form-page .page-header,
    .order-form-page .form-card,
    .order-form-page .action-panel {
        background: var(--theme-surface);
        border: 1px solid var(--of-border);
        border-radius: 1rem;
        box-shadow: var(--of-shadow);
    }

    .order-form-page .page-header {
        padding: 1.25rem;
    }

    .order-form-page .form-card {
        overflow: hidden;
        margin-bottom: 1rem;
    }

    .order-form-page .form-card-header {
        display: flex;
        align-items: center;
        gap: .75rem;
        padding: 1rem 1.25rem;
        background: var(--of-soft);
        border-bottom: 1px solid var(--of-border);
    }

    .order-form-page .step-number {
        width: 2rem;
        height: 2rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #212529;
        color: #fff;
        font-weight: 700;
        font-size: .875rem;
        flex: 0 0 auto;
    }

    .order-form-page .form-card-body {
        padding: 1.25rem;
    }

    .order-form-page label,
    .order-form-page .form-label {
        font-size: .8rem;
        font-weight: 600;
        color: var(--theme-text-secondary);
        margin-bottom: .35rem;
    }

    .order-form-page input,
    .order-form-page select,
    .order-form-page textarea {
        border-color: var(--theme-border-strong);
    }

    .order-form-page textarea {
        min-height: 42px;
    }

    .order-form-page .helper-text {
        color: var(--of-muted);
        font-size: .875rem;
    }

    .order-form-page .main-fields {
        background: var(--theme-surface-soft);
        border: 1px solid var(--of-border);
        border-radius: .875rem;
        padding: 1rem;
    }


    .order-form-page .order-item-row {
        background: var(--theme-surface);
        border: 1px solid var(--of-border);
        border-radius: .875rem;
        padding: 1rem;
    }

    .order-form-page .order-item-row + .order-item-row {
        margin-top: .75rem;
    }

    .order-form-page .order-item-title {
        min-width: 6rem;
    }

    .order-form-page .order-item-remove {
        white-space: nowrap;
    }

    .order-form-page .action-panel {
        position: sticky;
        bottom: 1rem;
        z-index: 10;
        padding: .875rem;
        margin-top: 1.5rem;
    }


    .order-form-page .customer-search-wrap {
        position: relative;
    }

    .order-form-page .customer-search-results {
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + .25rem);
        z-index: 1050;
        max-height: 18rem;
        overflow-y: auto;
        background: var(--theme-surface);
        border: 1px solid var(--of-border);
        border-radius: .75rem;
        box-shadow: var(--of-shadow);
    }

    .order-form-page .customer-search-item {
        width: 100%;
        border: 0;
        background: var(--theme-surface);
        text-align: left;
        padding: .75rem .9rem;
        border-bottom: 1px solid #f1f3f5;
    }

    .order-form-page .customer-search-item:hover,
    .order-form-page .customer-search-item:focus {
        background: var(--theme-surface-soft);
        outline: none;
    }

    .order-form-page .selected-customer-card {
        display: none;
        background: var(--theme-surface-soft);
        border: 1px solid var(--of-border);
        border-radius: .875rem;
        padding: .875rem;
    }

    .order-form-page .selected-customer-card.is-visible {
        display: block;
    }

    @media (max-width: 767.98px) {
        .order-form-page .action-panel {
            position: static;
        }
    }

/* order_list.html */
.orders-page {
        --orders-border: var(--theme-border);
        --orders-muted: #6c757d;
        --orders-card-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, .06);
    }
    .orders-page .page-header,
    .orders-page .filter-card,
    .orders-page .table-card {
        background: var(--theme-surface);
        border: 1px solid var(--orders-border);
        border-radius: 1rem;
        box-shadow: var(--orders-card-shadow);
    }
    .orders-page .page-header { padding: 1.25rem; }
    .orders-page .filter-card { padding: 1rem; }
    .orders-page .form-label {
        font-size: .78rem;
        font-weight: 600;
        color: var(--theme-text-secondary);
        margin-bottom: .35rem;
    }
    .orders-page .table { margin-bottom: 0; }
    .orders-page .table thead th {
        background: var(--theme-surface-soft);
        color: var(--theme-text-secondary);
        font-size: .78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .03em;
        border-bottom: 1px solid var(--orders-border);
        white-space: nowrap;
    }
    .orders-page .table tbody td {
        vertical-align: middle;
        border-color: var(--theme-border-soft);
    }
    .orders-page .order-number {
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
        font-size: 1rem;
        letter-spacing: .04em;
    }
    .orders-page .group-marker {
        border-left: 3px solid #adb5bd;
    }
    .orders-page .group-badge {
        display: inline-flex;
        align-items: center;
        gap: .25rem;
        border: 1px solid var(--theme-border-strong);
        background: var(--theme-surface-soft);
        color: var(--theme-text-secondary);
        border-radius: 999px;
        padding: .18rem .5rem;
        font-size: .72rem;
        font-weight: 600;
        white-space: nowrap;
    }
    .orders-page .group-hint {
        font-size: .75rem;
        color: var(--orders-muted);
        margin-top: .2rem;
    }
    .orders-page .status-badge {
        border: 1px solid transparent;
        font-weight: 600;
        padding: .45rem .65rem;
    }
    .orders-page .status-new { background: var(--theme-info-soft); color: #3730a3; border-color: var(--theme-border-strong); }
    .orders-page .status-production { background: var(--theme-warning-soft); color: #8a5a00; border-color: #ffe4ad; }
    .orders-page .status-ready { background: var(--theme-success-soft); color: #087443; border-color: #bbf7d0; }
    .orders-page .status-issued { background: var(--theme-surface-hover); color: var(--theme-text-secondary); border-color: var(--theme-border-strong); }
    .orders-page .actions-wrap {
        display: flex;
        flex-wrap: wrap;
        gap: .35rem;
        justify-content: flex-end;
    }
    .orders-page .btn-action-main { min-width: 12rem; }
    .orders-page .empty-state { padding: 3rem 1rem; color: var(--orders-muted); }
    @media (max-width: 991.98px) {
        .orders-page .actions-wrap { justify-content: flex-start; }
        .orders-page .btn-action-main { min-width: auto; }
    }

/* report_blanks_movement.html */
.office-page{--office-border:var(--theme-border);--office-muted:#6c757d;--office-shadow:0 .5rem 1.25rem rgba(15,23,42,.06)}
    .office-page .page-header,.office-page .office-card{background:var(--theme-surface);border:1px solid var(--office-border);border-radius:1rem;box-shadow:var(--office-shadow)}
    .office-page .page-header{padding:1.25rem}.office-page .office-card{overflow:hidden}.office-page .office-card-body{padding:1.25rem}
    .office-page .form-label{font-size:.78rem;font-weight:600;color:var(--theme-text-secondary);margin-bottom:.35rem}.office-page .table{margin-bottom:0}.office-page .table thead th{background:var(--theme-surface-soft);color:var(--theme-text-secondary);font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;border-bottom:1px solid var(--office-border);white-space:nowrap}.office-page .table tbody td{vertical-align:middle;border-color:var(--theme-border-soft)}.office-page .actions-wrap{display:flex;flex-wrap:wrap;gap:.35rem;justify-content:flex-end}.office-page .empty-state{padding:2.5rem 1rem;color:var(--office-muted)}.office-page .section-title{background:var(--theme-surface-soft);border-bottom:1px solid var(--office-border);padding:.9rem 1.25rem;font-weight:700}.office-page code{background:var(--theme-surface-soft);border:1px solid var(--theme-border);border-radius:.35rem;padding:.15rem .35rem;color:var(--theme-text-secondary)}@media(max-width:991.98px){.office-page .actions-wrap{justify-content:flex-start}}

/* report_orders.html */
.mvd-page {
        --mvd-border: var(--theme-border);
        --mvd-muted: #6c757d;
        --mvd-card-shadow: 0 .5rem 1.25rem rgba(15, 23, 42, .06);
    }

    .mvd-page .page-header,
    .mvd-page .filter-card,
    .mvd-page .table-card {
        background: var(--theme-surface);
        border: 1px solid var(--mvd-border);
        border-radius: 1rem;
        box-shadow: var(--mvd-card-shadow);
    }

    .mvd-page .page-header { padding: 1.25rem; }
    .mvd-page .filter-card { padding: 1rem; }

    .mvd-page .form-label {
        font-size: .78rem;
        font-weight: 600;
        color: var(--theme-text-secondary);
        margin-bottom: .35rem;
    }

    .mvd-page .table { margin-bottom: 0; }

    .mvd-page .table thead th {
        background: var(--theme-surface-soft);
        color: var(--theme-text-secondary);
        font-size: .76rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .025em;
        border-bottom: 1px solid var(--mvd-border);
        white-space: nowrap;
    }

    .mvd-page .table tbody td {
        vertical-align: middle;
        border-color: var(--theme-border-soft);
        font-size: .9rem;
    }

    .mvd-page .reg-number {
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
        letter-spacing: .04em;
    }

    .mvd-page .empty-state {
        padding: 3rem 1rem;
        color: var(--mvd-muted);
    }

/* ==========================================================================
   Касса и склад
   ========================================================================== */
.cashbox-page .office-card,
.cashbox-page .filter-card {
    border: 1px solid var(--theme-border-strong);
}

.cashbox-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

.cashbox-product-tile {
    border: 1px solid var(--theme-border-strong);
    background: var(--theme-surface);
    border-radius: 12px;
    min-height: 118px;
    padding: 14px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: space-between;
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}

.cashbox-product-tile:hover {
    border-color: #9aa7b8;
    box-shadow: 0 8px 24px rgba(33, 37, 41, .08);
    transform: translateY(-1px);
}

.cashbox-product-tile .tile-name {
    font-weight: 700;
    line-height: 1.2;
    color: var(--theme-text-strong);
}

.cashbox-product-tile .tile-meta {
    font-size: 12px;
    color: var(--theme-text-muted-soft);
}

.cashbox-product-tile strong {
    font-size: 18px;
    color: var(--theme-text-strong);
}

.cashbox-category-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cashbox-category-row .btn.active {
    background: #212529;
    color: #fff;
    border-color: #212529;
}

.cashbox-receipt-card {
    position: sticky;
    top: 88px;
}

.cashbox-receipt-table-wrap {
    max-height: 430px;
    overflow: auto;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
}

.cashbox-receipt-table {
    margin: 0;
}

.cashbox-receipt-table thead th {
    background: var(--theme-surface-subtle);
    color: var(--theme-text-muted-cool);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--theme-border);
}

.receipt-item-name {
    font-weight: 700;
    color: var(--theme-text-strong);
}

.receipt-item-meta {
    font-size: 12px;
    color: var(--theme-text-muted-soft);
}

.receipt-qty-input,
.receipt-price-input,
.receipt-discount-input {
    width: 82px;
    text-align: right;
}

.cashbox-total-box,
.cashbox-summary {
    border: 1px solid var(--theme-border-strong);
    border-radius: 12px;
    overflow: hidden;
    background: var(--theme-surface);
}

.cashbox-total-box > div,
.cashbox-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--theme-border);
}

.cashbox-total-box > div:last-child,
.cashbox-summary > div:last-child {
    border-bottom: 0;
}

.cashbox-total-box span,
.cashbox-summary span {
    color: var(--theme-text-muted-soft);
}

.cashbox-total-box .total {
    background: var(--theme-surface-subtle);
    font-size: 18px;
}

.cashbox-payment-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--theme-border-strong);
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--theme-surface-subtle);
}

.cashbox-payment-total strong {
    font-size: 24px;
}

@media (max-width: 1199px) {
    .cashbox-receipt-card {
        position: static;
    }
}

@media (max-width: 767px) {
    .cashbox-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .cashbox-product-tile {
        min-height: 104px;
        padding: 12px;
    }
    .receipt-qty-input,
    .receipt-price-input,
    .receipt-discount-input {
        width: 70px;
    }
}

.cashbox-operation-table td {
    vertical-align: top;
}

.operation-content-cell {
    min-width: 280px;
}

.operation-items-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.operation-item-line {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-surface-raised);
}

.operation-item-name {
    font-weight: 650;
    color: var(--theme-text-strong);
}

.operation-item-meta {
    color: var(--theme-text-muted-soft);
    font-size: 12px;
    white-space: nowrap;
}

.shift-product-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--theme-border);
}

.shift-product-row:last-child {
    border-bottom: 0;
}

.cashbox-operations-page textarea.form-control {
    min-height: 38px;
    height: 38px;
}

@media (max-width: 767px) {
    .operation-item-line {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .operation-item-meta {
        white-space: normal;
    }
}

/* v3: аккуратная сетка формы денежных операций и узкая колонка кассы */
.cashbox-page .cashbox-field-col {
    min-width: 0;
}

.cashbox-page .row.g-3 > .col-12.col-lg-3,
.cashbox-page .row.g-3 > .col-12.col-lg-2,
.cashbox-page .row.g-3 > .col-12.col-lg-1 {
    min-width: 0;
}

.cashbox-register-col,
.cashbox-register-cell {
    width: 120px;
    max-width: 140px;
}

.cashbox-register-cell {
    font-size: 13px;
    line-height: 1.25;
    white-space: normal;
}

.receipt-cost-input {
    width: 82px;
    text-align: right;
}

.receipt-cost-input:disabled {
    background: var(--theme-surface-subtle);
    color: var(--theme-text-muted-soft);
}

.cashbox-operation-table .badge {
    white-space: normal;
    text-align: left;
}

@media (max-width: 767px) {
    .receipt-cost-input {
        width: 70px;
    }

    .cashbox-register-col,
    .cashbox-register-cell {
        width: auto;
        max-width: none;
    }
}

/* v4: журнал операций, блокировки смены и чистый чек */
.cashbox-filter-card {
    padding: 16px;
    border-radius: 14px;
    background: var(--theme-surface);
}

.cashbox-filter-row {
    align-items: end;
}

.cashbox-filter-field,
.cashbox-filter-submit,
.cashbox-field-col {
    min-width: 0;
}

.cashbox-filter-field .form-label,
.cashbox-field-col .form-label {
    margin-bottom: 6px;
    color: var(--theme-text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.cashbox-operation-create-card {
    position: relative;
    overflow: hidden;
}

.cashbox-operation-create-card.is-locked {
    min-height: 190px;
}

.cashbox-operation-create-card.is-locked .cashbox-operation-form {
    opacity: .18;
    filter: grayscale(.25);
    pointer-events: none;
    user-select: none;
}

.cashbox-operation-lock {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 24px;
    background: var(--theme-lock-overlay);
    backdrop-filter: blur(2px);
    color: var(--theme-text-strong);
}

.cashbox-lock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    color: var(--theme-text-mid);
    background: var(--theme-page-panel);
    border: 1px solid var(--theme-border-strong);
}

.cashbox-comment-col textarea.form-control,
.cashbox-operation-form textarea.form-control {
    min-height: 38px;
    height: 38px;
    resize: vertical;
}

.receipt-qty-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 94px;
}

.receipt-qty-control span {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    color: var(--theme-text-strong);
}

.receipt-qty-control .btn {
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
}

.cashbox-payment-items {
    border: 1px solid var(--theme-border-strong);
    border-radius: 14px;
    padding: 12px;
    background: var(--theme-surface-raised);
}

.cashbox-payment-items-table thead th {
    color: var(--theme-text-muted-cool);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--theme-border);
}

.cashbox-payment-items-table td,
.cashbox-payment-items-table th {
    vertical-align: middle;
}

.payment-qty-input,
.payment-price-input,
.payment-discount-input,
.payment-cost-input {
    width: 92px;
    margin-left: auto;
    text-align: right;
}

.payment-cost-input:disabled,
.payment-discount-input:disabled {
    background: var(--theme-surface-soft);
    color: var(--theme-text-muted-cool);
}

@media (max-width: 767px) {
    .cashbox-payment-items-table {
        min-width: 760px;
    }

    .cashbox-operation-lock {
        padding: 18px;
    }
}

/* v5: оплата без сдачи, свободная цена и проверка остатков в денежных операциях */
.cashbox-checkout-modal-body {
    background: var(--theme-surface-subtle);
}

.cashbox-checkout-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cashbox-checkout-item {
    border: 1px solid var(--theme-border-strong);
    border-radius: 16px;
    padding: 14px;
    background: var(--theme-surface);
    box-shadow: 0 8px 22px rgba(31, 41, 55, .05);
}

.cashbox-checkout-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.cashbox-checkout-grid {
    display: grid;
    grid-template-columns: minmax(150px, 1.05fr) minmax(190px, 1.25fr) minmax(120px, .85fr) minmax(150px, 1fr);
    gap: 12px;
}

.cashbox-checkout-field label {
    display: block;
    margin-bottom: 5px;
    color: var(--theme-text-secondary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cashbox-checkout-field .form-control {
    font-weight: 700;
    text-align: right;
}

.cashbox-checkout-hint {
    margin-top: 5px;
    color: var(--theme-text-muted-cool);
    font-size: 11px;
    line-height: 1.25;
}

.cashbox-checkout-field-muted {
    opacity: .72;
}

.cashbox-discount-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cashbox-checkout-line-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--theme-border-strong);
    color: var(--theme-text-mid);
}

.cashbox-checkout-line-total span {
    color: var(--theme-text-muted-soft);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cashbox-checkout-line-total strong {
    color: var(--theme-text-strong);
    font-size: 20px;
    line-height: 1;
}

.cashbox-payment-side {
    position: sticky;
    top: 16px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 16px;
    padding: 16px;
    background: var(--theme-surface);
    box-shadow: 0 8px 22px rgba(31, 41, 55, .05);
}

.cashbox-payment-side .form-label {
    margin-bottom: 5px;
    color: var(--theme-text-secondary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cashbox-payment-side .payment-input {
    font-weight: 800;
    text-align: right;
}

.cashbox-payment-accepted {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-surface-muted);
}

.cashbox-payment-accepted span {
    color: var(--theme-text-muted-soft);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cashbox-payment-accepted strong {
    color: var(--theme-text-strong);
    font-size: 18px;
}

.cashbox-operation-balance-hint.text-danger {
    font-weight: 700;
}

@media (max-width: 991px) {
    .cashbox-payment-side {
        position: static;
    }

    .cashbox-checkout-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575px) {
    .cashbox-checkout-grid,
    .cashbox-discount-pair {
        grid-template-columns: 1fr;
    }
}


/* v6: полноэкранная модалка оплаты и верхние остатки журнала операций */
.cashbox-payment-dialog {
    margin: 0;
    max-width: none;
}

.cashbox-payment-dialog .modal-content {
    min-height: 100vh;
    height: 100vh;
    border-radius: 0;
    overflow: hidden;
}

.cashbox-payment-dialog .cashbox-payment-modal-header,
.cashbox-payment-dialog .modal-footer {
    flex: 0 0 auto;
}

.cashbox-payment-dialog .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 18px;
}

.cashbox-payment-layout {
    min-height: 100%;
}

.cashbox-payment-items-col,
.cashbox-payment-side-col {
    min-width: 0;
}

.cashbox-payment-dialog .cashbox-checkout-items {
    max-width: 100%;
}

.cashbox-payment-dialog .cashbox-checkout-item {
    max-width: 100%;
    overflow: hidden;
}

.cashbox-payment-dialog .cashbox-checkout-grid {
    grid-template-columns: minmax(150px, 1fr) minmax(190px, 1.15fr) minmax(130px, .8fr) minmax(150px, .95fr);
}

.cashbox-payment-dialog .input-group,
.cashbox-payment-dialog .form-control,
.cashbox-payment-dialog .form-select {
    min-width: 0;
}

.cashbox-payment-dialog .input-group-text {
    white-space: nowrap;
}

.cashbox-payment-dialog .cashbox-payment-side {
    top: 18px;
    max-height: calc(100vh - 150px);
    overflow: auto;
}

.cashbox-balance-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.cashbox-balance-card {
    min-width: 0;
    border: 1px solid var(--theme-border-strong);
    border-radius: 14px;
    padding: 14px 16px;
    background: linear-gradient(180deg, var(--theme-surface) 0%, var(--theme-surface-muted) 100%);
    box-shadow: 0 8px 22px rgba(31, 41, 55, .04);
}

.cashbox-balance-label {
    margin-bottom: 5px;
    color: var(--theme-text-muted-soft);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cashbox-balance-amount {
    color: var(--theme-text-strong);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    word-break: break-word;
}

.cashbox-balance-card-cash {
    border-left: 4px solid #374151;
}

.cashbox-balance-card-card,
.cashbox-balance-card-transfer,
.cashbox-balance-card-qr {
    border-left: 4px solid #9aa7b8;
}

@media (min-width: 1600px) {
    .cashbox-payment-dialog .modal-body {
        padding: 24px 32px;
    }

    .cashbox-payment-dialog .cashbox-checkout-grid {
        grid-template-columns: minmax(180px, 1.05fr) minmax(220px, 1.2fr) minmax(150px, .8fr) minmax(180px, .95fr);
    }
}

@media (max-width: 1199px) {
    .cashbox-payment-dialog .cashbox-payment-side {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 991px) {
    .cashbox-balance-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cashbox-payment-dialog .cashbox-checkout-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .cashbox-payment-dialog .modal-body {
        padding: 12px;
    }

    .cashbox-payment-dialog .modal-footer {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cashbox-payment-dialog .modal-footer .btn {
        width: 100%;
        margin: 0;
    }

    .cashbox-payment-dialog .cashbox-checkout-grid,
    .cashbox-payment-dialog .cashbox-discount-pair,
    .cashbox-balance-cards {
        grid-template-columns: 1fr;
    }

    .cashbox-balance-card {
        padding: 12px 14px;
    }

    .cashbox-balance-amount {
        font-size: 19px;
    }

    .cashbox-checkout-item-head {
        align-items: stretch;
    }
}

/* v8: журнал операций только по актуальной открытой смене */
.cashbox-current-shift-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    border: 1px solid var(--theme-border-strong);
    border-radius: 16px;
    padding: 16px 18px;
    background: var(--theme-surface);
    box-shadow: 0 8px 22px rgba(31, 41, 55, .04);
}

.cashbox-current-shift-card.is-open {
    border-left: 4px solid #198754;
}

.cashbox-current-shift-card.is-closed {
    border-left: 4px solid #6b7280;
    background: linear-gradient(180deg, var(--theme-surface) 0%, var(--theme-surface-muted) 100%);
}

.cashbox-current-shift-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    color: var(--theme-text-mid);
    background: var(--theme-page-panel);
    border: 1px solid var(--theme-border-strong);
}

.cashbox-current-shift-card.is-open .cashbox-current-shift-icon {
    color: #146c43;
    background: var(--theme-success-soft);
    border-color: #badbcc;
}

.cashbox-lockable-block {
    position: relative;
}

.cashbox-lockable-block.is-locked {
    min-height: 108px;
}

.cashbox-lockable-block.is-locked .cashbox-filter-card {
    opacity: .18;
    filter: grayscale(.25);
    pointer-events: none;
    user-select: none;
}

.cashbox-block-lock {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 18px;
    background: var(--theme-lock-overlay);
    backdrop-filter: blur(2px);
    border: 1px solid var(--theme-border-strong);
    border-radius: 14px;
    color: var(--theme-text-strong);
}

.cashbox-journal-locked-card {
    border: 1px dashed var(--theme-border-strong);
    background: linear-gradient(180deg, var(--theme-surface) 0%, var(--theme-surface-muted) 100%);
}

@media (max-width: 767px) {
    .cashbox-current-shift-card {
        align-items: flex-start;
        padding: 14px;
    }

    .cashbox-current-shift-icon {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }
}

@media (max-width: 575px) {
    .cashbox-current-shift-card {
        flex-direction: column;
        align-items: stretch;
    }

    .cashbox-current-shift-card .btn {
        width: 100%;
    }
}

/* v9: связь товаров с заготовками ГРЗ и расчёт долей */
.cashbox-form-section-title {
    padding: .75rem 1rem;
    border: 1px solid var(--theme-border-strong);
    border-radius: .8rem;
    background: var(--theme-surface-soft);
    color: var(--theme-text-strong);
    font-weight: 700;
    letter-spacing: .01em;
}
.cashbox-product-form .form-text {
    font-size: .78rem;
}
.cashbox-checkout-production,
.cashbox-checkout-profit {
    margin-top: .85rem;
    border: 1px solid var(--theme-border-strong);
    border-radius: .9rem;
    background: var(--theme-surface-cool);
    padding: .85rem;
}
.cashbox-checkout-production-title {
    font-weight: 700;
    margin-bottom: .65rem;
    color: var(--theme-text-strong);
}
.cashbox-checkout-grid-production {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cashbox-readonly-pill {
    min-height: 31px;
    display: flex;
    align-items: center;
    padding: .25rem .65rem;
    border: 1px solid var(--theme-border-strong);
    border-radius: .5rem;
    background: var(--theme-surface);
    color: var(--theme-text-secondary);
    font-size: .875rem;
}
.cashbox-checkout-profit {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
}
.cashbox-checkout-profit > div {
    border: 1px solid var(--theme-border);
    border-radius: .65rem;
    background: var(--theme-surface);
    padding: .65rem .75rem;
}
.cashbox-checkout-profit span {
    display: block;
    color: var(--theme-text-muted-soft);
    font-size: .76rem;
    margin-bottom: .15rem;
}
.cashbox-checkout-profit strong {
    color: var(--theme-text-strong);
    font-size: .96rem;
}
@media (max-width: 1199.98px) {
    .cashbox-checkout-grid-production,
    .cashbox-checkout-profit {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 575.98px) {
    .cashbox-checkout-grid-production,
    .cashbox-checkout-profit {
        grid-template-columns: 1fr;
    }
}

/* V10: логичная форма товаров и модальное добавление покупателя */
.cashbox-form-section {
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    background: var(--theme-surface);
    padding: 18px;
}

.cashbox-form-section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.cashbox-product-form .form-text {
    color: var(--theme-text-muted-soft);
    font-size: .78rem;
}

.cashbox-product-form [data-product-section].d-none {
    display: none !important;
}

.cashbox-customer-panel {
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--theme-surface-muted);
    padding: 14px;
}

.cashbox-switch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-surface-muted);
}

.cashbox-switch-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--theme-text-mid);
    cursor: pointer;
    user-select: none;
}

.cashbox-switch-option input {
    margin: 0;
}

.cashbox-switch-option.active {
    background: #111827;
    color: #fff;
}

.cashbox-customer-create-form .cashbox-form-section-title {
    padding-top: 4px;
}

.cashbox-checkout-production {
    border: 1px solid #dbeafe;
    background: var(--theme-info-soft);
}

.cashbox-checkout-hint {
    line-height: 1.25;
}

@media (max-width: 767px) {
    .cashbox-form-section {
        padding: 14px;
        border-radius: 12px;
    }
    .cashbox-switch-row {
        flex-direction: column;
    }
    .cashbox-switch-option {
        width: 100%;
    }
}

/* V10: новый список товаров */
.cashbox-products-list {
    display: grid;
    gap: 14px;
}

.cashbox-product-row-card.is-muted {
    opacity: .68;
}

.cashbox-product-row-main {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.cashbox-product-row-title {
    min-width: 0;
}

.cashbox-product-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cashbox-product-row-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.cashbox-product-metric {
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-surface-muted);
    padding: 12px;
    min-width: 0;
}

.cashbox-product-metric span,
.cashbox-product-metric small {
    display: block;
    color: var(--theme-text-muted-soft);
    font-size: .78rem;
}

.cashbox-product-metric strong {
    display: block;
    font-size: 1rem;
    color: var(--theme-text-strong);
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.cashbox-product-row-note {
    border-radius: 12px;
    background: var(--theme-page-panel);
    color: var(--theme-text-mid);
    font-size: .86rem;
    padding: 10px 12px;
}

.cashbox-product-row-note span {
    font-weight: 700;
    color: var(--theme-text-strong);
}

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

@media (max-width: 767px) {
    .cashbox-product-row-main {
        flex-direction: column;
    }
    .cashbox-product-row-actions {
        width: 100%;
        justify-content: stretch;
    }
    .cashbox-product-row-actions .btn {
        flex: 1 1 auto;
    }
    .cashbox-product-row-metrics {
        grid-template-columns: 1fr;
    }
}

/* V11: представитель в кассе и документы ТС по позиции ГРЗ */
.cashbox-representative-panel {
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-surface-muted);
    padding: 12px;
}

.cashbox-representative-panel .form-text {
    margin-top: 6px;
}

.cashbox-representative-create-form .cashbox-form-section-title,
.cashbox-customer-create-form .cashbox-form-section-title {
    font-size: .78rem;
    font-weight: 700;
    color: var(--theme-text-strong);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cashbox-checkout-grid-docs {
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
}

.cashbox-checkout-production .cashbox-checkout-production-title.mt-3 {
    margin-top: 14px !important;
}

@media (max-width: 1199px) {
    .cashbox-checkout-grid-docs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .cashbox-checkout-grid-docs,
    .cashbox-checkout-grid-production {
        grid-template-columns: 1fr;
    }
    .cashbox-representative-panel {
        padding: 10px;
    }
}

/* V12: поиск покупателя/представителя как в форме заказа и новая оплата */
.cashbox-search-wrap {
    position: relative;
}

.cashbox-search-wrap .customer-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 1060;
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--theme-border-strong);
    border-radius: 12px;
    background: var(--theme-surface);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .16);
}

.cashbox-search-wrap .customer-search-item {
    display: block;
    width: 100%;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    background: var(--theme-surface);
    text-align: left;
    padding: 10px 12px;
    color: var(--theme-text-strong);
}

.cashbox-search-wrap .customer-search-item:hover,
.cashbox-search-wrap .customer-search-item:focus {
    background: var(--theme-page-panel);
    outline: none;
}

.cashbox-selected-card {
    display: none;
    border: 1px solid var(--theme-border-strong);
    border-radius: 12px;
    background: var(--theme-surface);
    padding: 10px 12px;
}

.cashbox-selected-card.is-visible {
    display: block;
}

.cashbox-qty-input {
    max-width: 92px;
    text-align: center;
}

.cashbox-payment-method-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cashbox-payment-method-btn {
    min-height: 84px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 14px;
    background: var(--theme-surface);
    color: var(--theme-text-strong);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    transition: .15s ease;
}

.cashbox-payment-method-btn:hover,
.cashbox-payment-method-btn.is-active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.cashbox-payment-method-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cashbox-payment-method-icon svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.cashbox-split-payment-panel {
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--theme-surface-muted);
    padding: 12px;
}

@media (max-width: 575px) {
    .cashbox-payment-method-grid {
        grid-template-columns: 1fr;
    }
    .cashbox-payment-method-btn {
        min-height: 68px;
        flex-direction: row;
    }
    .cashbox-search-wrap .customer-search-results {
        max-height: 260px;
    }
}

/* V13: остатки, компактные кнопки оплаты и выравнивание инфо-полей */
.cashbox-product-tile.is-disabled,
.cashbox-product-tile:disabled {
    background: var(--theme-surface-soft);
    border-color: var(--theme-border-strong);
    color: var(--theme-text-muted-soft);
    opacity: .76;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.cashbox-product-tile.is-disabled:hover,
.cashbox-product-tile:disabled:hover {
    border-color: var(--theme-border-strong);
    box-shadow: none;
    transform: none;
}

.cashbox-product-tile.is-disabled .tile-name,
.cashbox-product-tile:disabled .tile-name,
.cashbox-product-tile.is-disabled strong,
.cashbox-product-tile:disabled strong {
    color: var(--theme-text-secondary);
}

.tile-stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    border: 1px solid var(--theme-border-strong);
    border-radius: 999px;
    background: #e5e7eb;
    color: var(--theme-text-mid);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 5px 8px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.cashbox-readonly-pill {
    min-height: calc(1.5em + .5rem + 2px);
    height: auto;
    align-items: center;
    line-height: 1.35;
    padding: .43rem .65rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

.cashbox-payment-method-grid {
    gap: 8px;
}

.cashbox-payment-method-btn {
    min-height: 58px;
    border-radius: 11px;
    gap: 5px;
    padding: 8px 10px;
    font-size: 13px;
}

.cashbox-payment-method-icon {
    width: 22px;
    height: 22px;
}

.cashbox-payment-method-icon svg {
    width: 22px;
    height: 22px;
}

@media (min-width: 1200px) {
    .cashbox-payment-method-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .cashbox-payment-method-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cashbox-payment-method-btn {
        min-height: 52px;
        flex-direction: row;
        justify-content: center;
        font-size: 12px;
    }
}

/* V14: CloudShop-like POS status bar and menu */
.cashbox-pos-page {
    --pos-border: var(--theme-border-strong);
    --pos-muted: #6b7280;
    --pos-dark: #111827;
}

.cashbox-pos-statusbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: grid;
    grid-template-columns: minmax(160px, 280px) minmax(0, 1fr) auto;
    align-items: stretch;
    min-height: 62px;
    border: 1px solid var(--pos-border);
    border-radius: 16px;
    background: var(--theme-surface);
    box-shadow: 0 10px 30px rgba(17, 24, 39, .07);
    overflow: visible;
}

.cashbox-pos-menu-wrap {
    position: relative;
    min-width: 0;
    border-right: 1px solid #eef1f5;
}

.cashbox-status-menu-btn {
    width: 100%;
    min-height: 62px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border: 0;
    background: transparent;
    color: var(--pos-dark);
    font-weight: 800;
    text-align: left;
}

.cashbox-status-menu-btn:hover,
.cashbox-status-menu-btn[aria-expanded="true"] {
    background: var(--theme-surface-subtle);
}

.cashbox-status-menu-btn svg,
.cashbox-menu-item svg,
.cashbox-pos-connection svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex: 0 0 auto;
}

.cashbox-pos-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: min(360px, calc(100vw - 30px));
    display: none;
    border: 1px solid var(--pos-border);
    border-radius: 18px;
    background: var(--theme-surface);
    box-shadow: 0 22px 60px rgba(17, 24, 39, .18);
    padding: 12px;
    z-index: 1060;
}

.cashbox-pos-menu-panel.is-open {
    display: block;
}

.cashbox-pos-menu-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px 10px 12px;
}

.cashbox-pos-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--theme-surface-soft);
    color: var(--theme-text-mid);
    font-weight: 900;
    text-transform: uppercase;
}

.cashbox-pos-menu-profile a {
    color: var(--theme-text-muted-soft);
    font-size: 12px;
    text-decoration: none;
}

.cashbox-pos-menu-profile a:hover {
    color: var(--theme-text-strong);
    text-decoration: underline;
}

.cashbox-pos-register-switch {
    padding: 8px 10px 12px;
}

.cashbox-menu-divider {
    height: 1px;
    margin: 6px 0;
    background: var(--theme-surface-soft);
}

.cashbox-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--theme-text-strong);
    font-weight: 700;
    text-decoration: none;
}

.cashbox-menu-item:hover {
    background: var(--theme-surface-subtle);
    color: var(--theme-text-strong);
    text-decoration: none;
}

.cashbox-menu-item.is-danger {
    color: #b42318;
}

.cashbox-menu-item.is-danger:hover {
    background: var(--theme-danger-soft);
}

.cashbox-menu-item.is-muted {
    color: var(--theme-text-mid);
    background: var(--theme-surface-muted);
    cursor: default;
}

.cashbox-menu-icon {
    width: 20px;
    text-align: center;
    flex: 0 0 20px;
}

.cashbox-beta-icon {
    font-size: 18px;
    line-height: 1;
    font-weight: 900;
}

.cashbox-pos-status-center {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 10px 18px;
    text-align: center;
}

.cashbox-pos-store-line {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--theme-text-strong);
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cashbox-pos-store-line span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cashbox-pos-separator {
    color: var(--theme-text-muted-cool);
    flex: 0 0 auto;
}

.cashbox-pos-shift-line {
    color: var(--theme-text-muted-soft);
    font-size: 12px;
    font-weight: 700;
}

.cashbox-pos-status-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border-left: 1px solid #eef1f5;
    color: var(--theme-text-mid);
    font-weight: 700;
    white-space: nowrap;
}

.cashbox-pos-date {
    color: var(--theme-text-secondary);
    font-size: 13px;
}

.cashbox-pos-time {
    min-width: 44px;
    color: var(--theme-text-strong);
    font-variant-numeric: tabular-nums;
}

.cashbox-pos-connection {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--theme-page-panel);
    color: var(--theme-text-muted-cool);
}

.cashbox-pos-connection.is-online {
    background: var(--theme-success-soft);
    color: #16803c;
}

.cashbox-pos-connection.is-offline {
    background: var(--theme-danger-soft);
    color: #b42318;
}

.cashbox-pos-workspace-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.cashbox-pos-quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.cashbox-entity-dialog .modal-content {
    overflow: hidden;
}

.cashbox-entity-dialog .modal-body {
    overflow: auto;
}

@media (max-width: 991px) {
    .cashbox-pos-statusbar {
        grid-template-columns: auto minmax(0, 1fr) auto;
        border-radius: 14px;
    }

    .cashbox-status-menu-btn {
        width: auto;
        min-width: 58px;
        padding: 0 14px;
    }

    .cashbox-status-menu-btn span {
        display: none;
    }

    .cashbox-pos-status-center {
        text-align: left;
        padding: 9px 12px;
    }

    .cashbox-pos-store-line {
        justify-content: flex-start;
        max-width: 100%;
    }

    .cashbox-pos-status-right {
        gap: 6px;
        padding: 0 10px;
    }

    .cashbox-pos-date {
        display: none;
    }

    .cashbox-pos-workspace-head {
        align-items: stretch;
        flex-direction: column;
    }

    .cashbox-pos-quick-actions {
        justify-content: flex-start;
    }

    .cashbox-entity-dialog .modal-content {
        min-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
}

@media (max-width: 575px) {
    .cashbox-pos-statusbar {
        grid-template-columns: 54px minmax(0, 1fr) 76px;
        min-height: 58px;
    }

    .cashbox-status-menu-btn {
        min-height: 58px;
        padding: 0 12px;
    }

    .cashbox-pos-status-center {
        padding: 8px 10px;
    }

    .cashbox-pos-store-line {
        font-size: 13px;
    }

    .cashbox-pos-shift-line {
        font-size: 11px;
    }

    .cashbox-pos-status-right {
        padding: 0 8px;
    }

    .cashbox-pos-time {
        min-width: 38px;
        font-size: 13px;
    }

    .cashbox-pos-connection {
        width: 28px;
        height: 28px;
    }

    .cashbox-pos-menu-panel {
        position: fixed;
        top: 72px;
        left: 12px;
        right: 12px;
        width: auto;
        max-height: calc(100vh - 86px);
        overflow: auto;
    }
}

/* V15: POS as one-page web app with bottom navigation */
.cashbox-pos-page {
    padding-bottom: 88px;
    font-family: inherit;
}

.cashbox-pos-app-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 16px;
    background: var(--theme-surface);
}

.cashbox-pos-app-head h1,
.cashbox-pos-app-head .fw-semibold,
.cashbox-pos-bottom-bar,
.cashbox-pos-bottom-menu,
.cashbox-spa-main,
.cashbox-spa-sidebar {
    font-family: inherit;
}

.cashbox-pos-app-head h1,
.cashbox-spa-main h2,
.cashbox-document-item h3,
.cashbox-shift-mini-item strong,
.cashbox-bottom-action,
.cashbox-menu-item,
.cashbox-pos-store-line,
.cashbox-pos-avatar {
    font-weight: 600;
}

.cashbox-pos-app-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.cashbox-pos-view {
    display: none;
}

.cashbox-pos-view.is-active {
    display: block;
}

.cashbox-spa-layout {
    display: grid;
    grid-template-columns: minmax(220px, 310px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.cashbox-spa-sidebar,
.cashbox-spa-main {
    padding: 16px;
}

.cashbox-spa-sidebar {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 130px);
    overflow: auto;
}

.cashbox-spa-sidebar-title,
.cashbox-spa-section-title {
    color: var(--theme-text-muted-soft);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 10px;
}

.cashbox-shift-mini-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cashbox-shift-mini-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-surface);
    padding: 10px 12px;
    color: var(--theme-text-strong);
    text-align: left;
}

.cashbox-shift-mini-item:hover,
.cashbox-shift-mini-item.is-active {
    background: var(--theme-surface-subtle);
    border-color: var(--theme-border-strong);
}

.cashbox-shift-mini-item small {
    display: block;
    margin-top: 2px;
    color: var(--theme-text-muted-soft);
}

.cashbox-shift-mini-item b {
    white-space: nowrap;
    font-weight: 600;
}

.cashbox-shift-full-head,
.cashbox-spa-panel-head,
.cashbox-document-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cashbox-shift-summary {
    display: grid;
    gap: 10px;
}

.cashbox-shift-summary-row {
    display: grid;
    grid-template-columns: minmax(210px, .85fr) minmax(0, 3fr);
    overflow: hidden;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--theme-surface-raised);
}

.cashbox-shift-summary-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px 16px;
    border-right: 1px solid var(--theme-border);
    background: var(--theme-surface-subtle);
}

.cashbox-shift-summary-title > b {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 12px;
    color: var(--theme-text-muted-soft);
    font-size: 12px;
    font-weight: 700;
}

.cashbox-shift-summary-title > span {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.cashbox-shift-summary-title strong {
    color: var(--theme-text-strong);
    font-size: 13px;
    font-weight: 650;
}

.cashbox-shift-summary-title small {
    color: var(--theme-text-muted-soft);
    font-size: 10px;
    line-height: 1.25;
}

.cashbox-shift-summary-values {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-width: 0;
}

.cashbox-shift-summary-values-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cashbox-shift-summary-values > div {
    min-width: 0;
    padding: 11px 13px;
    border-left: 1px solid var(--theme-border);
}

.cashbox-shift-summary-values > div:first-child {
    border-left: 0;
}

.cashbox-shift-summary-values span {
    display: block;
    margin-bottom: 3px;
    color: var(--theme-text-muted-soft);
    font-size: 11px;
}

.cashbox-shift-summary-values strong {
    display: block;
    overflow: hidden;
    color: var(--theme-text-strong);
    font-size: 16px;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cashbox-shift-summary-row-total {
    border-color: var(--theme-border-strong);
}

.cashbox-shift-summary-row-total .cashbox-shift-summary-title {
    background: var(--theme-surface-cool);
}

.cashbox-shift-summary-row-final {
    border-color: color-mix(in srgb, #3f9b73 34%, var(--theme-border));
    background: color-mix(in srgb, var(--theme-success-soft) 48%, var(--theme-surface-raised));
}

.cashbox-shift-summary-row-final .cashbox-shift-summary-title {
    background: color-mix(in srgb, var(--theme-success-soft) 68%, var(--theme-surface-subtle));
}

.cashbox-shift-summary-details {
    overflow: hidden;
    border: 1px solid var(--theme-border-strong);
    border-radius: 14px;
    background: var(--theme-surface-raised);
}

.cashbox-shift-summary-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    cursor: pointer;
    list-style: none;
    background: var(--theme-surface-cool);
}

.cashbox-shift-summary-details > summary::-webkit-details-marker {
    display: none;
}

.cashbox-shift-summary-details > summary .cashbox-shift-summary-title {
    flex: 1 1 auto;
    border-right: 0;
    background: transparent;
}

.cashbox-shift-summary-details > .cashbox-shift-summary-values {
    border-top: 1px solid var(--theme-border);
}

.cashbox-shift-summary-toggle {
    position: relative;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin-right: 14px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 11px;
    background: var(--theme-surface-raised);
}

.cashbox-shift-summary-toggle::before,
.cashbox-shift-summary-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 1.5px;
    border-radius: 999px;
    background: var(--theme-text-secondary);
    transform: translate(-50%, -50%);
    transition: transform .18s ease;
}

.cashbox-shift-summary-toggle::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.cashbox-shift-summary-details[open] .cashbox-shift-summary-toggle::after {
    transform: translate(-50%, -50%) rotate(0deg);
}

.cashbox-shift-product-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--theme-border);
}

.cashbox-shift-product-line:last-child {
    border-bottom: 0;
}

.cashbox-shift-product-line small {
    color: var(--theme-text-muted-soft);
}

.cashbox-documents-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cashbox-document-item {
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    background: var(--theme-surface);
    padding: 14px;
}

.cashbox-document-item h3 {
    margin: 0 0 4px;
    font-size: 16px;
    color: var(--theme-text-strong);
}

.cashbox-document-meta {
    color: var(--theme-text-muted-soft);
    font-size: 12px;
}


.cashbox-document-payment-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
    min-width: 120px;
}

.cashbox-document-payment-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.cashbox-document-payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 999px;
    background: var(--theme-surface);
    color: var(--theme-text-mid);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.cashbox-document-payment-icon {
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cashbox-document-payment-icon svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.cashbox-application-btn {
    padding: 2px 8px;
    line-height: 1.35;
}

.cashbox-document-price {
    color: var(--theme-positive);
    white-space: nowrap;
    font-size: 18px;
    font-weight: 600;
}

.cashbox-document-price.is-negative {
    color: var(--theme-negative);
}

.cashbox-document-price.is-writeoff {
    color: var(--theme-writeoff);
}

.cashbox-document-price.is-positive {
    color: var(--theme-positive);
}

.cashbox-document-products th {
    color: var(--theme-text-muted-soft);
    font-size: 12px;
    font-weight: 600;
    background: var(--theme-surface-subtle);
}

.cashbox-pos-bottom-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(17, 24, 39, .22);
    z-index: 1050;
}

.cashbox-pos-bottom-backdrop.is-open {
    display: block;
}

.cashbox-pos-bottom-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1060;
    min-height: 64px;
    display: grid;
    grid-template-columns: repeat(4, minmax(72px, auto)) minmax(130px, 1fr);
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 20px;
    background: var(--theme-surface);
    box-shadow: 0 22px 60px rgba(17, 24, 39, .18);
    backdrop-filter: blur(12px);
}

.cashbox-bottom-action {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--theme-text-mid);
    font-size: 13px;
    text-decoration: none;
}

.cashbox-bottom-action:hover,
.cashbox-bottom-action.is-active,
.cashbox-bottom-action[aria-expanded="true"] {
    background: var(--theme-surface-soft);
    color: var(--theme-text-strong);
}

.cashbox-bottom-action:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.cashbox-bottom-action svg,
.cashbox-bottom-status svg,
.cashbox-pos-bottom-menu svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
    flex: 0 0 auto;
}

.cashbox-bottom-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: var(--theme-text-secondary);
    font-size: 12px;
    min-width: 0;
}

.cashbox-bottom-status time {
    color: var(--theme-text-strong);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.cashbox-pos-bottom-menu {
    position: fixed;
    left: 16px;
    bottom: 92px;
    top: auto;
    width: min(380px, calc(100vw - 32px));
    max-height: calc(100vh - 130px);
    overflow: auto;
    z-index: 1065;
    border-radius: 20px;
}

.cashbox-pos-bottom-menu .cashbox-menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 14px;
}

.cashbox-pos-bottom-menu .cashbox-menu-item:hover {
    background: var(--theme-surface-subtle);
}

.cashbox-menu-item.is-muted,
.cashbox-beta-icon {
    display: none !important;
}

.cashbox-pos-statusbar,
.cashbox-pos-workspace-head {
    display: none !important;
}

@media (max-width: 1199px) {
    .cashbox-shift-summary-row {
        grid-template-columns: minmax(190px, .8fr) minmax(0, 2fr);
    }

    .cashbox-shift-summary-values,
    .cashbox-shift-summary-values-five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cashbox-shift-summary-values > div:nth-child(odd) {
        border-left: 0;
    }

    .cashbox-shift-summary-values > div:nth-child(n + 3) {
        border-top: 1px solid var(--theme-border);
    }

    .cashbox-shift-summary-values-five > div:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 991px) {
    .cashbox-spa-layout {
        grid-template-columns: 1fr;
    }

    .cashbox-spa-sidebar {
        position: static;
        max-height: none;
    }

    .cashbox-shift-mini-list {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(210px, 1fr);
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .cashbox-pos-app-head {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 767px) {
    .cashbox-pos-page {
        padding-bottom: 112px;
    }

    .cashbox-pos-bottom-bar {
        left: 8px;
        right: 8px;
        bottom: 8px;
        grid-template-columns: repeat(4, 1fr);
        min-height: 72px;
        border-radius: 18px;
    }

    .cashbox-bottom-action {
        flex-direction: column;
        gap: 3px;
        min-height: 54px;
        font-size: 11px;
    }

    .cashbox-bottom-status {
        grid-column: 1 / -1;
        justify-content: center;
        border-top: 1px solid var(--theme-border);
        padding-top: 6px;
    }

    .cashbox-pos-bottom-menu {
        left: 8px;
        right: 8px;
        bottom: 104px;
        width: auto;
        max-height: calc(100vh - 122px);
    }

    .cashbox-shift-full-head,
    .cashbox-spa-panel-head,
    .cashbox-document-head {
        flex-direction: column;
        align-items: stretch;
    }

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

    .cashbox-shift-summary-title {
        border-right: 0;
        border-bottom: 1px solid var(--theme-border);
    }
}

/* POS v16: единое кассовое приложение */
.cashbox-pos-page {
    font-family: inherit;
    font-weight: 400;
}

.cashbox-spa-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.cashbox-inline-ops-card {
    position: sticky;
    top: 18px;
}

.cashbox-method-balance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.cashbox-method-balance,
.cashbox-report-card {
    border: 1px solid var(--theme-border-strong);
    border-radius: 14px;
    background: var(--theme-surface-cool);
    padding: 12px;
    min-width: 0;
}

.cashbox-method-balance span,
.cashbox-report-card span,
.cashbox-report-line span {
    display: block;
    color: var(--theme-text-muted-soft);
    font-size: 12px;
    margin-bottom: 4px;
}

.cashbox-method-balance strong,
.cashbox-report-card strong,
.cashbox-report-line strong {
    color: var(--theme-text-strong);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.cashbox-report-card small {
    display: block;
    color: var(--theme-text-muted-soft);
    font-size: 12px;
    margin-top: 4px;
}

.cashbox-report-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.cashbox-report-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #edf1f6;
}

.cashbox-inline-form .form-label,
.cashbox-inline-entity-form .form-label {
    font-size: 12px;
    color: var(--theme-text-secondary);
    margin-bottom: 4px;
}

.cashbox-products-list-inline {
    display: grid;
    gap: 12px;
}

.cashbox-register-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.cashbox-register-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 16px;
    padding: 14px;
    background: var(--theme-surface);
}

.cashbox-product-section {
    border: 1px solid var(--theme-border-strong);
    border-radius: 16px;
    background: var(--theme-surface-raised);
    padding: 16px;
}

.cashbox-pos-bottom-bar {
    grid-template-columns: repeat(4, minmax(72px, auto)) minmax(130px, 1fr);
    overflow-x: auto;
    scrollbar-width: thin;
}

.cashbox-bottom-action {
    font-weight: 500;
    white-space: nowrap;
}

body.modal-open .cashbox-pos-bottom-bar,
body.modal-open .cashbox-pos-bottom-menu,
body.modal-open .cashbox-pos-bottom-backdrop {
    pointer-events: none;
}

.modal-backdrop {
    z-index: 1990;
}

.modal {
    z-index: 2000;
}

@media (max-width: 1199px) {
    .cashbox-spa-grid {
        grid-template-columns: 1fr;
    }

    .cashbox-inline-ops-card {
        position: static;
    }

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

@media (max-width: 767px) {
    .cashbox-pos-bottom-bar {
        grid-template-columns: repeat(7, minmax(72px, 1fr));
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .cashbox-bottom-status {
        min-width: 160px;
    }

    .cashbox-method-balance-grid,
    .cashbox-report-grid,
    .cashbox-register-card-grid {
        grid-template-columns: 1fr;
    }

    .cashbox-register-card {
        grid-template-columns: 1fr;
        align-items: start;
    }
}

/* v17: единое кассовое приложение */
.cashbox-report-filter {
    background: var(--theme-surface-cool);
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 14px;
}
.cashbox-report-filter .form-label {
    font-size: .78rem;
    color: var(--theme-text-muted-cool);
    margin-bottom: 4px;
}
.cashbox-shift-mini-item {
    cursor: pointer;
}
.cashbox-shift-products {
    border-top: 1px solid #eef2f7;
    padding-top: 14px;
}
.cashbox-shift-products summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--theme-text-mid);
    list-style: none;
}
.cashbox-shift-products summary::-webkit-details-marker {
    display: none;
}
.cashbox-shift-products summary::after {
    content: 'Показать';
    float: right;
    font-size: .78rem;
    font-weight: 500;
    color: var(--theme-text-muted-cool);
    border: 1px solid var(--theme-border-strong);
    border-radius: 999px;
    padding: 2px 8px;
}
.cashbox-shift-products[open] summary::after {
    content: 'Скрыть';
}
.cashbox-document-item {
    scroll-margin-bottom: 120px;
}
.cashbox-bottom-action span {
    font-weight: 500;
}
.cashbox-spa-main,
.cashbox-pos-page {
    font-weight: 400;
}
@media (max-width: 767px) {
    .cashbox-report-filter {
        padding: 12px;
        border-radius: 12px;
    }
    .cashbox-shift-full-head {
        align-items: flex-start;
        gap: 10px;
    }
}


/* v18: нижнее меню только для основных POS-вкладок */
.cashbox-pos-bottom-bar {
    grid-template-columns: repeat(4, minmax(72px, auto)) minmax(130px, 1fr);
}
.cashbox-pos-menu-panel .cashbox-menu-item svg {
    width: 18px;
    height: 18px;
}
@media (max-width: 767.98px) {
    .cashbox-pos-bottom-bar {
        grid-template-columns: repeat(4, minmax(62px, 1fr));
    }
    .cashbox-bottom-status {
        display: none;
    }
}

/* DaData inside POS modal forms */
.cashbox-customer-toggle .btn {
    border-style: dashed;
    min-height: 42px;
}

.cashbox-dadata-panel {
    position: absolute;
    z-index: 2200;
    background: var(--theme-surface);
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
}

.cashbox-dadata-panel.d-none {
    display: none !important;
}

.cashbox-dadata-item {
    display: block;
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(15, 23, 42, .07);
    background: var(--theme-surface);
    text-align: left;
    padding: 10px 12px;
    color: var(--theme-text-strong);
    cursor: pointer;
}

.cashbox-dadata-item:last-child {
    border-bottom: 0;
}

.cashbox-dadata-item:hover,
.cashbox-dadata-item:focus {
    background: var(--theme-surface-cool);
    outline: none;
}

.cashbox-dadata-title {
    font-weight: 600;
    line-height: 1.25;
}

.cashbox-dadata-meta {
    color: var(--theme-text-muted-cool);
    font-size: .82rem;
    margin-top: 2px;
}


@media (max-width: 767.98px) {
    .cashbox-document-payment-stack {
        align-items: flex-start;
        min-width: 0;
        width: 100%;
    }

    .cashbox-document-payment-badges {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .cashbox-dadata-panel {
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-height: 50vh;
    }
}

/* Сравнение найденного дубля покупателя в кассе */
.cashbox-duplicate-compare {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

.cashbox-duplicate-column {
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 16px;
    background: var(--theme-surface);
    overflow: hidden;
    min-width: 0;
}

.cashbox-duplicate-column-title {
    padding: 12px 14px;
    background: var(--theme-surface-cool);
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    font-weight: 600;
    color: var(--theme-text-strong);
}

.cashbox-duplicate-list {
    display: flex;
    flex-direction: column;
}

.cashbox-duplicate-row {
    display: grid;
    grid-template-columns: minmax(120px, .75fr) minmax(0, 1.25fr);
    gap: 12px;
    padding: 9px 14px;
    border-bottom: 1px solid rgba(15, 23, 42, .06);
    align-items: start;
}

.cashbox-duplicate-row:last-child {
    border-bottom: 0;
}

.cashbox-duplicate-row.is-changed {
    background: var(--theme-warning-soft);
}

.cashbox-duplicate-label {
    color: var(--theme-text-muted-cool);
    font-size: .84rem;
}

.cashbox-duplicate-value {
    color: var(--theme-text-strong);
    font-weight: 500;
    word-break: break-word;
}

@media (max-width: 767.98px) {
    .cashbox-duplicate-compare {
        grid-template-columns: 1fr;
    }

    .cashbox-duplicate-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* V24: мягкое открытие нижнего меню, возвраты и телефонный ввод */
.cashbox-pos-bottom-backdrop {
    opacity: 0;
    pointer-events: none;
    display: block;
    transition: opacity .16s ease;
}
.cashbox-pos-bottom-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}
.cashbox-pos-bottom-menu {
    opacity: 0;
    transform: translateY(18px) scale(.985);
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    will-change: transform, opacity;
}
.cashbox-pos-bottom-menu.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
}
.cashbox-pos-bottom-menu .cashbox-menu-item.is-danger {
    color: #b42318;
}
.cashbox-pos-bottom-menu .cashbox-menu-item.is-danger:hover {
    background: var(--theme-danger-soft);
}
.cashbox-pos-bottom-menu .cashbox-menu-item:disabled,
.cashbox-pos-bottom-menu .cashbox-menu-item.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}
.cashbox-phone-input {
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
}
.cashbox-refund-search-wrap {
    position: relative;
}
.cashbox-refund-search-wrap .form-control {
    padding-left: 42px;
}
.cashbox-refund-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--theme-text-muted-soft);
    pointer-events: none;
}
.cashbox-refund-search-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}
.cashbox-refund-dialog .modal-body {
    overflow: hidden;
}
.cashbox-refund-layout {
    display: grid;
    grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    min-height: 0;
}
.cashbox-refund-column {
    min-height: 0;
}
.cashbox-refund-sales-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: min(56vh, 560px);
    max-height: min(56vh, 560px);
    overflow: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
}
.cashbox-refund-sale-item {
    width: 100%;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 12px;
    background: var(--theme-surface);
    color: var(--theme-text-strong);
    text-align: left;
    transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.cashbox-refund-sale-item:hover,
.cashbox-refund-sale-item.is-active {
    border-color: #c4ccd9;
    background: var(--theme-surface-subtle);
}
.cashbox-refund-sale-item.is-active {
    box-shadow: 0 0 0 2px rgba(31, 41, 55, .06);
}
.cashbox-refund-sale-check {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid var(--theme-border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--theme-text-secondary);
    background: var(--theme-surface);
}
.cashbox-refund-sale-item.is-active .cashbox-refund-sale-check {
    background: #1f2937;
    border-color: #1f2937;
    color: #fff;
}
.cashbox-refund-sale-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cashbox-refund-sale-head,
.cashbox-refund-selected-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.cashbox-refund-sale-head b,
.cashbox-refund-sale-item b {
    white-space: nowrap;
    font-weight: 600;
}
.cashbox-refund-sale-products {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--theme-text-secondary);
    font-size: 12px;
    line-height: 1.35;
    max-height: 58px;
    overflow: hidden;
}
.cashbox-refund-sale-item small,
.cashbox-refund-selected small {
    display: block;
    color: var(--theme-text-muted-soft);
    margin-top: 2px;
}
.cashbox-refund-sale-item em {
    display: block;
    color: #b42318;
    font-size: 11px;
    font-style: normal;
}
.cashbox-refund-sale-item.is-refunded {
    opacity: .55;
}
.cashbox-refund-selected {
    height: min(56vh, 560px);
    max-height: min(56vh, 560px);
    overflow: auto;
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    background: var(--theme-surface-raised);
    padding: 14px;
    color: var(--theme-text-secondary);
    overscroll-behavior: contain;
}
.cashbox-refund-selected-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 14px;
    align-items: center;
    border-bottom: 1px solid var(--theme-border);
    padding-bottom: 10px;
    margin-bottom: 10px;
    color: var(--theme-text-muted-soft);
}
.cashbox-refund-selected-summary strong {
    color: var(--theme-text-strong);
    text-align: right;
}
.cashbox-refund-selected-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cashbox-refund-selected-card {
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--theme-surface);
    padding: 12px;
}
.cashbox-refund-selected-head b {
    color: #b42318;
    white-space: nowrap;
}
.cashbox-refund-remove-btn {
    border: 1px solid var(--theme-border);
    background: var(--theme-surface);
    color: var(--theme-text-muted-soft);
    width: 28px;
    height: 28px;
    border-radius: 999px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cashbox-refund-remove-btn:hover {
    background: var(--theme-danger-soft);
    color: #b42318;
    border-color: #f0b9b9;
}
@media (max-width: 991px) {
    .cashbox-refund-dialog .modal-body {
        overflow: auto;
    }
    .cashbox-refund-layout {
        grid-template-columns: 1fr;
    }
    .cashbox-refund-sales-list,
    .cashbox-refund-selected {
        height: auto;
        max-height: 42vh;
    }
}
.cashbox-pos-bottom-menu {
    display: block;
}

/* POS смены: прокрутка списка и догрузка без перегруза страницы */
.cashbox-shift-mini-list {
    max-height: min(560px, calc(100vh - 260px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
}

.cashbox-shift-list-loader {
    padding: 10px 12px;
    border: 1px dashed var(--theme-border-strong);
    border-radius: 12px;
    color: var(--theme-text-muted-soft);
    font-size: 12px;
    text-align: center;
    background: var(--theme-surface-cool);
}

.cashbox-document-comment {
    margin-top: 8px;
    padding: 9px 11px;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-surface-cool);
    color: var(--theme-text-mid);
    font-size: 12px;
    line-height: 1.35;
    max-width: 620px;
    white-space: normal;
}

@media (max-width: 991px) {
    .cashbox-shift-mini-list {
        display: flex;
        flex-direction: column;
        max-height: 340px;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 0;
    }
}

/* AJAX-каталог товаров, папок, заготовок и партий */
.cashbox-catalog-shell {
    overflow: hidden;
}
.cashbox-catalog-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--theme-border);
    background: var(--theme-surface);
}
.cashbox-catalog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
}
.cashbox-catalog-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    min-height: min(72vh, 760px);
}
.cashbox-catalog-sidebar {
    border-right: 1px solid var(--theme-border);
    background: var(--theme-surface-cool);
    padding: 1rem;
    overflow: auto;
    max-height: min(72vh, 760px);
}
.cashbox-catalog-main {
    padding: 1rem;
    min-width: 0;
}
.cashbox-catalog-side-title {
    font-size: .76rem;
    font-weight: 700;
    color: var(--theme-text-muted-cool);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .55rem;
}
.cashbox-catalog-folder-list,
.cashbox-blank-summary {
    display: grid;
    gap: .35rem;
}
.cashbox-catalog-folder,
.cashbox-blank-summary-row {
    width: 100%;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface);
    border-radius: .75rem;
    padding: .55rem .65rem;
    display: flex;
    justify-content: space-between;
    gap: .7rem;
    align-items: center;
    text-align: left;
    color: var(--theme-text-deep);
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.cashbox-catalog-folder:hover,
.cashbox-blank-summary-row:hover {
    border-color: var(--theme-border-strong);
    background: var(--theme-surface-hover);
}
.cashbox-catalog-folder.is-active {
    border-color: #111827;
    background: #111827;
    color: #fff;
}
.cashbox-catalog-folder small,
.cashbox-blank-summary-row small {
    color: inherit;
    opacity: .65;
    white-space: nowrap;
}
.cashbox-blank-summary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}
.cashbox-blank-summary-row span {
    grid-row: span 2;
    min-width: 0;
    font-size: .82rem;
}
.cashbox-blank-summary-row strong {
    font-size: .86rem;
    white-space: nowrap;
}
.cashbox-blank-summary-row.is-empty {
    background: var(--theme-surface-hover);
    color: var(--theme-text-muted-cool);
}
.cashbox-catalog-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    gap: .75rem;
    margin-bottom: .75rem;
}
.cashbox-catalog-hint {
    border: 1px solid var(--theme-border);
    background: var(--theme-surface-cool);
    border-radius: .85rem;
    padding: .7rem .85rem;
    font-size: .84rem;
    color: var(--theme-text-secondary);
    margin-bottom: .85rem;
}
.cashbox-catalog-list {
    display: grid;
    gap: .45rem;
    max-height: min(62vh, 660px);
    overflow: auto;
    padding-right: .15rem;
}
.cashbox-catalog-product-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(90px, 120px) minmax(90px, 120px) minmax(100px, 130px) auto;
    gap: .65rem;
    align-items: center;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface);
    border-radius: .9rem;
    padding: .65rem .75rem;
}
.cashbox-catalog-product-row.is-disabled {
    background: var(--theme-surface-hover);
    color: var(--theme-text-muted-cool);
}
.cashbox-catalog-product-title strong {
    font-size: .95rem;
    font-weight: 650;
}
.cashbox-catalog-product-meta,
.cashbox-catalog-product-blank {
    font-size: .78rem;
    color: var(--theme-text-muted-cool);
    margin-top: .15rem;
}
.cashbox-catalog-product-money {
    display: grid;
    gap: .1rem;
    text-align: right;
}
.cashbox-catalog-product-money span {
    font-size: .72rem;
    color: var(--theme-text-muted-cool);
}
.cashbox-catalog-product-money strong {
    font-size: .9rem;
    white-space: nowrap;
}
.cashbox-catalog-product-actions {
    display: flex;
    justify-content: flex-end;
}
.cashbox-catalog-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 1rem;
}
.cashbox-catalog-form-side {
    display: grid;
    align-content: start;
    gap: .75rem;
}
.cashbox-catalog-side-box,
.cashbox-catalog-form-section {
    border: 1px solid var(--theme-border);
    border-radius: 1rem;
    background: var(--theme-surface);
    padding: .9rem;
}
.cashbox-blank-preview-total,
.cashbox-blank-preview-batches div {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    border-bottom: 1px solid var(--theme-border);
    padding: .4rem 0;
    font-size: .84rem;
}
.cashbox-blank-preview-total:last-child,
.cashbox-blank-preview-batches div:last-child {
    border-bottom: 0;
}
.cashbox-blank-preview-total strong,
.cashbox-blank-preview-batches strong {
    white-space: nowrap;
}
@media (max-width: 991.98px) {
    .cashbox-catalog-head {
        flex-direction: column;
    }
    .cashbox-catalog-layout,
    .cashbox-catalog-form-grid {
        grid-template-columns: 1fr;
    }
    .cashbox-catalog-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--theme-border);
        max-height: 280px;
    }
    .cashbox-catalog-toolbar,
    .cashbox-catalog-product-row {
        grid-template-columns: 1fr;
    }
    .cashbox-catalog-product-money {
        text-align: left;
        display: flex;
        justify-content: space-between;
        border-top: 1px solid #edf2f7;
        padding-top: .4rem;
    }
    .cashbox-catalog-product-actions {
        justify-content: stretch;
    }
    .cashbox-catalog-product-actions .btn {
        width: 100%;
    }
}

/* Упрощенный каталог товаров и отдельный склад заготовок */
.cashbox-catalog-product-row {
    grid-template-columns: minmax(260px, 1fr) minmax(92px, 120px) minmax(92px, 120px) minmax(150px, auto);
}
.cashbox-catalog-product-blank span,
.cashbox-catalog-product-application span {
    color: var(--theme-text-secondary);
    font-weight: 650;
}
.cashbox-catalog-product-blank.is-warning {
    color: #b45309;
}
.cashbox-catalog-product-application {
    font-size: .77rem;
    color: var(--theme-text-muted-cool);
    margin-top: .12rem;
}
.cashbox-catalog-product-actions {
    gap: .35rem;
    flex-wrap: wrap;
}
.cashbox-blank-preview-name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--theme-text-deep);
    border: 1px solid var(--theme-border);
    background: var(--theme-surface-cool);
    border-radius: .75rem;
    padding: .55rem .65rem;
    margin-bottom: .55rem;
}
.cashbox-blanks-shell {
    overflow: hidden;
}
.cashbox-blanks-toolbar {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--theme-border);
    background: var(--theme-surface-cool);
}
.cashbox-blanks-toolbar .form-control {
    max-width: 360px;
}
.cashbox-blanks-content {
    padding: 1rem;
    max-height: min(72vh, 760px);
    overflow: auto;
}
.cashbox-blank-summary-wide {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.cashbox-blank-summary-row span em {
    display: block;
    font-style: normal;
    font-size: .74rem;
    color: var(--theme-text-muted-cool);
    margin-top: .12rem;
    line-height: 1.25;
}
.cashbox-blank-table {
    display: grid;
    gap: .45rem;
}
.cashbox-blank-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(100px, 140px) minmax(120px, 160px) auto;
    gap: .75rem;
    align-items: center;
    border: 1px solid var(--theme-border);
    border-radius: .9rem;
    background: var(--theme-surface);
    padding: .7rem .8rem;
}
.cashbox-blank-row > div:not(:first-child) {
    display: grid;
    gap: .1rem;
    text-align: right;
}
.cashbox-blank-row span {
    font-size: .72rem;
    color: var(--theme-text-muted-cool);
}
.cashbox-blank-row strong {
    font-size: .9rem;
}
@media (max-width: 991.98px) {
    .cashbox-catalog-product-row,
    .cashbox-blank-row {
        grid-template-columns: 1fr;
    }
    .cashbox-blanks-toolbar {
        flex-direction: column;
    }
    .cashbox-blanks-toolbar .form-control {
        max-width: none;
    }
    .cashbox-blank-row > div:not(:first-child) {
        text-align: left;
    }
    .cashbox-catalog-product-actions .btn {
        width: auto;
        flex: 1 1 130px;
    }
}

/* Точечная переработка склада партий и редактора товара */
.cashbox-blank-list-caption {
    display: grid;
    gap: .15rem;
    min-width: 0;
}
.cashbox-blank-list-caption strong { font-size: .9rem; color: var(--theme-text-deep); }
.cashbox-blank-list-caption span { font-size: .76rem; color: var(--theme-text-muted-cool); }
.cashbox-blank-summary-wide {
    display: grid;
    grid-template-columns: 1fr;
    gap: .65rem;
}
.cashbox-blank-kind-card {
    border: 1px solid var(--theme-border-strong);
    border-radius: 1rem;
    background: var(--theme-surface);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.cashbox-blank-kind-card.is-empty { border-color: #f2d4d4; }
.cashbox-blank-kind-head {
    width: 100%;
    border: 0;
    background: var(--theme-surface);
    display: grid;
    grid-template-columns: 24px minmax(210px, 1.8fr) repeat(4, minmax(115px, .75fr)) auto;
    gap: .75rem;
    align-items: center;
    padding: .9rem 1rem;
    text-align: left;
    color: inherit;
}
.cashbox-blank-kind-head:hover { background: var(--theme-surface-cool); }
.cashbox-blank-chevron {
    font-size: 1.35rem;
    line-height: 1;
    color: var(--theme-text-muted-cool);
    text-align: center;
}
.cashbox-blank-kind-name { display: grid; gap: .15rem; min-width: 0; }
.cashbox-blank-kind-name strong { font-size: .95rem; color: var(--theme-text-deep); }
.cashbox-blank-kind-name small { color: var(--theme-text-muted-cool); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cashbox-blank-kind-stat { display: grid; gap: .1rem; text-align: right; }
.cashbox-blank-kind-stat em { font-style: normal; color: var(--theme-text-muted-cool); font-size: .68rem; }
.cashbox-blank-kind-stat strong { color: var(--theme-text-deep); font-size: .86rem; }
.cashbox-blank-kind-count {
    border-radius: 999px;
    background: var(--theme-surface-soft);
    color: var(--theme-text-secondary);
    font-size: .7rem;
    font-weight: 700;
    padding: .25rem .48rem;
    white-space: nowrap;
}
.cashbox-blank-kind-body {
    border-top: 1px solid var(--theme-border);
    background: var(--theme-surface-cool);
    padding: .75rem;
}
.cashbox-blank-kind-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .15rem .15rem .7rem;
}
.cashbox-blank-batch-list { display: grid; gap: .45rem; }
.cashbox-blank-batch-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(100px, .7fr)) auto;
    gap: .65rem;
    align-items: center;
    border: 1px solid var(--theme-border);
    border-radius: .8rem;
    background: var(--theme-surface);
    padding: .65rem .75rem;
}
.cashbox-blank-batch-row.is-depleted { opacity: .72; background: var(--theme-surface-muted); }
.cashbox-blank-batch-main { display: grid; gap: .08rem; min-width: 0; }
.cashbox-blank-batch-main strong { font-size: .86rem; color: var(--theme-text-deep); }
.cashbox-blank-batch-main span,
.cashbox-blank-batch-main small { font-size: .72rem; color: var(--theme-text-muted-cool); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cashbox-blank-batch-metric { display: grid; gap: .08rem; text-align: right; }
.cashbox-blank-batch-metric span { font-size: .66rem; color: var(--theme-text-muted-cool); }
.cashbox-blank-batch-metric strong { font-size: .82rem; color: #1e293b; }
.cashbox-blank-empty { display: grid; gap: .2rem; text-align: center; color: var(--theme-text-muted-cool); padding: 2rem 1rem; }
.cashbox-blank-empty strong { color: var(--theme-text-mid); }

.cashbox-product-editor-dialog { max-width: min(1180px, calc(100vw - 2rem)); }
.cashbox-product-editor-content .modal-body { background: var(--theme-surface-cool); }
.cashbox-product-editor-content .cashbox-catalog-form-main,
.cashbox-product-editor-content .cashbox-catalog-form-side { min-width: 0; }
.cashbox-product-editor-content .cashbox-catalog-form-section,
.cashbox-product-editor-content .cashbox-catalog-side-box {
    background: var(--theme-surface);
    border-color: var(--theme-border-strong);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .025);
}
.cashbox-product-editor-content .form-check.h-100 {
    min-height: 58px;
    display: flex;
    align-items: center;
}
.cashbox-product-editor-content .form-check.h-100 .form-check-label { line-height: 1.25; }
.cashbox-complete-sale-btn { min-height: 48px; font-weight: 700; }
.cashbox-checkout-field-wide { grid-column: 1 / -1; }
.cashbox-checkout-souvenir { border-color: var(--theme-border-strong); background: var(--theme-surface-cool); }

@media (max-width: 1199.98px) {
    .cashbox-blank-kind-head { grid-template-columns: 22px minmax(200px, 1fr) repeat(2, minmax(110px, .65fr)) auto; }
    .cashbox-blank-kind-stat:nth-of-type(5),
    .cashbox-blank-kind-stat:nth-of-type(6) { display: none; }
    .cashbox-blank-batch-row { grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(110px, .7fr)) auto; }
    .cashbox-blank-batch-metric:nth-of-type(4),
    .cashbox-blank-batch-metric:nth-of-type(5) { display: none; }
}
@media (max-width: 767.98px) {
    .cashbox-blank-kind-head { grid-template-columns: 20px 1fr auto; gap: .5rem; padding: .75rem; }
    .cashbox-blank-kind-stat { display: none !important; }
    .cashbox-blank-kind-name small { white-space: normal; }
    .cashbox-blank-kind-actions { align-items: stretch; flex-direction: column; }
    .cashbox-blank-batch-row { grid-template-columns: 1fr 1fr; }
    .cashbox-blank-batch-main { grid-column: 1 / -1; }
    .cashbox-blank-batch-metric { text-align: left; }
    .cashbox-blank-batch-row .btn { grid-column: 1 / -1; width: 100%; }
    .cashbox-blanks-content { padding: .65rem; }
}

/* Отчёты, компактный каталог и склад товаров — обновление 10.07.2026 */
.cashbox-product-view-toggle {
    min-width: 112px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    white-space: nowrap;
}
.cashbox-product-view-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.cashbox-products-grid.is-list-view {
    display: grid;
    grid-template-columns: 1fr;
    gap: .45rem;
}
.cashbox-products-grid.is-list-view .cashbox-product-tile {
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(220px, 2fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .65rem .8rem;
    text-align: left;
}
.cashbox-products-grid.is-list-view .cashbox-product-tile .tile-name {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cashbox-products-grid.is-list-view .cashbox-product-tile .tile-meta {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cashbox-products-grid.is-list-view .cashbox-product-tile > strong { text-align: right; white-space: nowrap; }
.cashbox-products-grid.is-list-view .tile-stock-badge { grid-column: 1 / -1; justify-self: start; margin-top: -.35rem; }

.cashbox-report-shell { overflow: hidden; }
.cashbox-report-advanced {
    border: 1px solid var(--theme-border-strong);
    border-radius: 1rem;
    background: var(--theme-surface-cool);
    padding: 1rem;
}
.cashbox-filter-check,
.cashbox-filter-switch {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    min-height: 52px;
    border: 1px solid var(--theme-border-strong);
    border-radius: .85rem;
    background: var(--theme-surface);
    padding: .7rem .8rem;
    cursor: pointer;
}
.cashbox-filter-check input,
.cashbox-filter-switch input { margin-top: .18rem; flex: 0 0 auto; }
.cashbox-filter-check span { display: grid; gap: .08rem; }
.cashbox-filter-check strong { font-size: .84rem; color: var(--theme-text-deep); }
.cashbox-filter-check small { font-size: .7rem; color: var(--theme-text-muted-cool); line-height: 1.25; }
.cashbox-filter-switch { min-height: 42px; align-items: center; font-size: .82rem; font-weight: 650; }
.cashbox-report-filter select:disabled { opacity: .55; background-color: var(--theme-surface-soft); cursor: not-allowed; }
.cashbox-report-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .75rem;
}
.cashbox-report-card {
    min-width: 0;
    border: 1px solid var(--theme-border-strong);
    border-radius: .95rem;
    background: linear-gradient(180deg, var(--theme-surface) 0%, var(--theme-surface-cool) 100%);
    padding: .85rem .9rem;
    display: grid;
    gap: .22rem;
}
.cashbox-report-card > span { color: var(--theme-text-muted-cool); font-size: .72rem; }
.cashbox-report-card > strong { color: var(--theme-text-deep); font-size: 1.05rem; line-height: 1.15; }
.cashbox-report-card > small { color: var(--theme-text-muted-cool); font-size: .66rem; }
.cashbox-report-panel {
    height: 100%;
    border: 1px solid var(--theme-border-strong);
    border-radius: 1rem;
    background: var(--theme-surface);
    padding: 1rem;
    overflow: hidden;
}
.cashbox-chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin: .45rem 0 .35rem; color: var(--theme-text-muted-cool); font-size: .72rem; }
.cashbox-chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.cashbox-chart-legend i { width: 18px; height: 3px; border-radius: 999px; background: #1f4f83; }
.cashbox-chart-legend i.is-profit { background: #11845b; }
.cashbox-trend-chart { min-height: 280px; width: 100%; overflow-x: auto; }
.cashbox-trend-chart svg { width: 100%; min-width: 620px; height: auto; display: block; }
.cashbox-chart-grid-line { stroke: #e7edf4; stroke-width: 1; }
.cashbox-chart-axis-label,
.cashbox-chart-date-label { fill: var(--theme-text-muted-cool); font-size: 10px; font-family: inherit; }
.cashbox-chart-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cashbox-chart-line.is-revenue { stroke: #1f4f83; }
.cashbox-chart-line.is-profit { stroke: #11845b; }
.cashbox-chart-dot { stroke: #fff; stroke-width: 1.5; }
.cashbox-chart-dot.is-revenue { fill: #1f4f83; }
.cashbox-chart-dot.is-profit { fill: #11845b; }
.cashbox-chart-empty { min-height: 180px; display: grid; place-items: center; color: var(--theme-text-muted-cool); font-size: .8rem; }
.cashbox-payment-chart { display: grid; gap: .75rem; margin: .75rem 0 1rem; }
.cashbox-payment-bar-row { display: grid; gap: .28rem; }
.cashbox-payment-bar-head { display: flex; justify-content: space-between; gap: .75rem; color: var(--theme-text-secondary); font-size: .72rem; }
.cashbox-payment-bar-head strong { color: var(--theme-text-deep); }
.cashbox-payment-bar-track { height: 8px; border-radius: 999px; background: var(--theme-surface-soft); overflow: hidden; }
.cashbox-payment-bar-track span { display: block; height: 100%; border-radius: inherit; background: #1f4f83; }
.cashbox-payment-bar-track span.is-negative { background: #c44747; }
.cashbox-report-line { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .45rem 0; border-top: 1px solid #edf2f7; font-size: .78rem; }
.cashbox-report-line:first-child { border-top: 0; }

.cashbox-stock-shell { overflow: hidden; }
.cashbox-stock-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--theme-border);
    background: var(--theme-surface-cool);
}
.cashbox-stock-toolbar .cashbox-stock-filters { display: flex; gap: .55rem; flex: 1 1 auto; }
.cashbox-stock-toolbar .form-control,
.cashbox-stock-toolbar .form-select { max-width: 340px; }
.cashbox-stock-table-wrap { max-height: min(70vh, 740px); overflow: auto; }
.cashbox-stock-table { min-width: 980px; }
.cashbox-stock-table thead th { position: sticky; top: 0; z-index: 2; background: var(--theme-surface-cool); color: var(--theme-text-muted-cool); font-size: .7rem; font-weight: 650; }
.cashbox-stock-table td { font-size: .78rem; vertical-align: middle; }
.cashbox-stock-product-name { display: grid; gap: .1rem; }
.cashbox-stock-product-name strong { color: var(--theme-text-deep); }
.cashbox-stock-product-name small { color: var(--theme-text-muted-cool); }

.cashbox-equal-option {
    height: 100%;
    min-height: 86px;
    border: 1px solid var(--theme-border-strong);
    border-radius: .85rem;
    background: var(--theme-surface);
    padding: .85rem .85rem .85rem 2.65rem;
    display: flex;
    align-items: flex-start;
}
.cashbox-equal-option .form-check-input { margin-top: .22rem; }
.cashbox-equal-option .form-check-label { display: grid; gap: .18rem; line-height: 1.25; }
.cashbox-equal-option .form-check-label strong { color: var(--theme-text-deep); font-size: .82rem; }
.cashbox-equal-option .form-check-label span { color: var(--theme-text-muted-cool); font-size: .7rem; }

.cashbox-product-editor-content .form-control,
.cashbox-product-editor-content .form-select,
.cashbox-product-editor-content .input-group-text,
.cashbox-payment-modal .form-control,
.cashbox-payment-modal .form-select,
.cashbox-entity-dialog .form-control,
.cashbox-entity-dialog .form-select {
    min-height: 42px;
    border-color: var(--theme-border-strong);
    border-radius: .65rem;
}
.cashbox-product-editor-content textarea.form-control,
.cashbox-payment-modal textarea.form-control,
.cashbox-entity-dialog textarea.form-control { min-height: 86px; }
.cashbox-product-editor-content .form-label,
.cashbox-payment-modal .form-label,
.cashbox-entity-dialog .form-label { min-height: 18px; margin-bottom: .35rem; font-size: .75rem; color: var(--theme-text-secondary); }
.cashbox-product-editor-content .row > [class*="col-"],
.cashbox-payment-modal .row > [class*="col-"] { display: flex; flex-direction: column; }
.cashbox-product-editor-content .row > [class*="col-"] > .form-control,
.cashbox-product-editor-content .row > [class*="col-"] > .form-select,
.cashbox-payment-modal .row > [class*="col-"] > .form-control,
.cashbox-payment-modal .row > [class*="col-"] > .form-select { width: 100%; }

@media (max-width: 1199.98px) {
    .cashbox-report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .cashbox-sale-search-row .cashbox-product-view-toggle { min-width: 0; flex: 1 1 auto; }
    .cashbox-products-grid.is-list-view .cashbox-product-tile { grid-template-columns: 1fr auto; }
    .cashbox-products-grid.is-list-view .cashbox-product-tile .tile-meta { grid-column: 1 / -1; white-space: normal; }
    .cashbox-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cashbox-report-card { padding: .75rem; }
    .cashbox-stock-toolbar { align-items: stretch; flex-direction: column; }
    .cashbox-stock-toolbar .cashbox-stock-filters { flex-direction: column; }
    .cashbox-stock-toolbar .form-control,
    .cashbox-stock-toolbar .form-select { max-width: none; }
}

/* Полноэкранный редактор позиции: единая сетка, опции и контекстные подсказки */
#catalogProductModal .modal-dialog {
    width: 100vw;
    max-width: none;
    height: 100vh;
    margin: 0;
}
#catalogProductModal .modal-content {
    height: 100vh;
    border-radius: 0;
}
#catalogProductModal .cashbox-product-editor-header,
#catalogProductModal .modal-footer {
    flex: 0 0 auto;
    padding: .85rem 1.25rem;
}
#catalogProductModal .cashbox-product-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
#catalogProductModal .cashbox-product-editor-heading {
    min-width: 0;
    display: grid;
    gap: .18rem;
}
#catalogProductModal .cashbox-product-editor-heading .small {
    line-height: 1.35;
}
#catalogProductModal .cashbox-product-editor-header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex: 0 0 auto;
}
#catalogProductModal .modal-body {
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.25rem 1.35rem;
    background: var(--theme-surface-cool);
}
#catalogProductModal #catalogProductForm {
    width: min(1600px, 100%);
    margin: 0 auto;
}
#catalogProductModal .cashbox-catalog-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
    gap: 1.25rem;
    align-items: start;
}
#catalogProductModal.is-help-hidden .cashbox-catalog-form-grid {
    grid-template-columns: minmax(0, 1fr);
}
#catalogProductModal.is-help-hidden .cashbox-catalog-form-side {
    display: none;
}
#catalogProductModal .cashbox-catalog-form-main {
    min-width: 0;
    display: grid;
    gap: 1rem;
}
#catalogProductModal .cashbox-catalog-form-main > .row,
#catalogProductModal .cashbox-catalog-form-main > .cashbox-catalog-form-section {
    margin-top: 0 !important;
}
#catalogProductModal .cashbox-catalog-form-section,
#catalogProductModal .cashbox-catalog-side-box {
    min-width: 0;
    border: 1px solid var(--theme-border-strong);
    border-radius: .8rem;
    background: var(--theme-surface);
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .025);
}
#catalogProductModal .cashbox-form-section-title {
    margin: 0 0 .8rem;
    line-height: 1.25;
}
#catalogProductModal .cashbox-catalog-form-section .row,
#catalogProductModal .cashbox-product-primary-grid {
    align-items: stretch;
}
#catalogProductModal .cashbox-catalog-form-section .row > [class*="col-"],
#catalogProductModal .cashbox-product-primary-grid > [class*="col-"] {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
#catalogProductModal .form-label {
    min-height: 1.15rem;
    margin-bottom: .38rem;
    color: var(--theme-text-secondary);
    font-size: .75rem;
    line-height: 1.2;
}
#catalogProductModal .form-control,
#catalogProductModal .form-select,
#catalogProductModal .input-group-text {
    width: 100%;
    min-height: 42px;
    border-color: var(--theme-border-strong);
    border-radius: .65rem;
}
#catalogProductModal textarea.form-control {
    min-height: 92px;
    resize: vertical;
}
#catalogProductModal .form-text,
#catalogProductModal .cashbox-field-note {
    margin-top: .42rem;
    padding: 0 .05rem;
    color: var(--theme-text-muted-cool);
    font-size: .71rem;
    line-height: 1.4;
}
#catalogProductModal .cashbox-product-option {
    position: relative;
    flex: 1 1 auto;
    min-height: 88px;
    margin: 0;
    padding: .82rem .9rem;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    column-gap: .7rem;
    border: 1px solid var(--theme-border-strong);
    border-radius: .8rem;
    background: var(--theme-surface);
}
#catalogProductModal .cashbox-product-option-compact {
    min-height: 74px;
}
#catalogProductModal .cashbox-product-option .form-check-input {
    position: static;
    float: none;
    width: 1rem;
    height: 1rem;
    margin: .12rem 0 0;
}
#catalogProductModal .cashbox-product-option .form-check-label {
    min-width: 0;
    display: grid;
    gap: .22rem;
    line-height: 1.3;
    cursor: pointer;
}
#catalogProductModal .cashbox-product-option .form-check-label strong {
    color: var(--theme-text-deep);
    font-size: .82rem;
    font-weight: 650;
}
#catalogProductModal .cashbox-product-option .form-check-label span {
    color: var(--theme-text-muted-cool);
    font-size: .71rem;
}
#catalogProductModal .cashbox-inline-note {
    min-height: 42px;
    height: 100%;
    padding: .72rem .82rem;
    display: flex;
    align-items: center;
    border: 1px solid var(--theme-border-strong);
    border-radius: .65rem;
    background: var(--theme-surface-cool);
    color: var(--theme-text-muted-cool);
    font-size: .74rem;
    line-height: 1.4;
}
#catalogProductModal .cashbox-inline-actions {
    margin-top: .55rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
}
#catalogProductModal .cashbox-inline-actions .btn-link {
    padding-left: .35rem;
    padding-right: .35rem;
    text-decoration: none;
}
#catalogProductModal .cashbox-product-description-section {
    display: grid;
}
#catalogProductModal .cashbox-catalog-form-side {
    min-width: 0;
    position: sticky;
    top: 0;
    display: grid;
    align-content: start;
    gap: .85rem;
}
#catalogProductModal .cashbox-context-help-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .55rem;
}
#catalogProductModal .cashbox-context-help-head .cashbox-form-section-title {
    margin-bottom: 0;
}
#catalogProductModal .cashbox-context-help-badge {
    flex: 0 0 auto;
    padding: .22rem .48rem;
    border: 1px solid var(--theme-border-strong);
    border-radius: 999px;
    background: var(--theme-surface-cool);
    color: var(--theme-text-secondary);
    font-size: .66rem;
    font-weight: 650;
}
#catalogProductModal .cashbox-context-help-box #catalogProductHelp {
    line-height: 1.45;
}
#catalogProductModal .cashbox-context-help-list {
    margin: .75rem 0 0;
    padding: .7rem 0 0 1.05rem;
    border-top: 1px solid #edf2f7;
    color: var(--theme-text-muted-cool);
    font-size: .72rem;
    line-height: 1.42;
}
#catalogProductModal .cashbox-context-help-list:empty {
    display: none;
}
#catalogProductModal .cashbox-context-help-list li + li,
#catalogProductModal .cashbox-product-flow-help li + li {
    margin-top: .32rem;
}
#catalogProductModal .cashbox-product-flow-help ol {
    padding-left: 1.15rem;
}
#catalogProductModal .cashbox-blank-preview-batches {
    max-height: 260px;
    overflow: auto;
    padding-right: .2rem;
}
#catalogProductModal .cashbox-blank-preview-name {
    margin-bottom: .45rem;
    color: var(--theme-text-deep);
    font-weight: 650;
}
#catalogProductModal .modal-footer {
    gap: .5rem;
}

.cashbox-checkout-grid-blank-source {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cashbox-checkout-batch-toggle {
    min-height: 64px;
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    border: 1px solid var(--theme-border-strong);
    border-radius: .75rem;
    padding: .75rem .8rem;
    background: var(--theme-surface);
    cursor: pointer;
}
.cashbox-checkout-batch-toggle .form-check-input {
    flex: 0 0 auto;
    margin: .15rem 0 0;
}
.cashbox-checkout-batch-toggle > span {
    display: grid;
    gap: .16rem;
}
.cashbox-checkout-batch-toggle strong {
    color: var(--theme-text-deep);
    font-size: .82rem;
}
.cashbox-checkout-batch-toggle small {
    color: var(--theme-text-muted-cool);
    line-height: 1.35;
}
.cashbox-checkout-blank-source {
    border-color: var(--theme-border-strong);
    background: var(--theme-surface-cool);
}

.cashbox-connection-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.cashbox-pos-connection {
    border: 0;
    padding: 0;
    cursor: pointer;
}
.cashbox-pos-connection.is-slow {
    background: var(--theme-warning-soft);
    color: #b56a00;
}
.cashbox-connection-info {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    z-index: 1085;
    width: 250px;
    display: grid;
    gap: .5rem;
    padding: .8rem;
    border: 1px solid var(--theme-border-strong);
    border-radius: .8rem;
    background: var(--theme-surface);
    box-shadow: 0 14px 38px rgba(15, 23, 42, .18);
    color: var(--theme-text-mid);
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
.cashbox-connection-info::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 100%;
    border: 7px solid transparent;
    border-top-color: #fff;
}
.cashbox-connection-wrap:hover .cashbox-connection-info,
.cashbox-connection-wrap:focus-within .cashbox-connection-info {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.cashbox-connection-info > strong {
    color: var(--theme-text-deep);
    font-size: .8rem;
}
.cashbox-connection-info > span {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: .55rem;
}
.cashbox-connection-info b {
    color: var(--theme-text-deep);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}
.cashbox-connection-info small,
.cashbox-connection-info time {
    color: var(--theme-text-muted-cool);
    font-size: .68rem;
    line-height: 1.3;
}

.cashbox-product-view-toggle {
    min-width: 94px;
    min-height: 36px;
    padding: .35rem .65rem;
    gap: .32rem;
    font-size: .82rem;
}
.cashbox-product-view-toggle svg {
    width: 14px;
    height: 14px;
}
.cashbox-product-tile {
    justify-content: center;
}
.cashbox-product-tile .tile-name {
    display: flex;
    align-items: center;
    min-height: 2.35em;
}
.cashbox-product-tile .tile-meta {
    line-height: 1.35;
}
.cashbox-products-grid.is-list-view .cashbox-product-tile {
    grid-template-columns: minmax(180px, 1.4fr) minmax(260px, 2fr) minmax(110px, auto);
    min-height: 56px;
    padding: .55rem .75rem;
}
.cashbox-products-grid.is-list-view .cashbox-product-tile .tile-name {
    min-height: 0;
    align-self: center;
}
.cashbox-products-grid.is-list-view .cashbox-product-tile .tile-meta,
.cashbox-products-grid.is-list-view .cashbox-product-tile > strong {
    align-self: center;
}

@media (max-width: 991.98px) {
    #catalogProductModal .cashbox-catalog-form-grid {
        grid-template-columns: 1fr;
    }
    #catalogProductModal .cashbox-catalog-form-side {
        position: static;
    }
    .cashbox-checkout-grid-blank-source {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 767.98px) {
    #catalogProductModal .modal-header,
    #catalogProductModal .modal-footer,
    #catalogProductModal .modal-body {
        padding-left: .75rem;
        padding-right: .75rem;
    }
    #catalogProductModal .cashbox-product-editor-header {
        align-items: flex-start;
        gap: .65rem;
    }
    #catalogProductModal .cashbox-product-editor-heading .small {
        display: none;
    }
    #catalogProductModal .cashbox-product-editor-header-actions {
        gap: .5rem;
    }
    #catalogProductModal #catalogProductHelpToggle {
        padding: .3rem .5rem;
        font-size: .69rem;
        white-space: nowrap;
    }
    #catalogProductModal .cashbox-catalog-form-section,
    #catalogProductModal .cashbox-catalog-side-box {
        padding: .85rem;
    }
    #catalogProductModal .modal-footer {
        flex-wrap: wrap;
    }
    .cashbox-products-grid.is-list-view .cashbox-product-tile {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

/* v20: единая касса, склад и всплывающий статус соединения */
body > .cashbox-connection-info {
    position: fixed;
    right: auto;
    top: auto;
    z-index: 5000;
    max-width: calc(100vw - 16px);
    transform: translateY(5px);
}
body > .cashbox-connection-info.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
body > .cashbox-connection-info::after {
    display: none;
}
.cashbox-stock-product-help {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .45rem 1rem;
    margin-top: .45rem;
    color: var(--theme-text-muted-cool);
    font-size: .78rem;
}
.cashbox-stock-product-help .btn-link {
    text-decoration: none;
    font-weight: 600;
}
[data-catalog-existing-stock-wrap] {
    padding-bottom: .15rem;
}
#catalogExistingStockProduct {
    min-height: 42px;
}
.cashbox-stock-shell .cashbox-catalog-head > .d-flex {
    justify-content: flex-end;
}
@media (max-width: 575.98px) {
    .cashbox-stock-shell .cashbox-catalog-head > .d-flex,
    .cashbox-stock-shell .cashbox-catalog-head > .d-flex .btn {
        width: 100%;
    }
}

/* Ручное списание партий */
.cashbox-blank-batch-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .4rem;
    white-space: nowrap;
}
@media (max-width: 767.98px) {
    .cashbox-blank-batch-actions {
        grid-column: 1 / -1;
        width: 100%;
    }
    .cashbox-blank-batch-actions .btn {
        flex: 1 1 0;
        width: auto;
    }
}

/* ==========================================================================
   Страница авторизации
   ========================================================================== */
html[data-theme] body.login-page{background:var(--theme-page-panel)}
body.login-page .login-card{border:1px solid var(--theme-border);border-radius:1rem;box-shadow:0 .5rem 1.25rem rgba(15,23,42,.06);overflow:hidden}
body.login-page .login-header{background:var(--theme-surface);border-bottom:1px solid var(--theme-border);padding:1.25rem}
body.login-page .login-body{padding:1.25rem;background:var(--theme-surface)}
body.login-page .form-label{font-size:.78rem;font-weight:600;color:var(--theme-text-secondary)}

/* ==========================================================================
   Быстрый переключатель темы
   ========================================================================== */
.app-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    min-height: 34px;
    padding: .36rem .65rem;
    color: var(--theme-text-secondary);
    background: var(--theme-surface-soft);
    border: 1px solid var(--theme-border);
    border-radius: .65rem;
    white-space: nowrap;
}
.app-theme-toggle:hover,
.app-theme-toggle:focus-visible {
    color: var(--theme-text);
    background: var(--theme-surface-hover);
    border-color: var(--theme-border-strong);
}
.app-theme-toggle:focus-visible {
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--theme-accent) 22%, transparent);
}
.app-theme-toggle:disabled {
    opacity: .7;
    cursor: wait;
}
.app-theme-toggle.is-save-error {
    border-color: #f57878;
    color: #f57878;
}
.app-theme-toggle-icon {
    display: inline-flex;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}
.app-theme-toggle-icon svg {
    width: 100%;
    height: 100%;
}
.app-theme-toggle-icon-sun { display: none; }
html[data-theme="dark"] .app-theme-toggle-icon-moon { display: none; }
html[data-theme="dark"] .app-theme-toggle-icon-sun { display: inline-flex; }
.app-theme-toggle-label {
    font-size: .8rem;
    font-weight: 600;
}

/* ==========================================================================
   Ночная тема в палитре Telegram Desktop
   ========================================================================== */
html[data-theme="dark"] {
    color-scheme: dark;
    --theme-page-bg: #181b1f;
    --theme-page-panel: #222528;
    --theme-surface: #282e33;
    --theme-surface-soft: #313b43;
    --theme-surface-cool: #2d343a;
    --theme-surface-subtle: #2b3238;
    --theme-surface-muted: #30373d;
    --theme-surface-raised: #262c31;
    --theme-surface-hover: #313b43;
    --theme-border: #42484d;
    --theme-border-strong: #4c535b;
    --theme-border-soft: #343b41;
    --theme-text: #f5f5f5;
    --theme-text-strong: #f5f5f5;
    --theme-text-deep: #e9ecf0;
    --theme-text-secondary: #e9ecf0;
    --theme-text-mid: #cbd1d6;
    --theme-text-muted: #82868a;
    --theme-text-muted-cool: #8d939e;
    --theme-text-muted-soft: #8d939e;
    --theme-accent: #2da192;
    --theme-accent-hover: #32a896;
    --theme-accent-ripple: #42b8a6;
    --theme-accent-text: #ffffff;
    --theme-danger-soft: #4a2d30;
    --theme-warning-soft: #463a28;
    --theme-success-soft: #203b36;
    --theme-info-soft: #263740;
    --theme-positive: #55e6a5;
    --theme-writeoff: #63e6a7;
    --theme-negative: #ff6b78;
    --theme-lock-overlay: rgba(40, 46, 51, .92);
    --theme-shadow: 0 .55rem 1.4rem rgba(0, 0, 0, .28);

    --bs-body-bg: var(--theme-page-bg);
    --bs-body-color: var(--theme-text);
    --bs-emphasis-color: var(--theme-text);
    --bs-secondary-color: var(--theme-text-muted-cool);
    --bs-tertiary-color: var(--theme-text-muted);
    --bs-secondary-bg: var(--theme-surface-soft);
    --bs-tertiary-bg: var(--theme-surface-cool);
    --bs-border-color: var(--theme-border);
    --bs-border-color-translucent: rgba(255, 255, 255, .1);
    --bs-link-color: #79e8d9;
    --bs-link-hover-color: #8ee4d9;
    --bs-focus-ring-color: rgba(63, 193, 176, .28);
}

html[data-theme="dark"] body {
    background: var(--theme-page-bg);
    color: var(--theme-text);
}
html[data-theme="dark"] .app-navbar {
    background: rgba(32, 38, 43, .98);
    border-bottom-color: var(--theme-border);
    box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .26);
}
html[data-theme="dark"] .app-navbar .navbar-brand,
html[data-theme="dark"] .app-navbar .nav-link,
html[data-theme="dark"] .app-user-box .text-body,
html[data-theme="dark"] .text-body {
    color: var(--theme-text) !important;
}
html[data-theme="dark"] .app-navbar .nav-link:hover,
html[data-theme="dark"] .app-navbar .nav-link:focus,
html[data-theme="dark"] .app-navbar .nav-link.show,
html[data-theme="dark"] .app-navbar .dropdown-item:hover,
html[data-theme="dark"] .app-navbar .dropdown-item:focus {
    color: var(--theme-text);
    background: var(--theme-surface-soft);
}
html[data-theme="dark"] .app-navbar .dropdown-menu,
html[data-theme="dark"] .dropdown-menu {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    box-shadow: var(--theme-shadow);
}
html[data-theme="dark"] .dropdown-item {
    color: var(--theme-text-secondary);
}
html[data-theme="dark"] .dropdown-divider {
    border-color: var(--theme-border);
}
html[data-theme="dark"] .navbar-toggler {
    border-color: var(--theme-border-strong);
}

html[data-theme="dark"] .office-page,
html[data-theme="dark"] .orders-page,
html[data-theme="dark"] .order-form-page,
html[data-theme="dark"] .mvd-page {
    --office-border: var(--theme-border);
    --office-muted: var(--theme-text-muted-cool);
    --office-shadow: var(--theme-shadow);
    --of-border: var(--theme-border);
    --of-muted: var(--theme-text-muted-cool);
    --of-soft: var(--theme-surface-soft);
    --of-shadow: var(--theme-shadow);
    --orders-border: var(--theme-border);
    --orders-muted: var(--theme-text-muted-cool);
    --orders-card-shadow: var(--theme-shadow);
    --mvd-border: var(--theme-border);
    --mvd-muted: var(--theme-text-muted-cool);
    --mvd-card-shadow: var(--theme-shadow);
}
html[data-theme="dark"] .cashbox-pos-page,
html[data-theme="dark"] .cashbox-page {
    --pos-border: var(--theme-border-strong);
    --pos-muted: var(--theme-text-muted-cool);
    --pos-dark: var(--theme-text-strong);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .app-card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .toast {
    background-color: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .accordion-button {
    background-color: var(--theme-surface-soft);
    color: var(--theme-text);
    border-color: var(--theme-border);
}
html[data-theme="dark"] .modal-backdrop.show {
    opacity: .72;
}
html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"] {
    background-color: #22282d;
    color: var(--theme-text);
    border-color: var(--theme-border-strong);
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    background-color: #22282d;
    color: var(--theme-text);
    border-color: #3ee2c9;
    box-shadow: 0 0 0 .2rem rgba(63, 193, 176, .18);
}
html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #818991;
    opacity: 1;
}
html[data-theme="dark"] .form-check-input {
    background-color: #22282d;
    border-color: #6c6c6c;
}
html[data-theme="dark"] .form-check-input:checked {
    background-color: var(--theme-accent);
    border-color: var(--theme-accent);
}
html[data-theme="dark"] .form-switch .form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(63, 193, 176, .18);
}

html[data-theme="dark"] .btn-dark {
    --bs-btn-color: #ffffff;
    --bs-btn-bg: var(--theme-accent);
    --bs-btn-border-color: var(--theme-accent);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: var(--theme-accent-hover);
    --bs-btn-hover-border-color: var(--theme-accent-hover);
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: var(--theme-accent-ripple);
    --bs-btn-active-border-color: var(--theme-accent-ripple);
    --bs-btn-disabled-color: #ffffff;
    --bs-btn-disabled-bg: #40655f;
    --bs-btn-disabled-border-color: #40655f;
}
html[data-theme="dark"] .btn-outline-dark {
    --bs-btn-color: #79e8d9;
    --bs-btn-border-color: #29baa7;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: var(--theme-accent);
    --bs-btn-hover-border-color: var(--theme-accent);
}
html[data-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: var(--theme-text-secondary);
    --bs-btn-border-color: var(--theme-border-strong);
    --bs-btn-hover-color: var(--theme-text);
    --bs-btn-hover-bg: var(--theme-surface-soft);
    --bs-btn-hover-border-color: #5b646d;
}
html[data-theme="dark"] .btn-light {
    --bs-btn-color: var(--theme-text);
    --bs-btn-bg: var(--theme-surface-soft);
    --bs-btn-border-color: var(--theme-border);
    --bs-btn-hover-color: var(--theme-text);
    --bs-btn-hover-bg: #3c474f;
    --bs-btn-hover-border-color: #4c535b;
}

html[data-theme="dark"] .table {
    --bs-table-color: var(--theme-text-secondary);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--theme-border-soft);
    --bs-table-striped-bg: rgba(255, 255, 255, .025);
    --bs-table-hover-bg: rgba(63, 193, 176, .08);
    --bs-table-hover-color: var(--theme-text);
}
html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .cashbox-stock-table thead th {
    background: var(--theme-surface-soft);
    color: var(--theme-text-muted-cool);
    border-color: var(--theme-border);
}
html[data-theme="dark"] .table tbody td,
html[data-theme="dark"] .table tbody th {
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] .bg-light {
    background-color: var(--theme-surface-soft) !important;
}
html[data-theme="dark"] .bg-white {
    background-color: var(--theme-surface) !important;
}
html[data-theme="dark"] .text-muted {
    color: var(--theme-text-muted-cool) !important;
}
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] .border-end {
    border-color: var(--theme-border) !important;
}
html[data-theme="dark"] hr {
    border-color: var(--theme-border);
    opacity: 1;
}
html[data-theme="dark"] code {
    color: #8ee4d9;
}

html[data-theme="dark"] .status-new,
html[data-theme="dark"] .orders-page .status-new {
    background: #263740;
    color: #8ee4d9;
    border-color: #3d5961;
}
html[data-theme="dark"] .status-production,
html[data-theme="dark"] .orders-page .status-production {
    background: #463a28;
    color: #f2c47d;
    border-color: #66583c;
}
html[data-theme="dark"] .status-ready,
html[data-theme="dark"] .orders-page .status-ready {
    background: #203b36;
    color: #70dfcf;
    border-color: #31564f;
}
html[data-theme="dark"] .status-issued,
html[data-theme="dark"] .orders-page .status-issued {
    background: var(--theme-surface-soft);
    color: var(--theme-text-secondary);
    border-color: var(--theme-border-strong);
}

html[data-theme="dark"] .cashbox-pos-bottom-bar,
html[data-theme="dark"] .cashbox-pos-menu-panel,
html[data-theme="dark"] .cashbox-spa-sidebar,
html[data-theme="dark"] .cashbox-payment-side,
html[data-theme="dark"] .cashbox-checkout-modal-body,
html[data-theme="dark"] .cashbox-product-editor-content .modal-body {
    background-color: var(--theme-page-panel);
    border-color: var(--theme-border);
}
html[data-theme="dark"] .cashbox-menu-item:hover,
html[data-theme="dark"] .cashbox-menu-item.is-active,
html[data-theme="dark"] .cashbox-category-row:hover,
html[data-theme="dark"] .cashbox-category-row.is-active,
html[data-theme="dark"] .cashbox-product-tile:hover,
html[data-theme="dark"] .cashbox-product-tile.is-selected,
html[data-theme="dark"] .cashbox-blank-kind-head:hover {
    background-color: var(--theme-surface-soft);
}
html[data-theme="dark"] .cashbox-payment-method-btn.is-active,
html[data-theme="dark"] .cashbox-product-view-toggle.is-active,
html[data-theme="dark"] .cashbox-filter-switch.is-active {
    background-color: var(--theme-accent);
    color: #ffffff;
    border-color: var(--theme-accent);
}
html[data-theme="dark"] .cashbox-connection-info {
    background: var(--theme-surface);
    color: var(--theme-text-secondary);
    border-color: var(--theme-border-strong);
    box-shadow: var(--theme-shadow);
}

@media (max-width: 991.98px) {
    .app-theme-toggle {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ==========================================================================
   Полировка ночной темы и нижнего переключателя
   ========================================================================== */
.cashbox-pos-bottom-bar {
    grid-template-columns: repeat(5, minmax(72px, auto)) minmax(130px, 1fr);
}

.cashbox-bottom-theme-toggle .app-theme-toggle-icon {
    width: 19px;
    height: 19px;
}

.cashbox-bottom-theme-toggle .app-theme-toggle-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
}

.cashbox-receipt-remove-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dc3545;
    border-radius: 10px;
    background: transparent;
    color: #dc3545;
    line-height: 1;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
}

.cashbox-receipt-remove-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.cashbox-receipt-remove-btn:hover {
    background: var(--theme-danger-soft);
    border-color: #ef5a67;
    color: #ef3348;
}

.cashbox-receipt-remove-btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .2);
}

.cashbox-operation-amount.is-positive { color: var(--theme-positive); }
.cashbox-operation-amount.is-writeoff { color: var(--theme-writeoff); }
.cashbox-operation-amount.is-negative { color: var(--theme-negative); }

html[data-theme="dark"] .cashbox-form-section-title,
html[data-theme="dark"] #catalogProductModal .cashbox-form-section-title,
html[data-theme="dark"] .cashbox-context-help-badge,
html[data-theme="dark"] .alert-light,
html[data-theme="dark"] .list-group-item-light,
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .cashbox-block-lock {
    background: var(--theme-surface-soft) !important;
    color: var(--theme-text-strong) !important;
    border-color: var(--theme-border-strong) !important;
}

html[data-theme="dark"] .cashbox-catalog-folder:hover,
html[data-theme="dark"] .cashbox-blank-summary-row:hover,
html[data-theme="dark"] .cashbox-catalog-product-row.is-disabled,
html[data-theme="dark"] .cashbox-blank-summary-row.is-empty,
html[data-theme="dark"] .cashbox-blank-batch-row.is-depleted,
html[data-theme="dark"] .cashbox-checkout-souvenir,
html[data-theme="dark"] .cashbox-checkout-blank-source {
    background: var(--theme-surface-hover) !important;
    color: var(--theme-text-secondary);
    border-color: var(--theme-border-strong) !important;
}

html[data-theme="dark"] .cashbox-catalog-folder.is-active,
html[data-theme="dark"] .cashbox-catalog-folder.is-active:hover {
    background: #111827 !important;
    color: #ffffff !important;
    border-color: #24344b !important;
}

html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .cashbox-product-editor-content .cashbox-catalog-form-section,
html[data-theme="dark"] .cashbox-product-editor-content .cashbox-catalog-side-box,
html[data-theme="dark"] .cashbox-receipt-card,
html[data-theme="dark"] .cashbox-document-item {
    box-shadow: 0 .55rem 1.4rem rgba(0, 0, 0, .24) !important;
}

html[data-theme="dark"] .cashbox-product-tile:hover,
html[data-theme="dark"] .cashbox-refund-sale-item.is-active,
html[data-theme="dark"] .cashbox-shift-mini-item:hover,
html[data-theme="dark"] .cashbox-menu-item:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
}

html[data-theme="dark"] .btn:focus-visible,
html[data-theme="dark"] .cashbox-bottom-action:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(66, 184, 166, .24);
}

html[data-theme="dark"] .text-success {
    color: var(--theme-positive) !important;
}

html[data-theme="dark"] .text-danger {
    color: var(--theme-negative) !important;
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .badge.bg-light.text-dark {
    color: var(--theme-text-strong) !important;
}

html[data-theme="dark"] .cashbox-document-price,
html[data-theme="dark"] .cashbox-operation-amount.is-positive {
    color: var(--theme-positive);
}

html[data-theme="dark"] .cashbox-document-price.is-writeoff,
html[data-theme="dark"] .cashbox-operation-amount.is-writeoff {
    color: var(--theme-writeoff);
}

html[data-theme="dark"] .cashbox-document-price.is-negative,
html[data-theme="dark"] .cashbox-operation-amount.is-negative {
    color: var(--theme-negative);
}

@media (max-width: 767.98px) {
    .cashbox-pos-bottom-bar {
        grid-template-columns: repeat(5, minmax(56px, 1fr));
    }

    .cashbox-bottom-theme-toggle [data-theme-label] {
        max-width: 58px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}


/* ========================================================================== 
   Удаление ошибочной продажи в журнале открытой смены
   ========================================================================== */
.cashbox-delete-sale-btn {
    margin-top: .55rem;
    white-space: nowrap;
    border-radius: .65rem;
}

.cashbox-delete-sale-warning {
    padding: 1rem 1.1rem;
    border: 1px solid var(--theme-border);
    border-radius: .85rem;
    background: var(--theme-surface-soft);
    color: var(--theme-text-secondary);
    line-height: 1.55;
}

.cashbox-delete-sale-warning strong {
    color: var(--theme-text-strong);
}

html[data-theme="dark"] .cashbox-delete-sale-warning {
    border-color: var(--theme-border-strong);
    background: var(--theme-surface-soft);
}

@media (max-width: 575.98px) {
    .cashbox-delete-sale-btn {
        width: 100%;
    }
}

/* QR-комиссия: компактное отображение без изменения основной кассовой сетки. */
.cashbox-payment-method-note {
    color: currentColor;
    font-size: 10px;
    font-weight: 650;
    line-height: 1;
    opacity: .68;
}

.cashbox-qr-commission-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px 12px;
    margin-top: 8px;
    padding: 9px 12px;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-surface-muted);
}

.cashbox-qr-commission-summary > span,
.cashbox-qr-commission-summary > small {
    color: var(--theme-text-muted-soft);
    font-size: 11px;
}

.cashbox-qr-commission-summary > strong {
    color: var(--theme-negative);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.cashbox-qr-commission-summary > small {
    grid-column: 1 / -1;
}

.cashbox-document-payment-fee {
    color: var(--theme-negative);
    font-size: 10px;
    font-weight: 700;
}

.cashbox-shift-summary-values small,
.cashbox-report-line span > small {
    display: block;
    margin-top: 3px;
    color: var(--theme-text-muted-soft);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.25;
}

/* Professional cashbox report */
.cashbox-report-pro {
    overflow: hidden;
    border: 1px solid var(--theme-border);
    background: var(--theme-surface-raised);
}

.cashbox-report-pro-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--theme-border);
    background: linear-gradient(135deg, var(--theme-surface-raised), var(--theme-surface-subtle));
}

.cashbox-report-pro-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.cashbox-report-pro-icon {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 14px;
    background: var(--theme-surface-cool);
    color: var(--theme-text-strong);
}

.cashbox-report-pro-icon svg,
.cashbox-report-head-actions svg,
.cashbox-report-apply svg,
.cashbox-report-table-search svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.cashbox-report-eyebrow,
.cashbox-report-panel-kicker {
    color: var(--theme-text-muted-soft);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cashbox-report-pro-heading h2 {
    margin: 1px 0 4px;
    color: var(--theme-text-strong);
    font-size: 22px;
    font-weight: 720;
}

.cashbox-report-context-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--theme-text-muted-cool);
    font-size: 12px;
}

.cashbox-report-context-line i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: .55;
}

.cashbox-report-head-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border-radius: 10px;
}

.cashbox-report-head-actions b {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--theme-text-strong);
    color: var(--theme-surface-raised);
    font-size: 10px;
}

.cashbox-report-command-center {
    padding: 16px 24px 18px;
    border-bottom: 1px solid var(--theme-border);
    background: var(--theme-surface-soft);
}

.cashbox-report-period-presets {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.cashbox-report-period-presets button {
    padding: 6px 11px;
    border: 1px solid var(--theme-border);
    border-radius: 999px;
    background: var(--theme-surface-raised);
    color: var(--theme-text-muted-cool);
    font-size: 11px;
    font-weight: 650;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.cashbox-report-period-presets button:hover,
.cashbox-report-period-presets button.is-active {
    border-color: var(--theme-border-strong);
    background: var(--theme-surface-cool);
    color: var(--theme-text-strong);
}

.cashbox-report-primary-controls {
    display: grid;
    grid-template-columns: minmax(360px, 1.5fr) minmax(230px, .8fr) auto;
    align-items: end;
    gap: 12px;
}

.cashbox-report-control {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.cashbox-report-control > span,
.cashbox-report-filter-grid label > span {
    color: var(--theme-text-muted-cool);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.cashbox-report-control .form-control,
.cashbox-report-control .form-select,
.cashbox-report-filter-grid .form-select {
    min-height: 42px;
    border-radius: 10px;
    font-size: 13px;
}

.cashbox-report-date-pair {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}

.cashbox-report-date-pair i {
    color: var(--theme-text-muted-soft);
    font-style: normal;
}

.cashbox-report-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding-inline: 18px;
    border-radius: 10px;
    white-space: nowrap;
}

.cashbox-report-advanced {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--theme-surface-raised);
}

.cashbox-report-advanced[hidden] {
    display: none !important;
}

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

.cashbox-report-advanced-head > div {
    display: grid;
    gap: 2px;
}

.cashbox-report-advanced-head strong {
    color: var(--theme-text-strong);
    font-size: 13px;
}

.cashbox-report-advanced-head small {
    color: var(--theme-text-muted-soft);
    font-size: 11px;
}

.cashbox-report-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.cashbox-report-filter-grid label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.cashbox-report-options-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.cashbox-report-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--theme-border);
    border-radius: 11px;
    background: var(--theme-surface-subtle);
    cursor: pointer;
}

.cashbox-report-option input {
    margin-top: 3px;
}

.cashbox-report-option span {
    display: grid;
    gap: 2px;
}

.cashbox-report-option strong {
    color: var(--theme-text-strong);
    font-size: 12px;
}

.cashbox-report-option small {
    color: var(--theme-text-muted-soft);
    font-size: 10px;
    line-height: 1.3;
}

.cashbox-report-body {
    display: grid;
    gap: 16px;
    padding: 20px 24px 24px;
}

.cashbox-report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.cashbox-report-kpi {
    position: relative;
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 16px 17px;
    overflow: hidden;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--theme-surface-raised);
}

.cashbox-report-kpi::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    content: '';
    background: var(--theme-text-muted-soft);
}

.cashbox-report-kpi.is-net::before,
.cashbox-report-kpi.is-profit::before {
    background: #45a87d;
}

.cashbox-report-kpi.is-average::before {
    background: #6f83b7;
}

.cashbox-report-kpi-head {
    display: grid;
    gap: 2px;
}

.cashbox-report-kpi-head span {
    color: var(--theme-text-strong);
    font-size: 12px;
    font-weight: 700;
}

.cashbox-report-kpi-head i {
    color: var(--theme-text-muted-soft);
    font-size: 10px;
    font-style: normal;
}

.cashbox-report-kpi > strong {
    overflow: hidden;
    color: var(--theme-text-deep);
    font-size: clamp(20px, 2vw, 28px);
    font-weight: 740;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cashbox-report-kpi-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 18px;
}

.cashbox-report-kpi-foot small {
    color: var(--theme-text-muted-soft);
    font-size: 9px;
}

.cashbox-report-delta {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 750;
}

.cashbox-report-delta.is-up {
    background: rgba(45, 157, 112, .12);
    color: #23805c;
}

.cashbox-report-delta.is-down {
    background: rgba(201, 65, 65, .10);
    color: #b44343;
}

.cashbox-report-delta.is-neutral {
    background: var(--theme-surface-subtle);
    color: var(--theme-text-muted-soft);
}

.cashbox-report-stat-strip {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--theme-surface-subtle);
}

.cashbox-report-stat-strip > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 11px 12px;
    border-left: 1px solid var(--theme-border);
}

.cashbox-report-stat-strip > div:first-child {
    border-left: 0;
}

.cashbox-report-stat-strip span {
    color: var(--theme-text-muted-soft);
    font-size: 9px;
    text-transform: uppercase;
}

.cashbox-report-stat-strip strong {
    overflow: hidden;
    color: var(--theme-text-strong);
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cashbox-report-analysis-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.25fr) minmax(260px, .75fr);
    gap: 16px;
}

.cashbox-report-panel {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--theme-surface-raised);
}

.cashbox-report-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.cashbox-report-panel-head h3 {
    margin: 2px 0 0;
    color: var(--theme-text-strong);
    font-size: 15px;
    font-weight: 720;
}

.cashbox-report-insights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cashbox-report-insights article {
    display: grid;
    align-content: center;
    gap: 4px;
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--theme-border);
    border-radius: 13px;
    background: var(--theme-surface-subtle);
}

.cashbox-report-insights span {
    color: var(--theme-text-muted-soft);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.cashbox-report-insights strong {
    overflow: hidden;
    color: var(--theme-text-strong);
    font-size: 14px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cashbox-report-insights small {
    color: var(--theme-text-muted-cool);
    font-size: 9px;
    line-height: 1.35;
}

.cashbox-report-secondary-grid {
    display: grid;
    grid-template-columns: minmax(250px, .72fr) minmax(0, 2.28fr);
    gap: 16px;
}

.cashbox-report-payment-summary {
    display: grid;
    gap: 13px;
}

.cashbox-report-payment-row {
    display: grid;
    gap: 6px;
}

.cashbox-report-payment-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cashbox-report-payment-row-head span {
    color: var(--theme-text-strong);
    font-size: 11px;
    font-weight: 650;
}

.cashbox-report-payment-row-head strong {
    color: var(--theme-text-strong);
    font-size: 12px;
}

.cashbox-report-payment-track {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--theme-surface-cool);
}

.cashbox-report-payment-track i {
    display: block;
    min-width: 2px;
    height: 100%;
    border-radius: inherit;
    background: var(--theme-text-strong);
    opacity: .78;
}

.cashbox-report-payment-row small {
    color: var(--theme-text-muted-soft);
    font-size: 9px;
}

.cashbox-report-products-head {
    align-items: center;
}

.cashbox-report-table-search {
    position: relative;
    display: block;
    width: min(230px, 42vw);
}

.cashbox-report-table-search svg {
    position: absolute;
    top: 50%;
    left: 10px;
    width: 16px;
    height: 16px;
    color: var(--theme-text-muted-soft);
    transform: translateY(-50%);
    pointer-events: none;
}

.cashbox-report-table-search input {
    width: 100%;
    min-height: 34px;
    padding: 7px 10px 7px 32px;
    border: 1px solid var(--theme-border);
    border-radius: 9px;
    background: var(--theme-surface-subtle);
    color: var(--theme-text-strong);
    font-size: 11px;
    outline: none;
}

.cashbox-report-products-table-wrap {
    max-height: 460px;
}

.cashbox-report-products-table {
    font-size: 11px;
}

.cashbox-report-products-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--theme-surface-raised);
}

.cashbox-report-products-table th {
    padding: 9px 10px;
    color: var(--theme-text-muted-soft);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .025em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cashbox-report-products-table td {
    padding: 10px;
    color: var(--theme-text-muted-cool);
    white-space: nowrap;
}

.cashbox-report-products-table td:first-child {
    min-width: 210px;
    white-space: normal;
}

.cashbox-report-products-table td strong {
    color: var(--theme-text-strong);
    font-weight: 650;
}

/* ==========================================================================
   Управленческий отчёт кассы
   ========================================================================== */
.cashbox-management-report {
    min-width: 0;
    margin-top: 4px;
}

.cashbox-management-tabs {
    display: flex;
    gap: 4px;
    max-width: 100%;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid var(--theme-border);
    border-radius: 13px;
    background: var(--theme-surface-soft);
    scrollbar-width: thin;
    scrollbar-color: var(--theme-border-strong) transparent;
}

.cashbox-management-tabs button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 6px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--theme-text-muted-cool);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.cashbox-management-tabs button:hover {
    background: var(--theme-surface-hover);
    color: var(--theme-text-strong);
}

.cashbox-management-tabs button:focus-visible {
    outline: 2px solid var(--theme-accent);
    outline-offset: 1px;
}

.cashbox-management-tabs button.is-active {
    border-color: var(--theme-border);
    background: var(--theme-surface-raised);
    box-shadow: 0 2px 7px rgba(15, 23, 42, .07);
    color: var(--theme-text-strong);
}

.cashbox-management-tabs b {
    display: inline-grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--theme-negative);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.cashbox-management-panel {
    display: none;
    min-width: 0;
    padding-top: 14px;
}

.cashbox-management-panel.is-active {
    display: block;
}

.cashbox-management-result-grid,
.cashbox-management-sales-grid,
.cashbox-management-control-grid {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.cashbox-management-result-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.cashbox-management-control-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cashbox-management-result-grid article,
.cashbox-management-sales-grid article,
.cashbox-management-control-grid article {
    position: relative;
    display: grid;
    grid-template-rows: auto auto 1fr;
    align-content: start;
    gap: 7px;
    min-width: 0;
    min-height: 126px;
    padding: 15px 16px 14px;
    overflow: hidden;
    border: 1px solid var(--theme-border);
    border-radius: 13px;
    background: var(--theme-surface-raised);
}

.cashbox-management-result-grid article::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    content: '';
    background: var(--theme-text-muted-soft);
}

.cashbox-management-result-grid article.is-positive::before {
    background: var(--theme-positive);
}

.cashbox-management-result-grid article.is-negative::before {
    background: var(--theme-negative);
}

.cashbox-management-result-grid span,
.cashbox-management-sales-grid span,
.cashbox-management-control-grid span {
    color: var(--theme-text-muted-soft);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .035em;
    line-height: 1.25;
    text-transform: uppercase;
}

.cashbox-management-result-grid strong,
.cashbox-management-sales-grid strong,
.cashbox-management-control-grid strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--theme-text-strong);
    font-size: clamp(18px, 1.7vw, 23px);
    font-weight: 740;
    font-variant-numeric: tabular-nums;
    line-height: 1.12;
}

.cashbox-management-result-grid strong i {
    font-style: normal;
}

.cashbox-management-result-grid small,
.cashbox-management-sales-grid small,
.cashbox-management-control-grid small {
    align-self: end;
    color: var(--theme-text-muted-cool);
    font-size: 9px;
    line-height: 1.4;
}

.cashbox-management-result-grid article.is-final {
    border-color: #263b5e;
    background: linear-gradient(145deg, #152138, #263b5e);
    box-shadow: 0 8px 22px rgba(19, 33, 56, .14);
}

.cashbox-management-result-grid article.is-final::before {
    background: var(--theme-accent);
}

.cashbox-management-result-grid article.is-final span,
.cashbox-management-result-grid article.is-final strong,
.cashbox-management-result-grid article.is-final small {
    color: #fff;
}

.cashbox-management-result-grid article.is-final small {
    opacity: .72;
}

.cashbox-management-formula {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-surface-subtle);
    color: var(--theme-text-mid);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.cashbox-management-formula span,
.cashbox-management-formula strong {
    padding: 5px 8px;
    border-radius: 8px;
    background: var(--theme-surface-raised);
    color: var(--theme-text-strong);
    font-weight: 750;
}

.cashbox-management-formula b {
    color: var(--theme-text-muted-soft);
    font-size: 13px;
    font-weight: 800;
}

.cashbox-management-formula strong {
    border: 1px solid var(--theme-border-strong);
    font-size: 14px;
}

.cashbox-management-note {
    position: relative;
    margin-bottom: 11px;
    padding: 11px 14px 11px 17px;
    overflow: hidden;
    border: 1px solid var(--theme-border);
    border-radius: 11px;
    background: var(--theme-info-soft);
    color: var(--theme-text-mid);
    font-size: 11px;
    line-height: 1.5;
}

.cashbox-management-note::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    content: '';
    background: var(--theme-accent);
}

.cashbox-management-note strong {
    color: var(--theme-text-strong);
}

.cashbox-management-category-table {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--theme-border);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    background: var(--theme-surface-raised);
    font-size: 11px;
}

.cashbox-management-category-table thead th {
    padding: 9px 11px;
    background: var(--theme-surface-soft);
    color: var(--theme-text-muted-soft);
    font-size: 9px;
}

.cashbox-management-category-table tbody td {
    padding: 10px 11px;
    color: var(--theme-text-mid);
    vertical-align: middle;
}

.cashbox-management-category-table tbody tr:last-child td {
    border-bottom: 0;
}

.cashbox-management-category-table tbody tr:hover td {
    background: var(--theme-surface-subtle);
}

.cashbox-management-category-table td:first-child {
    min-width: 190px;
}

.cashbox-management-category-table td:first-child strong {
    display: block;
    color: var(--theme-text-strong);
    font-weight: 700;
}

.cashbox-management-category-table td:first-child small {
    display: block;
    margin-top: 2px;
    color: var(--theme-text-muted-soft);
    font-size: 9px;
}

.cashbox-management-category-table .is-income {
    color: var(--theme-positive);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cashbox-management-category-table .is-expense {
    color: var(--theme-negative);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cashbox-management-impact {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
}

.cashbox-management-impact.is-profit {
    background: var(--theme-success-soft);
    color: var(--theme-positive);
}

.cashbox-management-impact.is-cash {
    background: var(--theme-surface-soft);
    color: var(--theme-text-muted-cool);
}

.cashbox-management-operation-list {
    display: grid;
    gap: 8px;
    margin-top: 11px;
}

.cashbox-management-operation {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(190px, 250px);
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 11px 12px 11px 15px;
    overflow: hidden;
    border: 1px solid var(--theme-border);
    border-radius: 11px;
    background: var(--theme-surface-raised);
}

.cashbox-management-operation::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    content: '';
    background: var(--theme-text-muted-soft);
}

.cashbox-management-operation.is-income::before {
    background: var(--theme-positive);
}

.cashbox-management-operation.is-expense::before {
    background: var(--theme-negative);
}

.cashbox-management-operation > div {
    min-width: 0;
}

.cashbox-management-operation > div strong,
.cashbox-management-operation > div small {
    display: block;
    overflow-wrap: anywhere;
}

.cashbox-management-operation > div strong {
    color: var(--theme-text-strong);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

.cashbox-management-operation > div small {
    margin-top: 3px;
    color: var(--theme-text-muted-soft);
    font-size: 9px;
    line-height: 1.35;
}

.cashbox-management-operation > span {
    color: var(--theme-text-strong);
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cashbox-management-operation.is-income > span {
    color: var(--theme-positive);
}

.cashbox-management-operation.is-expense > span {
    color: var(--theme-negative);
}

.cashbox-management-operation .form-select {
    min-width: 0;
    min-height: 34px;
    border-radius: 9px;
    background-color: var(--theme-surface-raised);
    color: var(--theme-text-strong);
    font-size: 10px;
}

.cashbox-management-control-grid article.needs-attention {
    border-color: color-mix(in srgb, var(--theme-negative) 35%, var(--theme-border));
    background: var(--theme-danger-soft);
}

.cashbox-management-control-grid article.needs-attention strong {
    color: var(--theme-negative);
}

html[data-theme="dark"] .cashbox-management-tabs button.is-active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

html[data-theme="dark"] .cashbox-management-result-grid article.is-final {
    border-color: #4b607b;
    background: linear-gradient(145deg, #202a35, #30445c);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
}

@media (max-width: 1100px) {
    .cashbox-management-result-grid,
    .cashbox-management-sales-grid,
    .cashbox-management-control-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .cashbox-management-operation {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .cashbox-management-operation .form-select {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .cashbox-management-tabs {
        margin-inline: -2px;
        scroll-snap-type: x proximity;
    }

    .cashbox-management-tabs button {
        min-height: 36px;
        padding-inline: 11px;
        scroll-snap-align: start;
    }

    .cashbox-management-result-grid,
    .cashbox-management-sales-grid,
    .cashbox-management-control-grid {
        grid-template-columns: 1fr;
    }

    .cashbox-management-result-grid article,
    .cashbox-management-sales-grid article,
    .cashbox-management-control-grid article {
        min-height: 112px;
    }

    .cashbox-management-formula {
        justify-content: flex-start;
    }

    .cashbox-management-operation {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cashbox-management-operation > span {
        justify-self: start;
    }

    .cashbox-management-operation .form-select {
        grid-column: auto;
    }

    .cashbox-management-category-table {
        min-width: 640px;
    }
}

@media (max-width: 1280px) {
    .cashbox-report-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .cashbox-report-stat-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .cashbox-report-stat-strip > div:nth-child(5) {
        border-left: 0;
        border-top: 1px solid var(--theme-border);
    }
    .cashbox-report-stat-strip > div:nth-child(n + 6) {
        border-top: 1px solid var(--theme-border);
    }
    .cashbox-report-analysis-grid,
    .cashbox-report-secondary-grid {
        grid-template-columns: 1fr;
    }
    .cashbox-report-insights {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .cashbox-report-pro-head,
    .cashbox-report-command-center,
    .cashbox-report-body {
        padding-left: 16px;
        padding-right: 16px;
    }
    .cashbox-report-primary-controls {
        grid-template-columns: 1fr 1fr;
    }
    .cashbox-report-date-control {
        grid-column: 1 / -1;
    }
    .cashbox-report-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .cashbox-report-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .cashbox-report-insights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .cashbox-report-pro-head {
        align-items: flex-start;
    }
    .cashbox-report-pro-icon {
        display: none;
    }
    .cashbox-report-head-actions .btn span {
        display: none;
    }
    .cashbox-report-primary-controls,
    .cashbox-report-kpi-grid,
    .cashbox-report-options-row,
    .cashbox-report-filter-grid {
        grid-template-columns: 1fr;
    }
    .cashbox-report-date-pair {
        grid-template-columns: 1fr;
    }
    .cashbox-report-date-pair i {
        display: none;
    }
    .cashbox-report-stat-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .cashbox-report-stat-strip > div:nth-child(odd) {
        border-left: 0;
    }
    .cashbox-report-stat-strip > div:nth-child(n + 3) {
        border-top: 1px solid var(--theme-border);
    }
    .cashbox-report-insights {
        grid-template-columns: 1fr;
    }
    .cashbox-report-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .cashbox-report-table-search {
        width: 100%;
    }
}
