/* ==========================================================================
   СОВРЕМЕННАЯ ГЛОБАЛЬНАЯ ДИЗАЙН-СИСТЕМА (КРУПНЫЙ, ПРОСТОРНЫЙ И СОВРЕМЕННЫЙ ИНТЕРФЕЙС)
   ========================================================================== */
:root {
    --bg-app: #eef2f6;
    --bg-panel: #ffffff;
    --bg-header: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --bg-table-header: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --bg-row-even: #f8fafc;
    --bg-row-hover: #eff6ff;

    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-light: #ffffff;

    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;

    --primary: #2563eb;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
    --primary-hover: linear-gradient(135deg, #2563eb 0%, #1d4ed8 60%, #1e40af 100%);
    --primary-shadow: 0 6px 18px -2px rgba(37, 99, 235, 0.35);

    --emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --emerald-shadow: 0 6px 18px -2px rgba(16, 185, 129, 0.34);

    --rose-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    --rose-shadow: 0 6px 18px -2px rgba(225, 29, 72, 0.34);

    --danger: #ef4444;

    /* Увеличенная геометрия для комфортного чтения и крупных элементов */
    --tabs-bar-height: 64px;
    --toolbar-height: 76px;
    --table-th-height: 52px;
    --table-row-height: 52px;
    --control-height: 46px;
    --page-gap: 14px;
    --page-padding: 18px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-panel: 0 6px 24px -4px rgba(15, 23, 42, 0.08), 0 2px 8px -2px rgba(15, 23, 42, 0.05);
    --font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-family);
    font-size: 16px;
    background-color: var(--bg-app);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
}

.hidden {
    display: none !important;
}

/* Полноэкранный каркас */
.app-shell {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===================== СОВРЕМЕННАЯ ПАНЕЛЬ ВКЛАДОК ===================== */
.global-tabs-bar {
    height: var(--tabs-bar-height);
    background: var(--bg-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--page-padding);
    gap: 10px;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.22);
    user-select: none;
    z-index: 200;
}

.tabs-left-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
    padding: 6px 2px;
    touch-action: pan-x;
}

.tabs-left-group::-webkit-scrollbar {
    display: none;
}

.tabs-left-group.is-sorting-tabs {
    cursor: grabbing;
}

.tabs-right-group {
    position: relative;
    flex-shrink: 0;
    margin-left: 14px;
}

.global-tab-btn {
    position: relative;
    height: 46px;
    background: rgba(255, 255, 255, 0.07);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 0 22px;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: grab;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.global-tab-btn:active {
    cursor: grabbing;
}

.global-tab-btn:hover:not(.is-dragging-tab) {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

.global-tab-btn.active {
    background: var(--primary-gradient);
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.48);
}

.global-tab-btn.is-dragging-tab {
    z-index: 80;
    cursor: grabbing !important;
    transition: box-shadow 0.15s ease, border-color 0.15s ease !important;
    border-color: rgba(255, 255, 255, 0.65) !important;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.48), 0 0 0 2px rgba(96, 165, 250, 0.55) !important;
    filter: brightness(1.1);
}

.refs-dropdown-btn {
    height: 46px;
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0 22px;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.refs-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.34);
    transform: translateY(-1px);
}

.refs-dropdown-btn.active {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.refs-dropdown-chevron {
    font-size: 13px;
    opacity: 0.9;
    transition: transform 0.2s ease;
}

.refs-dropdown-btn.is-open .refs-dropdown-chevron {
    transform: rotate(180deg);
}

.refs-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 300px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    box-shadow: 0 22px 48px -8px rgba(15, 23, 42, 0.32), 0 6px 16px rgba(15, 23, 42, 0.1);
    padding: 8px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: refsMenuDrop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes refsMenuDrop {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.refs-dropdown-item {
    width: 100%;
    height: 46px;
    padding: 0 18px;
    border: none;
    border-radius: 11px;
    background: transparent;
    color: #0f172a;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.15s ease;
}

.refs-dropdown-item:hover {
    background: #eff6ff;
    color: #2563eb;
}

.refs-dropdown-item.active {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ===================== РАБОЧАЯ ОБЛАСТЬ СТРАНИЦЫ ===================== */
.global-page-viewport {
    flex: 1;
    width: 100%;
    height: 100%;
    padding: var(--page-padding);
    display: flex;
    flex-direction: column;
    gap: var(--page-gap);
    overflow: hidden;
}

/* Верхняя панель управления вкладки */
.global-page-toolbar {
    min-height: var(--toolbar-height);
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
    box-shadow: var(--shadow-panel);
}

.toolbar-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 0;
    flex-wrap: wrap;
}

.global-page-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.015em;
    white-space: nowrap;
}

.records-count-pill {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 13.5px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ===================== СТАТИСТИКА ПРИХОД / РАСХОД В ВКЛАДКАХ ОПЛАТ ===================== */
.payment-ledger-stats {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 2px;
    flex-wrap: wrap;
}

.pay-stat-pill {
    font-size: 13.5px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    border: 1px solid transparent;
}

.pay-stat-pill.income {
    background: #ecfdf5;
    color: #047857;
    border-color: #6ee7b7;
}

.pay-stat-pill.expense {
    background: #fff1f2;
    color: #be123c;
    border-color: #fda4af;
}

.pay-stat-pill.balance {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
}

.cell-income-val {
    color: #059669;
    font-weight: 800;
    font-size: 16.5px;
}

.cell-expense-val {
    color: #e11d48;
    font-weight: 800;
    font-size: 16.5px;
}

.cell-muted-dash {
    color: #cbd5e1;
}

/* ===================== ПОИСК И ФИЛЬТРЫ ПО ПОЛЯМ В ТУЛБАРЕ ===================== */
.toolbar-search-center {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 190px;
    max-width: 920px;
}

.search-input-wrap {
    position: relative;
    flex: 1 1 190px;
    max-width: 440px;
    min-width: 0;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-icon-svg {
    position: absolute;
    left: 14px;
    width: 19px;
    height: 19px;
    color: #64748b;
    pointer-events: none;
    transition: color 0.15s ease;
}

.search-main-input {
    width: 100%;
    height: var(--control-height);
    padding: 0 40px 0 42px;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    background-color: #f8fafc;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.18s ease;
}

.search-main-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.search-main-input:hover {
    border-color: #94a3b8;
    background-color: #ffffff;
}

.search-main-input:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.search-input-wrap:focus-within .search-icon-svg {
    color: var(--primary);
}

.search-clear-btn {
    position: absolute;
    right: 10px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.search-clear-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.search-scopes-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    user-select: none;
}

.scope-checkbox-pill {
    height: 42px;
    padding: 0 15px;
    border-radius: 11px;
    border: 1.5px solid var(--border-strong);
    background-color: #f8fafc;
    color: #334155;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.scope-checkbox-pill:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.scope-checkbox-pill input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #94a3b8;
    border-radius: 5px;
    background-color: #ffffff;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.scope-checkbox-pill input[type="checkbox"]::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2.5px solid #ffffff;
    border-bottom: 2.5px solid #ffffff;
    transform: rotate(-45deg) translate(0.5px, -0.5px) scale(0);
    transition: transform 0.14s ease;
}

.scope-checkbox-pill.checked {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.scope-checkbox-pill.checked input[type="checkbox"] {
    background-color: #2563eb;
    border-color: #2563eb;
}

.scope-checkbox-pill.checked input[type="checkbox"]::after {
    transform: rotate(-45deg) translate(0.5px, -0.5px) scale(1);
}

.global-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ===================== СОВРЕМЕННЫЕ КРУПНЫЕ КНОПКИ ===================== */
.global-btn {
    height: var(--control-height);
    padding: 0 22px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.global-btn svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

.global-btn:active {
    transform: translateY(0) scale(0.98) !important;
}

.global-btn-primary {
    background: var(--primary-gradient);
    color: var(--text-light);
    box-shadow: var(--primary-shadow);
}

.global-btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.44);
    transform: translateY(-1px);
}

.global-btn-excel-dl {
    background: #ffffff;
    color: #0f172a;
    border: 1.5px solid var(--border-strong);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.global-btn-excel-dl:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.global-btn-excel-ul {
    background: var(--emerald-gradient);
    color: #ffffff;
    box-shadow: var(--emerald-shadow);
}

.global-btn-excel-ul:hover {
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.42);
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.global-btn-secondary {
    background: #f1f5f9;
    color: #1e293b;
    border: 1.5px solid var(--border-strong);
}

.global-btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.global-btn-success {
    background: var(--emerald-gradient);
    color: #ffffff;
    border: 1px solid #059669;
    font-weight: 700;
    box-shadow: var(--emerald-shadow);
}

.global-btn-success:hover {
    filter: brightness(1.05);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

/* ===================== ЕДИНЫЙ КОНТЕЙНЕР ТАБЛИЦЫ ===================== */
.global-table-container {
    flex: 1;
    width: 100%;
    height: 100%;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-panel);
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    position: relative;
}

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

/* Столбец № */
.global-table col.col-index {
    width: 96px;
}

.global-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    height: var(--table-th-height);
    background: var(--bg-table-header);
    color: #f8fafc;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 0 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-table thead th:last-child {
    border-right: none;
}

.global-table tbody tr {
    height: var(--table-row-height);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.global-table tbody tr:nth-child(even) {
    background-color: var(--bg-row-even);
}

.global-table tbody tr:hover {
    background-color: var(--bg-row-hover);
}

.global-table td {
    padding: 0 18px;
    border-right: 1px solid #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
}

.global-table td:last-child {
    border-right: none;
}

.col-index {
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    padding: 0 10px !important;
    text-align: center !important;
    color: var(--text-secondary) !important;
    font-weight: 700;
    font-size: 15px;
}

.global-empty-state {
    padding: 64px 28px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 17px;
    font-weight: 600;
    user-select: none;
}

/* ===================== ШИРОКОЕ И КРУПНОЕ МОДАЛЬНОЕ ОКНО ===================== */
.global-context-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.global-context-menu {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    box-shadow: 0 28px 60px -12px rgba(15, 23, 42, 0.36);
    display: flex;
    flex-direction: column;
    overflow: visible;
    animation: modalSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gcm-header {
    height: 64px;
    background: var(--bg-header);
    color: var(--text-light);
    padding: 0 26px;
    border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.gcm-title {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.gcm-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #e2e8f0;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.gcm-close:hover {
    background: rgba(255, 255, 255, 0.22);
    color: var(--text-light);
}

.gcm-body {
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: calc(100vh - 180px);
    overflow: visible;
}

.gcm-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gcm-label {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.gcm-input {
    height: 50px;
    padding: 0 16px;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    font-family: inherit;
    font-size: 16.5px;
    font-weight: 600;
    color: var(--text-main);
    background-color: #f8fafc;
    width: 100%;
    transition: all 0.16s ease;
}

.gcm-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.gcm-input:hover {
    border-color: #94a3b8;
    background-color: #ffffff;
}

.gcm-input:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

/* Три современные кнопки ПРИХОД, РАСХОД и ВОЗВРАТ в модальном окне */
.gcm-op-switch-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
}

.gcm-op-btn {
    height: 52px;
    border-radius: 13px;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    user-select: none;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gcm-op-icon {
    font-size: 19px;
    font-weight: 900;
    line-height: 1;
}

.gcm-op-btn.op-income:hover:not(.active) {
    border-color: #10b981;
    background: #ecfdf5;
    color: #047857;
}

.gcm-op-btn.op-expense:hover:not(.active) {
    border-color: #f43f5e;
    background: #fff1f2;
    color: #be123c;
}

.gcm-op-btn.op-refund:hover:not(.active) {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #b45309;
}

.gcm-op-btn.op-income.active {
    background: var(--emerald-gradient);
    border-color: #059669;
    color: #ffffff;
    box-shadow: 0 8px 22px -3px rgba(16, 185, 129, 0.48);
    transform: translateY(-1px);
}

.gcm-op-btn.op-expense.active {
    background: var(--rose-gradient);
    border-color: #e11d48;
    color: #ffffff;
    box-shadow: 0 8px 22px -3px rgba(225, 29, 72, 0.48);
    transform: translateY(-1px);
}

.gcm-op-btn.op-refund.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #d97706;
    color: #ffffff;
    box-shadow: 0 8px 22px -3px rgba(245, 158, 11, 0.48);
    transform: translateY(-1px);
}

/* Быстрые кнопки выбора статьи (чипы) в окне Приход / Расход */
.gcm-article-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2px;
}

.gcm-article-chip {
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.16s ease;
}

.gcm-article-chip.chip-income:hover {
    border-color: #10b981;
    background: #ecfdf5;
    color: #047857;
}

.gcm-article-chip.chip-expense:hover {
    border-color: #f43f5e;
    background: #fff1f2;
    color: #be123c;
}

.gcm-article-chip.chip-income.active {
    background: var(--emerald-gradient);
    border-color: #059669;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.32);
}

.gcm-article-chip.chip-expense.active {
    background: var(--rose-gradient);
    border-color: #e11d48;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.32);
}

.ac-badge-income {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #6ee7b7;
}

.ac-badge-expense {
    background: #fff1f2 !important;
    color: #be123c !important;
    border: 1px solid #fda4af;
}

.gcm-error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14.5px;
    font-weight: 700;
}

.gcm-footer {
    padding: 18px 26px;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.gcm-footer .global-btn {
    height: 48px;
    min-width: 145px;
    font-size: 16px;
}

/* ===================== ВСПЛЫВАЮЩЕЕ МЕНЮ ПРАВОГО КЛИКА ===================== */
.global-popup-menu {
    position: fixed;
    z-index: 1100;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
    min-width: 245px;
    padding: 8px;
    animation: modalSlideUp 0.12s ease-out;
}

.gpm-item {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 10px;
    text-align: left;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.12s;
}

.gpm-item:hover {
    background-color: #eff6ff;
    color: var(--primary);
}

.gpm-item.danger {
    color: var(--danger);
}

.gpm-item.danger:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

/* ===================== УВЕДОМЛЕНИЯ (TOAST) ===================== */
.toast-container {
    position: fixed;
    top: 86px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 3500;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    background: #0f172a;
    color: #ffffff;
    padding: 15px 22px;
    border-radius: 12px;
    font-size: 15.5px;
    font-weight: 700;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.3);
    border-left: 5px solid #10b981;
    animation: modalSlideUp 0.2s ease-out;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-item.is-warning-toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    max-width: 480px;
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    color: #881337;
    border: 2px solid #fb7185;
    border-left: 7px solid #e11d48;
    border-radius: 14px;
    padding: 15px 18px;
    box-shadow: 0 18px 38px -6px rgba(225, 29, 72, 0.32), 0 6px 14px -2px rgba(15, 23, 42, 0.14);
}

.toast-warning-text {
    font-size: 15.5px;
    font-weight: 800;
    line-height: 1.35;
}

.toast-close-x {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: rgba(225, 29, 72, 0.12);
    color: #be123c;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.toast-close-x:hover {
    background: #e11d48;
    color: #ffffff;
}

/* Быстрое современное голографическое переливание цвета вокруг карточки и поля (1.25 сек) */
@property --aurora-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes auroraShimmerSpin {
    0% {
        --aurora-angle: 0deg;
        opacity: 0;
    }
    18% {
        opacity: 1;
    }
    82% {
        opacity: 1;
    }
    100% {
        --aurora-angle: 360deg;
        opacity: 0;
    }
}

@keyframes cardColorShift {
    0% {
        border-color: #06b6d4;
        box-shadow: 0 0 26px 2px rgba(6, 182, 212, 0.45);
    }
    33% {
        border-color: #8b5cf6;
        box-shadow: 0 0 32px 5px rgba(139, 92, 246, 0.52);
    }
    66% {
        border-color: #ec4899;
        box-shadow: 0 0 32px 5px rgba(236, 72, 153, 0.52);
    }
    100% {
        border-color: #f59e0b;
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

.order-card.order-card-error-blink {
    position: relative;
    z-index: 28;
    animation: cardColorShift 1.25s ease-out forwards;
}

.order-card.order-card-error-blink::before {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 21px;
    background: conic-gradient(
        from var(--aurora-angle),
        #06b6d4,
        #3b82f6,
        #8b5cf6,
        #ec4899,
        #f43f5e,
        #f59e0b,
        #10b981,
        #06b6d4
    );
    filter: blur(10px);
    z-index: -1;
    pointer-events: none;
    animation: auroraShimmerSpin 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.order-card.order-card-error-blink::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 19px;
    padding: 3px;
    background: conic-gradient(
        from var(--aurora-angle),
        #06b6d4,
        #3b82f6,
        #8b5cf6,
        #ec4899,
        #f43f5e,
        #f59e0b,
        #10b981,
        #06b6d4
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: auroraShimmerSpin 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fieldWaveGlow {
    0% {
        border-color: #06b6d4;
        box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.45), 0 0 18px rgba(6, 182, 212, 0.5);
    }
    40% {
        border-color: #8b5cf6;
        box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.5), 0 0 24px rgba(236, 72, 153, 0.55);
    }
    75% {
        border-color: #ec4899;
        box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.48), 0 0 22px rgba(244, 63, 94, 0.5);
    }
    100% {
        border-color: #f43f5e;
        box-shadow: 0 0 0 0 rgba(244, 63, 94, 0);
    }
}

.field-error-blink {
    animation: fieldWaveGlow 1.25s ease-out forwards !important;
}

/* ===================== АНИМАЦИЯ ЗАКАЧКИ ШАБЛОНА EXCEL ===================== */
.upload-progress-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 34px 30px;
    box-shadow: 0 28px 56px -12px rgba(15, 23, 42, 0.36);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    animation: modalSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.upload-spinner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid #e2e8f0;
    border-top-color: #10b981;
    border-right-color: #3b82f6;
    animation: spinLoader 0.75s linear infinite;
}

.upload-success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--emerald-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    box-shadow: var(--emerald-shadow);
    animation: modalSlideUp 0.2s ease-out;
}

@keyframes spinLoader {
    to { transform: rotate(360deg); }
}

.upload-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.upload-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

.upload-bar-track {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.upload-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
    border-radius: 999px;
    transition: width 0.25s ease;
}

/* ===================== ТУМБЛЕР В СТИЛЕ iOS (ДЛЯ НОМЕНКЛАТУРЫ, ВИДОВ ОПЛАТ И СТАТЕЙ) ===================== */
.cell-toggle {
    text-align: center !important;
    padding: 0 10px !important;
}

.global-table thead th.th-toggle {
    text-align: center;
    padding: 0 10px;
}

.ios-toggle-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
}

.ios-toggle-caption {
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    transition: color 0.18s ease;
}

.ios-toggle-caption.is-on {
    color: #15803d;
}

.ios-toggle-caption.is-off {
    color: #94a3b8;
}

.ios-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 28px;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.ios-switch-slider {
    position: absolute;
    inset: 0;
    background-color: #cbd5e1;
    border-radius: 999px;
    transition: background-color 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}

.ios-switch-slider::before {
    content: "";
    position: absolute;
    height: 24px;
    width: 24px;
    left: 2px;
    top: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.24), 0 1px 1px rgba(15, 23, 42, 0.08);
    transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ios-switch input:checked + .ios-switch-slider {
    background-color: #10b981;
}

.ios-switch input:checked + .ios-switch-slider::before {
    transform: translateX(22px);
}

.global-table tbody tr.row-inactive td:not(.cell-toggle) {
    color: #94a3b8;
    text-decoration: none;
    opacity: 0.72;
}

/* ===================== ВКЛАДКА: ЗАКАЗЫ (КРУПНЫЙ И ПРОСТОРНЫЙ РЕЖИМ) ===================== */
.orders-page-viewport {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-app);
}

.orders-summary-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 26px;
    background: #ffffff;
    border-bottom: 1px solid #cbd5e1;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.orders-summary-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.orders-date-filter-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 13px;
    padding: 4px 5px;
    height: 46px;
    width: 155px;
    min-width: 155px;
    max-width: 155px;
    flex-shrink: 0;
    box-sizing: border-box;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.orders-date-seg-btn,
.orders-date-seg-pill {
    position: relative;
    height: 36px;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    padding: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    border-radius: 9px;
    border: 1.5px solid transparent;
    background: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    opacity: 0.72;
}

.orders-date-seg-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: block;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.12));
    transition: transform 0.16s ease;
}

.orders-date-seg-btn:hover:not(.active),
.orders-date-seg-pill:hover:not(.active) {
    opacity: 1;
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

.orders-date-seg-btn:hover .orders-date-seg-icon,
.orders-date-seg-pill:hover .orders-date-seg-icon {
    transform: scale(1.06);
}

.orders-all-dates-btn.active {
    opacity: 1;
    background: linear-gradient(180deg, #ffffff 0%, #dbeafe 100%);
    border-color: #2563eb;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25), inset 0 1px 0 #ffffff;
}

.orders-today-date-btn.active {
    opacity: 1;
    background: linear-gradient(180deg, #ffffff 0%, #d1fae5 100%);
    border-color: #10b981;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.26), inset 0 1px 0 #ffffff;
}

.orders-date-seg-pill.active {
    opacity: 1;
    background: linear-gradient(180deg, #ffffff 0%, #f3e8ff 100%);
    border-color: #7c3aed;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.25), inset 0 1px 0 #ffffff;
    padding: 0;
}

.orders-custom-date-badge {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 4px;
    height: 14px;
    line-height: 14px;
    border-radius: 5px;
    background: #6d28d9;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    z-index: 3;
}

.orders-filter-date-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    margin: 0;
    z-index: 2;
}

.orders-filter-date-input::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

.orders-search-filter-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 370px;
    width: 370px;
    min-width: 370px;
    max-width: 370px;
    height: 46px;
}

.orders-search-icon {
    position: absolute;
    left: 13px;
    width: 18px;
    height: 18px;
    color: #64748b;
    pointer-events: none;
}

.orders-search-filter-input {
    width: 100%;
    height: 100%;
    padding: 0 68px 0 38px;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.orders-search-filter-input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.orders-search-expand-btn {
    position: absolute;
    right: 36px;
    width: 26px;
    height: 26px;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    background: #eff6ff;
    color: #2563eb;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.14s ease;
}

.orders-search-expand-btn:hover {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.orders-search-clear-btn {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.14s ease;
}

.orders-search-clear-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.orders-filter-dist-dropdown {
    min-width: 500px;
    max-width: 620px;
    max-height: 380px;
}

.orders-filter-dist-dropdown .ac-title {
    white-space: normal;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.orders-filter-dist-dropdown .ac-right-count {
    font-size: 12.5px;
    font-weight: 800;
    color: #1e40af;
    background: #dbeafe;
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

.orders-active-dist-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 26px;
    background: linear-gradient(90deg, #eff6ff 0%, #f0fdf4 100%);
    border-bottom: 1.5px solid #93c5fd;
    flex-shrink: 0;
}

.orders-active-dist-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.orders-active-dist-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 9px;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.orders-active-prod-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 9px;
    background: #059669;
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.22);
}

.orders-active-dist-hint {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
}

.orders-active-dist-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.orders-active-dist-btn {
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1.5px solid #93c5fd;
    background: #ffffff;
    color: #1d4ed8;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.14s ease;
}

.orders-active-dist-btn:hover {
    background: #dbeafe;
    border-color: #2563eb;
}

.orders-active-dist-btn.is-reset {
    border-color: #fda4af;
    color: #be123c;
    background: #fff1f2;
}

.orders-active-dist-btn.is-reset:hover {
    background: #ffe4e6;
    border-color: #e11d48;
}

.order-tbody tr.product-filter-highlight td {
    background-color: #fef9c3 !important;
}

/* ==========================================================================
   СОВРЕМЕННАЯ ВКЛАДКА «ОТЧЁТ» (#globalReportsView)
   ========================================================================== */
.reports-summary-toolbar {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.reports-toolbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.reports-period-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.reports-date-range-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 3px 8px;
    height: 38px;
}

.reports-date-input {
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    background: transparent;
    cursor: pointer;
}

.reports-date-sep {
    color: #64748b;
    font-weight: 800;
}

.reports-dashboard-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 18px;
    background: #ffffff;
    border-bottom: 1.5px solid #cbd5e1;
    flex-shrink: 0;
}

.reports-filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.reports-filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
}

.reports-filter-label {
    font-size: 12.5px;
    font-weight: 800;
    color: #1e293b;
}

.reports-search-input-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 44px;
}

.reports-ac-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    max-height: 360px;
    overflow-y: auto;
    z-index: 2500;
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
}

.reports-reset-all-btn {
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1.5px solid #fda4af;
    background: #fff1f2;
    color: #be123c;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.reports-reset-all-btn:hover {
    background: #ffe4e6;
    border-color: #e11d48;
}

.reports-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.reports-kpi-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.reports-kpi-card.is-emerald {
    border-color: #86efac;
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
}

.reports-kpi-card.is-blue {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
}

.reports-kpi-card.is-indigo {
    border-color: #c7d2fe;
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
}

.reports-kpi-card.is-amber {
    border-color: #fde68a;
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}

.reports-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06);
    flex-shrink: 0;
}

.reports-kpi-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.reports-kpi-label {
    font-size: 12px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.reports-kpi-val {
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.15;
}

.reports-kpi-sub {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.reports-workspace-scroll {
    padding: 14px 18px 28px 18px;
}

.reports-modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.reports-modern-table th {
    background: #f1f5f9;
    color: #0f172a;
    font-size: 12.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 12px 14px;
    border-bottom: 1.5px solid #cbd5e1;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 3;
}

.reports-modern-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    vertical-align: middle;
}

.reports-modern-table tbody tr {
    transition: background 0.12s ease;
}

.reports-modern-table tbody tr:hover td {
    background: #eff6ff;
}

.reports-modern-table tfoot td {
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
    color: #14532d;
    font-size: 15px;
    font-weight: 900;
    padding: 13px 14px;
    border-top: 2px solid #86efac;
}

.reports-qty-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 11px;
    border-radius: 8px;
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #14532d;
    font-size: 14.5px;
    font-weight: 900;
    white-space: nowrap;
}

.reports-prod-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    margin: 2px 4px 2px 0;
    border-radius: 7px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s ease;
}

.reports-prod-chip:hover {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1d4ed8;
}

.reports-prod-chip b {
    color: #15803d;
    font-weight: 900;
}

.reports-share-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
}

.reports-share-track {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.reports-share-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
    border-radius: 999px;
}

.reports-share-pct {
    font-size: 12.5px;
    font-weight: 800;
    color: #475569;
    min-width: 38px;
    text-align: right;
}

.reports-clickable-link {
    cursor: pointer;
    color: #0f172a;
    text-decoration: none;
}

.reports-clickable-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.ac-expand-cards-bar {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 8px 12px !important;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%) !important;
    border-bottom: 1.5px solid #93c5fd !important;
    color: #1d4ed8 !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer;
}

.ac-expand-cards-bar:hover {
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%) !important;
    color: #1e3a8a !important;
}

/* Большое квадратное окно с квадратными карточками дистрибьюторов */
.dist-cards-picker-modal {
    width: 960px;
    max-width: 95vw;
    height: 740px;
    max-height: 90vh;
    background: #f8fafc;
    border: 1.5px solid #94a3b8;
    border-radius: 18px;
    box-shadow: 0 28px 65px rgba(15, 23, 42, 0.42);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.dist-cards-picker-header {
    height: 62px;
    padding: 0 22px;
    background: var(--bg-header);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-shrink: 0;
}

.dist-cards-picker-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dist-cards-picker-title {
    font-size: 18px;
    font-weight: 800;
}

.dist-cards-picker-count {
    min-width: 28px;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.32);
    border: 1px solid rgba(147, 197, 253, 0.5);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.dist-cards-picker-HeaderActions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dist-cards-mode-pills {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    padding: 3px;
}

.dist-cards-pill {
    height: 30px;
    padding: 0 11px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #cbd5e1;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.14s ease;
}

.dist-cards-pill:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.dist-cards-pill.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.dist-cards-picker-toolbar {
    padding: 14px 22px;
    background: #ffffff;
    border-bottom: 1px solid #cbd5e1;
    flex-shrink: 0;
}

.dist-cards-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 44px;
}

.dist-cards-search-box .orders-search-filter-input {
    padding-right: 40px;
}

.dist-cards-picker-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 22px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    grid-auto-rows: minmax(142px, auto);
    gap: 14px;
    align-content: start;
}

.dist-square-card {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-top: 4px solid #2563eb;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
    transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.dist-square-card.is-sponsor-match {
    border-top-color: #8b5cf6;
}

.dist-square-card:hover {
    transform: translateY(-2px);
    border-color: #2563eb;
    background: #f0f7ff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

.dist-square-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.dist-square-code {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 7px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.dist-square-card.is-sponsor-match .dist-square-code {
    background: #f3e8ff;
    color: #6d28d9;
}

.dist-square-orders-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-size: 11.5px;
    font-weight: 800;
    white-space: nowrap;
}

.dist-square-name {
    font-size: 14.5px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.32;
    word-break: break-word;
}

.dist-square-sub {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 6px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-word;
}

.dist-square-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.orders-create-order-btn {
    position: relative;
    height: 46px;
    min-width: 108px;
    padding: 0 24px !important;
    border-radius: 13px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%) !important;
    border: 1.5px solid #10b981 !important;
    color: #0f172a !important;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.18), inset 0 1px 0 #ffffff;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.orders-create-order-btn:hover {
    transform: translateY(-1px) scale(1.03);
    background: linear-gradient(180deg, #f0fdf4 0%, #d1fae5 100%) !important;
    border-color: #059669 !important;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.28), inset 0 1px 0 #ffffff;
}

.btn-downloaded-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
}

.btn-downloaded-icon-lg {
    width: 32px;
    height: 32px;
}

.orders-unentered-filter-btn {
    position: relative;
    height: 46px;
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    padding: 0 12px;
    flex-shrink: 0;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    white-space: nowrap;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
    user-select: none;
}

.orders-date-seg-btn[data-tooltip]::after,
.orders-date-seg-pill[data-tooltip]::after,
.orders-unentered-filter-btn[data-tooltip]::after,
.orders-create-order-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 5px 10px;
    border-radius: 7px;
    background: #0f172a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: none;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.24);
    z-index: 2500;
}

.orders-date-seg-btn[data-tooltip]:hover::after,
.orders-date-seg-pill[data-tooltip]:hover::after,
.orders-unentered-filter-btn[data-tooltip]:hover::after,
.orders-create-order-btn[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.orders-unentered-filter-btn:hover {
    background: #ffffff;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.unentered-filter-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
    flex-shrink: 0;
}

.unentered-filter-badge {
    min-width: 34px;
    height: 22px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #e2e8f0;
    color: #1e293b;
    font-size: 12.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.orders-unentered-filter-btn.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #b45309;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.34);
}

.orders-unentered-filter-btn.active .unentered-filter-dot {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.orders-unentered-filter-btn.active .unentered-filter-badge {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
}

.orders-register-bar {
    display: flex;
    align-items: center;
    gap: 28px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    padding: 8px 26px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.reg-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 105px;
}

.reg-stat-count {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    padding-right: 22px;
    border-right: 1px solid #cbd5e1;
    min-width: auto;
}

.reg-stat-count .reg-stat-value {
    font-size: 23px;
    font-weight: 800;
    color: #2563eb;
}

.reg-stat-sub {
    font-size: 15px;
    font-weight: 700;
    color: #475569;
}

.reg-stat-label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 2px;
}

.reg-stat-value {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.reg-stat-debt {
    padding-left: 22px;
    border-left: 1px solid #cbd5e1;
}

.reg-stat-debt .reg-stat-value {
    color: #dc2626;
}

#debtorsSummaryStats .reg-stat-debt {
    padding-left: 0;
    border-left: none;
}

#debtorsSummaryStats .reg-stat-item:not(:last-child) {
    padding-right: 24px;
    border-right: 1px solid #cbd5e1;
}

.orders-cards-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    padding: 22px 26px 52px 26px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    background: linear-gradient(180deg, #dbe4f0 0%, #d2ddeb 100%);
}

.orders-cards-scroll > * {
    flex-shrink: 0;
}

/* Карточка заказа (отчётливое визуальное разделение карточек на главной) */
.order-card {
    background: #ffffff;
    border: 2px solid #94a3b8;
    border-left: 6px solid #f59e0b;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.09);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.18s ease;
}

.order-card:hover {
    border-color: #64748b;
    box-shadow: 0 16px 34px -6px rgba(15, 23, 42, 0.22), 0 6px 14px -2px rgba(15, 23, 42, 0.11);
}

.order-card.filtered-out-1c {
    display: none !important;
}

.order-card.delivery-active {
    border: 2px solid #0ea5e9;
    border-left: 6px solid #0284c7;
    background: #f0f9ff;
    box-shadow: 0 12px 28px -4px rgba(14, 165, 233, 0.22);
}

.order-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: -20px -24px 14px -24px;
    padding: 14px 24px;
    background: #f1f5f9;
    border-bottom: 1.5px solid #cbd5e1;
    border-radius: 14px 14px 0 0;
    flex-wrap: nowrap;
}

.order-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
}

.order-dist-wrap {
    position: relative;
    flex: 1 1 240px;
    min-width: 210px;
    max-width: 480px;
}

.order-input-field {
    width: 100%;
    height: 44px;
    padding: 0 15px;
    border: 1.5px solid #cbd5e1;
    border-radius: 11px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.order-input-field:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.order-date-input {
    height: 44px;
    padding: 0 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 11px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
}

.order-date-input:focus {
    border-color: #2563eb;
    background: #ffffff;
}

.order-toggles-strip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 13px;
    height: 44px;
    flex-shrink: 0;
}

.order-toggle-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border-radius: 999px;
    user-select: none;
    cursor: pointer;
}

.ios-switch.has-thumb-icon {
    width: 56px;
    height: 32px;
}

.ios-switch.has-thumb-icon .ios-switch-slider::before {
    display: none;
}

.ios-switch.has-thumb-icon .ios-switch-thumb {
    position: absolute;
    width: 26px;
    height: 26px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background-color: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.26), 0 1px 1px rgba(15, 23, 42, 0.08);
    transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.18s ease, box-shadow 0.18s ease;
    pointer-events: none;
}

.ios-switch.has-thumb-icon input:checked + .ios-switch-slider .ios-switch-thumb {
    transform: translateX(24px);
}

.order-toggle-item.is-round-toggle-item .ios-switch-thumb {
    color: #0d9488;
}

.order-toggle-item.is-sklad-toggle-item .ios-switch-thumb {
    color: #d97706;
}

.order-toggle-item.is-delivery-toggle-item .ios-switch-thumb {
    color: #0284c7;
}

.order-toggle-item.is-extra-cols-toggle-item .ios-switch-thumb {
    color: #7c3aed;
}

.order-toggle-item.is-round-toggle-item .ios-switch input:checked + .ios-switch-slider {
    background: linear-gradient(135deg, #10b981, #059669);
}

.order-toggle-item.is-sklad-toggle-item .ios-switch input:checked + .ios-switch-slider {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.order-toggle-item.is-delivery-toggle-item .ios-switch input:checked + .ios-switch-slider {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.order-toggle-item.is-extra-cols-toggle-item .ios-switch input:checked + .ios-switch-slider {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.order-toggle-item[data-tooltip]::after,
.order-entered-1c-wrap[data-tooltip]::after,
.order-icon-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 5px 10px;
    border-radius: 7px;
    background: #0f172a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.14s ease, transform 0.14s ease;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.24);
    z-index: 2500;
}

.order-toggle-item[data-tooltip]:hover::after,
.order-entered-1c-wrap[data-tooltip]:hover::after,
.order-icon-btn[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

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

.order-icon-btn {
    position: relative;
    height: 44px;
    min-width: 44px;
    padding: 0 13px;
    border-radius: 11px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.order-icon-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: translateY(-1px);
}

.order-icon-btn.btn-excel {
    background: var(--emerald-gradient);
    border-color: #059669;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.26);
}

.order-icon-btn.btn-excel:hover {
    filter: brightness(1.05);
}

.order-icon-btn.btn-receipt {
    background: var(--primary-gradient);
    border-color: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.26);
}

.order-icon-btn.btn-receipt:hover {
    filter: brightness(1.05);
}

.order-icon-btn.btn-add-row {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #60a5fa;
    color: #1d4ed8;
    min-width: 78px;
    padding: 0 15px;
    gap: 7px;
    font-weight: 800;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.order-icon-btn.btn-add-row:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    color: #1e40af;
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.2);
}

.refs-item-with-icon,
.plastic-dd-item-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.plastic-card-svg-icon {
    flex-shrink: 0;
    display: block;
}

.order-icon-btn.btn-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.order-icon-btn.btn-danger:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* Таблица товаров внутри карточки заказа */
.order-items-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 12px;
}

/* По умолчанию редкие колонки («Цена (баллы)», «Сумма (баллы)», «Скидка %») скрыты */
.order-items-table col.col-name { width: 46%; }
.order-items-table col.col-retail { width: 9%; }
.order-items-table col.col-qty { width: 9%; }
.order-items-table col.col-price { width: 13%; }
.order-items-table col.col-sum { width: 14%; }
.order-items-table col.col-articul { width: 9%; }
.order-items-table col.col-del { width: 36px; }

.order-card:not(.show-extra-cols) .order-items-table .col-extra-points {
    display: none;
}

/* Когда включена кнопка «% Баллы и скидка» в карточке */
.order-card.show-extra-cols .order-items-table col.col-name { width: 28%; }
.order-card.show-extra-cols .order-items-table col.col-retail { width: 7%; }
.order-card.show-extra-cols .order-items-table col.col-qty { width: 6.5%; }
.order-card.show-extra-cols .order-items-table col.col-price { width: 10%; }
.order-card.show-extra-cols .order-items-table col.col-sum { width: 10.5%; }
.order-card.show-extra-cols .order-items-table col.col-base-price { width: 11.5%; }
.order-card.show-extra-cols .order-items-table col.col-base-sum { width: 12%; }
.order-card.show-extra-cols .order-items-table col.col-discount { width: 7.5%; }
.order-card.show-extra-cols .order-items-table col.col-articul { width: 7%; }
.order-card.show-extra-cols .order-items-table col.col-del { width: 36px; }

.order-items-table thead th {
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    padding: 10px 8px;
    border-bottom: 1.5px solid #cbd5e1;
    text-align: left;
    white-space: nowrap;
    user-select: none;
}

.order-items-table tbody td {
    padding: 8px 8px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    font-size: 15.5px;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.order-items-table tbody tr:hover {
    background: #f8fafc;
}

.order-product-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 9px;
    background: #ffffff;
    color: #0f172a;
    font-size: 15.5px;
    font-weight: 600;
    font-family: inherit;
    outline: none;
}

.order-product-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.order-qty-input {
    width: 100%;
    height: 40px;
    padding: 0 8px;
    border: 1.5px solid #cbd5e1;
    border-radius: 9px;
    background: #ffffff;
    color: #0f172a;
    font-size: 15.5px;
    font-weight: 700;
    text-align: center;
    font-family: inherit;
    outline: none;
}

.order-qty-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.price-text,
.sum-text,
.base-price-text,
.base-sum-text {
    font-weight: 700;
    font-size: 15.5px;
    color: #0f172a;
}

.sum-text {
    font-weight: 800;
    color: #0f172a;
}

.articul-text {
    color: #2563eb;
    font-weight: 800;
    font-size: 14.5px;
    white-space: nowrap;
}

.delete-row-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.delete-row-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Автодополнение для Контрагентов, Номенклатуры и Статей */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-items {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: #ffffff;
    border: 1.5px solid #94a3b8;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
    z-index: 3200;
}

.autocomplete-items > div {
    padding: 11px 16px;
    cursor: pointer;
    font-size: 15.5px;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.autocomplete-items > div:last-child {
    border-bottom: none;
}

.autocomplete-items > div:hover,
.autocomplete-items > div.autocomplete-active {
    background: #eff6ff;
    color: #1d4ed8;
}

.ac-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.ac-code {
    color: #2563eb;
    font-weight: 800;
    font-size: 13.5px;
    background: #eff6ff;
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

.ac-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-right {
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    flex-shrink: 0;
}

/* Подвал карточки заказа (оплата, примечание, итоги) */
.order-card-footer {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: stretch;
    gap: 18px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 1180px) {
    .order-card-footer {
        flex-wrap: wrap;
    }
}

.order-footer-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.payment-section {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}

@media (max-width: 1180px) {
    .payment-section {
        flex-wrap: wrap;
    }
}

.pay-box {
    display: inline-flex;
    align-items: center;
    height: 42px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.auto-pay-btn {
    height: 100%;
    padding: 0 11px;
    border: none;
    border-right: 1px solid #cbd5e1;
    background: #eff6ff;
    color: #1d4ed8;
    font-family: inherit;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.auto-pay-btn:hover:not(.disabled) {
    background: #dbeafe;
}

.pay-badge-os {
    padding: 0 10px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    background: #f3e8ff;
    color: #7e22ce;
    font-weight: 800;
    font-size: 14px;
    border: none;
    border-right: 1px solid #cbd5e1;
    cursor: pointer;
}

.pay-badge-os:hover:not(.disabled) {
    background: #e9d5ff;
    color: #6b21a8;
}

.auto-pay-btn.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.pay-input {
    width: 102px;
    height: 100%;
    padding: 0 9px;
    border: none;
    background: transparent;
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
    text-align: right;
    font-family: inherit;
    outline: none;
    font-variant-numeric: tabular-nums;
}

.pay-input.payment-os {
    width: 96px;
}

.pay-input:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.order-note-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 42px;
}

.order-note-input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 14.5px;
    font-weight: 500;
    font-family: inherit;
    outline: none;
}

.order-note-input:focus {
    background: #ffffff;
    border-color: #2563eb;
}

.order-footer-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.order-totals-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 2px;
    min-height: 42px;
}

.order-totals-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.order-to-pay {
    color: #0f172a;
    font-weight: 800;
}

.order-total {
    color: #2563eb;
    font-weight: 800;
    font-size: 17px;
}

.order-total-base {
    color: #059669;
    font-weight: 800;
}

.order-total-pure {
    color: #d97706;
    font-weight: 800;
}

.order-debt-row {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
    margin-top: 0;
}

.debt-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    padding: 0 10px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
}

.debt-box-label {
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
}

.payment-exchange {
    width: 82px;
    border: none;
    background: transparent;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
    text-align: right;
    font-family: inherit;
    outline: none;
}

.order-debt {
    width: 104px;
    border: none;
    background: transparent;
    color: #dc2626;
    font-size: 16.5px;
    font-weight: 800;
    text-align: right;
    font-family: inherit;
    outline: none;
}

/* ===================== ВЫПАДАЮЩИЙ СПИСОК КАРТЫ ПЛАСТИКА ПОСЛЕ ТЕРМИНАЛА ===================== */
.plastic-card-picker-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 42px;
    flex-shrink: 0;
}

.plastic-card-picker-btn {
    height: 42px;
    min-width: 168px;
    width: auto;
    max-width: 220px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    transition: all 0.18s ease;
    user-select: none;
}

.plastic-picker-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plastic-card-picker-btn.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.72;
}

.plastic-card-picker-btn.needs-selection {
    background: #fffbeb;
    color: #b45309;
    border: 2px solid #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.24);
    animation: plasticPulse 1.4s infinite ease-in-out;
}

@keyframes plasticPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.26);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.1);
    }
}

.plastic-card-picker-btn.has-selection {
    background: #eff6ff;
    color: #1d4ed8;
    border: 2px solid #3b82f6;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.18);
}

.plastic-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 215px;
    background: #ffffff;
    border: 1.5px solid #94a3b8;
    border-radius: 12px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.24);
    padding: 6px;
    z-index: 2800;
    display: flex;
    flex-direction: column;
    gap: 3px;
    animation: refsMenuDrop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.plastic-dropdown-item {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #0f172a;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.plastic-dropdown-item:hover {
    background: #eff6ff;
    color: #2563eb;
}

.plastic-dropdown-item.active,
.plastic-dropdown-item.selected {
    background: var(--primary-gradient);
    color: #ffffff;
}

.plastic-dropdown-empty {
    padding: 12px;
    font-size: 14px;
    color: #64748b;
    text-align: center;
}

/* ===================== КНОПКИ ЗАПИСАТЬ / СОХРАНИТЬ И ПОДСВЕТКА ОШИБОК ===================== */
.order-icon-btn.lock-btn {
    background: var(--emerald-gradient);
    border-color: #059669;
    color: #ffffff;
    width: 44px;
    padding: 0;
    font-weight: 800;
    box-shadow: var(--emerald-shadow);
}

.order-icon-btn.lock-btn:hover {
    filter: brightness(1.05);
    color: #ffffff;
    transform: translateY(-1px);
}

.order-icon-btn.unlock-btn {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #b45309;
    width: 44px;
    padding: 0;
    font-weight: 800;
}

.order-icon-btn.unlock-btn:hover {
    background: #fef3c7;
    color: #92400e;
}

.order-icon-btn.delete-order-btn {
    width: 44px;
    padding: 0;
}

.order-save-pay-btn {
    height: 42px;
    padding: 0 15px;
    border-radius: 10px;
    border: 1px solid #059669;
    background: var(--emerald-gradient);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: var(--emerald-shadow);
    transition: all 0.18s ease;
}

.order-save-pay-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* Заблокированный заказ (записанный в БД — остаётся чётким и контрастным) */
.order-card.locked-order {
    background: #ffffff;
    border-color: #94a3b8;
    border-left: 6px solid #2563eb;
    opacity: 1;
}

/* Тумблер «1С» возле выбора карты пластика (иконка 1С прямо внутри кругляшка) */
.order-entered-1c-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 4px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.ios-switch.has-thumb-icon .ios-switch-thumb.thumb-1c-text {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #059669;
}

/* Окраска ТОЛЬКО верхней шапки заказа по статусу оплаты (до включения тумблера «1С»):
   - Оплачен полностью (долг = 0): шапка зелёная, тело карточки белое
   - Частично оплачен (оплачено > 0, но есть остаток долга): шапка тёплого жёлто-янтарного цвета, тело карточки белое
   - Не оплачен совсем (оплачено = 0, весь заказ в долг): шапка мягкого розово-кораллового цвета, тело карточки белое */
.order-card.order-paid-closed:not(.entered-1c),
.order-card.locked-order.order-paid-closed:not(.entered-1c) {
    border-color: #6ee7b7;
    border-left: 6px solid #10b981;
}

.order-card.order-paid-closed:not(.entered-1c) .order-card-header {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-bottom: 1.5px solid #34d399;
}

.order-card.order-paid-closed:not(.entered-1c) .order-card-header .order-input-field,
.order-card.order-paid-closed:not(.entered-1c) .order-card-header .order-date-input,
.order-card.order-paid-closed:not(.entered-1c) .order-card-header .order-toggles-strip {
    background: rgba(255, 255, 255, 0.92);
    border-color: #6ee7b7;
}

.order-card.order-partial-debt:not(.entered-1c),
.order-card.locked-order.order-partial-debt:not(.entered-1c) {
    border-color: #fcd34d;
    border-left: 6px solid #f59e0b;
}

.order-card.order-partial-debt:not(.entered-1c) .order-card-header {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 1.5px solid #f59e0b;
}

.order-card.order-partial-debt:not(.entered-1c) .order-card-header .order-input-field,
.order-card.order-partial-debt:not(.entered-1c) .order-card-header .order-date-input,
.order-card.order-partial-debt:not(.entered-1c) .order-card-header .order-toggles-strip {
    background: rgba(255, 255, 255, 0.92);
    border-color: #fcd34d;
}

.order-card.order-unpaid-debt:not(.entered-1c),
.order-card.locked-order.order-unpaid-debt:not(.entered-1c) {
    border-color: #fda4af;
    border-left: 6px solid #e11d48;
}

.order-card.order-unpaid-debt:not(.entered-1c) .order-card-header {
    background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
    border-bottom: 1.5px solid #fda4af;
}

.order-card.order-unpaid-debt:not(.entered-1c) .order-card-header .order-input-field,
.order-card.order-unpaid-debt:not(.entered-1c) .order-card-header .order-date-input,
.order-card.order-unpaid-debt:not(.entered-1c) .order-card-header .order-toggles-strip {
    background: rgba(255, 255, 255, 0.92);
    border-color: #fda4af;
}

/* Приятная мягкая зелёная окраска ВСЕЙ карточки заказа, когда включён тумблер «В 1С» */
.order-card.entered-1c,
.order-card.locked-order.entered-1c {
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%) !important;
    border-color: #10b981 !important;
    border-left: 6px solid #059669 !important;
    box-shadow: 0 12px 28px -6px rgba(5, 150, 105, 0.22), 0 4px 12px -2px rgba(5, 150, 105, 0.12) !important;
}

/* Яркий синий ореол вокруг заказа с включённым тумблером «Доставка 🚚» (работает поверх любых статусов и 1С без сдвига макета) */
.order-card.delivery-active,
.order-card.locked-order.delivery-active,
.order-card.order-paid-closed.delivery-active,
.order-card.order-partial-debt.delivery-active,
.order-card.order-unpaid-debt.delivery-active,
.order-card.entered-1c.delivery-active,
.order-card.locked-order.entered-1c.delivery-active {
    border: 2px solid #0ea5e9 !important;
    border-left: 6px solid #0284c7 !important;
    box-shadow:
        inset 0 0 0 1px rgba(14, 165, 233, 0.45),
        0 0 0 4px rgba(14, 165, 233, 0.38),
        0 0 28px rgba(2, 132, 199, 0.48),
        0 12px 28px -4px rgba(14, 165, 233, 0.32) !important;
}

.order-card.delivery-active:not(.entered-1c) {
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%) !important;
}

@keyframes pintodoSideCounterPulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.22); box-shadow: 0 0 22px rgba(56, 189, 248, 0.85); }
    100% { transform: scale(1); }
}

.pintodo-side-toggle-btn.pulse-counter {
    animation: pintodoSideCounterPulse 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.order-card.entered-1c .order-card-header {
    background: rgba(16, 185, 129, 0.16);
    border-bottom-color: #6ee7b7;
}

.order-card.entered-1c .order-items-table thead th {
    background: rgba(16, 185, 129, 0.14);
    border-bottom-color: #6ee7b7;
    color: #065f46;
}

.order-card.entered-1c .order-items-table tbody td {
    border-bottom-color: rgba(16, 185, 129, 0.24);
}

.order-card.entered-1c .order-items-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.55);
}

.order-card.entered-1c .order-card-footer {
    border-top-color: #6ee7b7;
}

.order-card.entered-1c .order-input-field,
.order-card.entered-1c .order-date-input,
.order-card.entered-1c .order-toggles-strip,
.order-card.entered-1c .order-product-input,
.order-card.entered-1c .order-qty-input,
.order-card.entered-1c .pay-box,
.order-card.entered-1c .plastic-card-picker-btn,
.order-card.entered-1c .order-note-input,
.order-card.entered-1c .debt-box {
    background: #e6faef !important;
    border-color: #6ee7b7 !important;
    opacity: 1 !important;
}

.order-card.entered-1c .auto-pay-btn,
.order-card.entered-1c .pay-badge-os {
    background: #d1fae5 !important;
    border-right-color: #6ee7b7 !important;
    color: #065f46 !important;
    opacity: 1 !important;
}

.order-card.entered-1c .pay-input,
.order-card.entered-1c .payment-exchange,
.order-card.entered-1c .order-debt {
    background: transparent !important;
    opacity: 1 !important;
}

.order-card.entered-1c .order-toggle-item:not(:has(input:checked)) .toggle-icon-badge {
    background: #e6faef;
    border-color: #6ee7b7;
    color: #065f46;
}

.order-card.entered-1c .order-icon-btn.btn-add-row,
.order-card.entered-1c .order-link-pay-btn {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

.orders-all-entered-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 26px;
    background: #ffffff;
    border: 2px solid #10b981;
    border-left: 6px solid #059669;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.12);
}

.orders-all-entered-icon {
    font-size: 28px;
    line-height: 1;
}

.orders-all-entered-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.orders-all-entered-text strong {
    font-size: 16.5px;
    color: #065f46;
}

.orders-all-entered-text span {
    font-size: 14px;
    color: #475569;
}

.order-card.locked-order .order-input-field,
.order-card.locked-order .order-date-input,
.order-card.locked-order .order-product-input,
.order-card.locked-order .order-qty-input,
.order-card.locked-order .pay-input,
.order-card.locked-order .order-note-input,
.order-card.locked-order .payment-exchange,
.order-card.locked-order .order-debt,
.order-card.locked-order .auto-pay-btn,
.order-card.locked-order .delivery-type-btn,
.order-card.locked-order .plastic-card-picker-wrap,
.order-card.locked-order .ios-switch:not(.extra-cols-switch):not(.entered-1c-switch):not(.delivery-switch) {
    pointer-events: none;
}

.order-card.locked-order .btn-add-row,
.order-card.locked-order .delete-row-btn {
    pointer-events: none;
    opacity: 0.55;
}

.order-card.locked-order .order-entered-1c-wrap,
.order-card.locked-order .entered-1c-switch,
.order-card.locked-order .delivery-label,
.order-card.locked-order .delivery-switch {
    pointer-events: auto !important;
    opacity: 1 !important;
}

.order-card.locked-order .order-save-pay-btn {
    display: none;
}

.input-error-highlight {
    border-color: #f43f5e !important;
    background-color: #fff1f2 !important;
    animation: fieldWaveGlow 1.05s cubic-bezier(0.16, 1, 0.3, 1) 3 !important;
}

/* ===================== ДВУХКОЛОНОЧНОЕ КОМПАКТНОЕ ОКНО ОПЛАТ И КОМБО-ПОЛЕ СТАТЬИ ===================== */
.global-context-menu.is-wide-modal {
    max-width: 860px;
}

.gcm-body.is-two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
    align-items: start;
}

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

.gcm-article-select-wrap {
    position: relative;
    width: 100%;
}

.gcm-article-combo-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.gcm-article-combo-input {
    padding-right: 78px !important;
    font-weight: 700;
}

.gcm-article-combo-input.is-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2) !important;
}

.gcm-article-clear-btn {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.14s ease;
}

.gcm-article-clear-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.gcm-article-toggle-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.16s ease;
}

.gcm-article-toggle-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.gcm-article-toggle-btn.open {
    color: var(--primary);
    transform: translateY(-50%) rotate(180deg);
}

.gcm-article-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 20px 42px -8px rgba(15, 23, 42, 0.28);
    padding: 6px;
    z-index: 1300;
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    animation: refsDropFade 0.14s ease-out;
}

.gcm-article-option {
    width: 100%;
    min-height: 44px;
    padding: 8px 14px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #0f172a;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.gcm-article-option:hover,
.gcm-article-option.focused {
    background: #eff6ff;
    color: #2563eb;
}

.gcm-article-option.active {
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 700;
}

.gcm-article-option-check {
    font-size: 15px;
    font-weight: 800;
}

.gcm-article-empty {
    padding: 14px;
    font-size: 15px;
    color: #64748b;
    text-align: center;
}

/* ===================== ИСТОРИЯ ДОЛЖНИКОВ И СВЯЗЫВАНИЕ ОПЛАТ С ЗАКАЗАМИ ===================== */
.tab-debt-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    margin-left: 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.tab-btn.active .tab-debt-badge {
    background: #ffffff;
    color: #dc2626;
}

.gcm-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.gcm-unknown-payer-btn {
    padding: 4px 11px;
    border-radius: 8px;
    border: 1.5px dashed #f59e0b;
    background: #fffbeb;
    color: #b45309;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gcm-unknown-payer-btn:hover,
.gcm-unknown-payer-btn.active {
    background: #fef3c7;
    border-style: solid;
    border-color: #d97706;
    color: #92400e;
}

.gcm-article-option.is-unlinked-option {
    background: #fffbeb;
    color: #b45309;
    border: 1px dashed #f59e0b;
    margin-bottom: 4px;
    font-weight: 700;
}

.gcm-article-option.is-unlinked-option:hover,
.gcm-article-option.is-unlinked-option.focused {
    background: #fef3c7;
    color: #92400e;
}

.gcm-article-option.is-unlinked-option.active {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border-color: transparent;
}

/* Спокойное двухцветное выделение записей во вкладках оплат (без пестроты и лишних рамок) */
/* 1. Незаполненные записи (и Приход, и Расход) — единый лёгкий тёпло-кремовый оттенок */
.global-table tbody tr.tx-row-unfilled td {
    background-color: #fefce8 !important;
    border-bottom-color: #fef08a !important;
}

.global-table tbody tr.tx-row-unfilled:hover td {
    background-color: #fef9c3 !important;
}

/* 2. Заполненные записи (когда статья или заказ уже указаны) — лёгкий спокойный светло-мятный оттенок */
.global-table tbody tr.tx-row-filled td {
    background-color: #f4fbf7 !important;
    border-bottom-color: #dcfce7 !important;
}

.global-table tbody tr.tx-row-filled:hover td {
    background-color: #eafaf1 !important;
}

.unlinked-cp-badge {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    font-style: italic;
}

.cell-date-with-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.cell-date-main {
    font-weight: 600;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
}

.cell-date-time-sub {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 5px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}

.tx-link-order-btn {
    height: 32px;
    min-width: 46px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.tx-link-order-btn:hover {
    border-color: #38bdf8;
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(14, 165, 233, 0.16);
}

.tx-link-order-icon {
    width: 21px;
    height: 21px;
    object-fit: contain;
    display: block;
}

.tx-order-link-box {
    display: inline-flex;
    align-items: center;
    height: 31px;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tx-order-link-box:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

.tx-linked-order-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 10px 0 8px;
    background: transparent;
    border: none;
    color: #1e293b;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.14s ease, color 0.14s ease;
}

.tx-linked-order-pill:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.tx-linked-order-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.tx-linked-order-arrow {
    color: #64748b;
    opacity: 0.8;
    transition: transform 0.14s ease, color 0.14s ease;
}

.tx-linked-order-pill:hover .tx-linked-order-arrow {
    color: #2563eb;
    opacity: 1;
}

.tx-linked-order-jump {
    border: none;
    background: transparent;
    color: #047857;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.tx-linked-order-jump:hover {
    text-decoration: underline;
}

.tx-unlink-order-btn {
    width: 26px;
    height: 100%;
    border: none;
    border-left: 1px solid #e2e8f0;
    background: transparent;
    color: #64748b;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.14s ease, color 0.14s ease;
}

.tx-unlink-order-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.order-payments-pill-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    pointer-events: auto !important;
    opacity: 1 !important;
}

.order-payments-view-btn {
    height: 42px;
    padding: 0 13px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.16s ease;
    pointer-events: auto !important;
    opacity: 1 !important;
}

.order-payments-unlink-btn {
    width: 34px;
    height: 42px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.16s ease;
    pointer-events: auto !important;
    opacity: 1 !important;
}

.order-payments-unlink-btn:hover {
    background: #fee2e2 !important;
    border-color: #f87171 !important;
    color: #dc2626 !important;
}

.order-card.entered-1c .order-payments-unlink-btn {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

.order-payments-view-btn svg {
    color: #059669;
    flex-shrink: 0;
}

.order-pay-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #10b981;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 900;
    line-height: 1;
}

.order-payments-view-btn:hover {
    border-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.18);
}

.order-card.entered-1c .order-payments-view-btn {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

.order-card.entered-1c .order-payments-view-btn:hover {
    background: #a7f3d0;
    border-color: #10b981;
}

/* Модальное окно просмотра всех оплат по заказу */
.order-payments-modal {
    max-width: 760px;
    width: 95%;
}

.order-payments-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-payments-summary-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
}

.ops-main-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
    flex: 1;
}

.ops-top-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
}

.ops-order-tag {
    padding: 2px 8px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #1e293b;
}

.ops-distributor-name {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.ops-items-summary {
    font-size: 13.5px;
    color: #475569;
    font-weight: 600;
}

.ops-metrics-strip {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex-wrap: wrap;
}

.ops-metric-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    min-width: 112px;
}

.ops-metric-box.is-paid {
    background: #f0fdf4;
    border-color: #86efac;
}

.ops-metric-box.is-debt {
    background: #fef2f2;
    border-color: #fca5a5;
}

.ops-metric-box.is-closed {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.ops-metric-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

.ops-metric-val {
    font-size: 16.5px;
    font-weight: 900;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.ops-metric-box.is-paid .ops-metric-val {
    color: #059669;
}

.ops-metric-box.is-debt .ops-metric-val {
    color: #dc2626;
}

.order-payments-tx-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 370px;
    overflow-y: auto;
    padding-right: 4px;
}

.order-payment-tx-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 11px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.order-payment-tx-card:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.optx-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.optx-index {
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
    min-width: 24px;
}

.optx-wallet-badge {
    padding: 4px 10px;
    border-radius: 7px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.optx-date {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.optx-note {
    font-size: 13px;
    color: #64748b;
    background: #f8fafc;
    padding: 2px 8px;
    border-radius: 6px;
}

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

.optx-amount {
    font-size: 18px;
    font-weight: 900;
    color: #059669;
    font-variant-numeric: tabular-nums;
    margin-right: 4px;
}

.optx-jump-btn {
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.order-payment-tx-card:hover .optx-jump-btn,
.optx-jump-btn:hover {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.optx-unlink-btn {
    height: 34px;
    padding: 0 11px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #e11d48;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.optx-unlink-btn:hover {
    background: #e11d48;
    border-color: #e11d48;
    color: #ffffff;
}

.debtor-jump-tx-btn {
    border: none;
    background: transparent;
    padding: 0;
    color: #1e293b;
    font-family: inherit;
    font-size: 12.5px;
    cursor: pointer;
    text-align: left;
}

.debtor-jump-tx-btn:hover {
    color: #2563eb;
    text-decoration: underline;
}

.global-table tbody tr.tx-row-jump-highlight td {
    background-color: #eff6ff !important;
    transition: background-color 0.25s ease;
}

.global-table tbody tr.tx-row-jump-highlight td:first-child {
    box-shadow: inset 3px 0 0 #3b82f6 !important;
}

.order-link-pay-btn {
    height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1.5px solid #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.16s ease;
    pointer-events: auto !important;
    opacity: 1 !important;
}

.order-link-pay-btn:hover {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: var(--primary-shadow);
}

.order-card.order-card-highlight-pulse,
.order-card.locked-order.order-card-highlight-pulse,
.order-card.entered-1c.order-card-highlight-pulse {
    position: relative;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18), 0 8px 24px rgba(15, 23, 42, 0.08) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Рабочая область вкладки «Должники» */
.debtors-workspace {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-bottom: 32px;
}

.debtors-top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
}

.debtors-top-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
}

.debtors-filter-pills {
    display: inline-flex;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    gap: 4px;
}

.debtors-filter-pill {
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #475569;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
}

.debtors-filter-pill.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.debtors-stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.debtors-stat-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 14.5px;
}

.debtors-stat-card.is-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.debtors-stat-card.is-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.debtors-stat-card.is-emerald {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.debtors-stat-value {
    font-size: 17px;
    font-weight: 800;
}

.debtors-stat-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 12.5px;
    font-weight: 700;
}

.debtors-search-wrap {
    min-width: 320px;
    flex: 1;
    max-width: 440px;
}

.debtors-main-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.debtors-panel {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    flex-shrink: 0;
}

.debtors-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.debtors-panel-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.debtors-panel-icon {
    font-size: 24px;
}

.debtors-panel-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
}

.debtors-panel-subtitle {
    margin: 2px 0 0;
    font-size: 13.5px;
    color: #64748b;
}

.debtors-panel-badge {
    padding: 5px 12px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 13.5px;
    font-weight: 800;
    white-space: nowrap;
}

.debtors-panel-badge.is-warning {
    background: #fef3c7;
    color: #b45309;
}

.debtors-unlinked-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 14px;
    padding: 18px 22px;
}

.unlinked-tx-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    transition: all 0.16s ease;
}

.unlinked-tx-card.is-waiting {
    border-color: #fbbf24;
    background: #fffdf5;
}

.unlinked-tx-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.unlinked-tx-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.unlinked-tx-wallet {
    padding: 3px 9px;
    border-radius: 7px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13.5px;
    font-weight: 800;
}

.unlinked-tx-date {
    font-size: 13.5px;
    font-weight: 600;
    color: #64748b;
}

.unlinked-tx-amount {
    font-size: 21px;
    font-weight: 800;
    color: #059669;
    font-variant-numeric: tabular-nums;
}

.unlinked-tx-cp {
    font-size: 14px;
    color: #334155;
    font-weight: 600;
}

.unlinked-tx-note {
    font-size: 13px;
    color: #64748b;
}

.unlinked-tx-bind-btn {
    margin-top: auto;
    height: 38px;
    border-radius: 9px;
    border: none;
    background: var(--primary-gradient);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--primary-shadow);
    transition: all 0.15s ease;
}

.unlinked-tx-bind-btn:hover {
    filter: brightness(1.06);
}

.debtors-table-wrap {
    overflow-x: auto;
}

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

.debtors-table th {
    padding: 13px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #475569;
    background: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
    white-space: nowrap;
}

.debtors-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    font-size: 15px;
}

.debtors-table td.cell-num,
.debtor-col-total {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.debtor-order-row.is-debtor-row {
    background: #fffafa;
}

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

.debtor-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.debtor-status-badge.is-debt {
    background: #fee2e2;
    color: #b91c1c;
}

.debtor-status-badge.is-paid {
    background: #d1fae5;
    color: #047857;
}

.debtor-date-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    white-space: nowrap;
}

.debtor-date-text {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.debtor-jump-order-btn {
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #2563eb;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.debtor-jump-order-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.debtor-dist-name {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.debtor-order-note {
    margin-top: 3px;
    font-size: 13px;
    color: #64748b;
}

.debtor-items-list {
    font-size: 14.5px;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}

.debtor-items-chips-box {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.debtor-item-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 7px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.debtor-item-pill b {
    color: #0f172a;
    font-weight: 800;
    white-space: nowrap;
}

.debtor-pay-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.debtor-pay-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.debtor-pay-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    background: #f1f5f9;
    color: #334155;
    white-space: nowrap;
}

.debtor-pay-chip.is-cash {
    background: #ecfdf5;
    color: #047857;
}

.debtor-pay-chip.is-plastic {
    background: #eff6ff;
    color: #1d4ed8;
}

.debtor-pay-chip.is-terminal {
    background: #f5f3ff;
    color: #6d28d9;
}

.debtor-pay-chip.is-os {
    background: #fdf4ff;
    color: #9333ea;
    border: 1px solid #f0abfc;
}

.debtor-linked-tx-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.debtor-linked-tx-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 9px;
    border-radius: 7px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    font-size: 12.5px;
    color: #334155;
}

.debtor-unlink-tx-btn {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.debtor-unlink-tx-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.debtor-no-pay {
    font-size: 13.5px;
    color: #94a3b8;
    font-style: italic;
    white-space: nowrap;
}

.debtor-debt-amount {
    font-size: 17px;
    font-weight: 800;
    color: #dc2626;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.debtor-paid-zero {
    font-size: 15px;
    font-weight: 800;
    color: #059669;
    white-space: nowrap;
}

.debtor-bind-pay-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 9px;
    border: none;
    background: var(--primary-gradient);
    color: #ffffff;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--primary-shadow);
    white-space: nowrap;
    transition: all 0.15s ease;
}

.debtor-bind-pay-btn:hover {
    filter: brightness(1.06);
}

.debtor-bind-pay-btn.is-secondary {
    background: #f1f5f9;
    color: #334155;
    box-shadow: none;
    border: 1px solid #cbd5e1;
}

.debtor-bind-pay-btn.is-secondary:hover {
    background: #e2e8f0;
}

.debtors-empty-cell {
    padding: 38px 20px !important;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
}

/* Модальное окно связывания оплаты с заказом (крупное широкое окно + квадратные карточки 3 в ряд) */
.global-context-menu.link-order-modal,
.link-order-modal {
    width: min(1340px, 96vw) !important;
    max-width: 1340px !important;
    height: min(850px, 91vh);
    max-height: 91vh;
    display: flex;
    flex-direction: column;
}

.link-modal-body,
.link-order-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: hidden;
}

.link-modal-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.gcm-debtors-header-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.link-show-all-toggle-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 13px 0 8px;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.link-show-all-toggle-pill:hover {
    border-color: #94a3b8;
    background: #ffffff;
}

.link-show-all-toggle-pill.is-active {
    border-color: #34d399;
    background: #ecfdf5;
}

.link-show-all-toggle-pill.is-compact {
    height: 30px;
    padding: 0 9px 0 4px;
    border-radius: 9px;
    gap: 4px;
}

.link-show-all-caption {
    font-size: 13.5px;
    font-weight: 800;
    color: #334155;
}

.link-show-all-toggle-pill.is-compact .link-show-all-caption {
    font-size: 12.5px;
}

.link-show-all-toggle-pill.is-active .link-show-all-caption {
    color: #047857;
}

.link-show-all-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.link-show-all-toggle-pill.is-active .link-show-all-count {
    background: #10b981;
    color: #ffffff;
}

.link-source-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    flex-shrink: 0;
}

.link-source-banner.is-tx-source {
    background: #ecfdf5;
    border-color: #6ee7b7;
}

.link-source-banner.is-order-source {
    background: #eff6ff;
    border-color: #93c5fd;
}

.link-source-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.link-source-tag {
    font-size: 13px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
}

.link-source-dist {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.link-source-items,
.link-source-cp {
    font-size: 14.5px;
    font-weight: 600;
    color: #334155;
}

.link-source-amount {
    font-size: 24px;
    font-weight: 800;
    color: #059669;
    white-space: nowrap;
}

.link-source-metrics {
    text-align: right;
    font-size: 15px;
}

.link-source-debt {
    font-size: 18px;
    color: #dc2626;
}

.link-modal-list,
.link-order-candidates-list,
#linkOrderCandidatesList {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-content: start;
    align-items: start;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 8px 10px 2px;
}

@media (max-width: 1120px) {
    .link-modal-list,
    .link-order-candidates-list,
    #linkOrderCandidatesList {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.link-candidate-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 7px;
    height: 264px;
    min-height: 264px;
    max-height: 264px;
    padding: 13px 15px;
    border-radius: 14px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.link-candidate-card.is-exact-match {
    border-color: #10b981;
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.14);
}

.link-candidate-card.is-close-match {
    border-color: #3b82f6;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.12);
}

.link-candidate-card:hover {
    border-color: #2563eb;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.13);
}

.link-candidate-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-shrink: 0;
}

.link-candidate-top-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.link-candidate-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.22;
    max-height: 36px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    flex-shrink: 0;
}

.link-candidate-amount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.link-candidate-amount {
    font-size: 20px;
    font-weight: 900;
    color: #059669;
    font-variant-numeric: tabular-nums;
}

.link-candidate-date {
    font-size: 12px;
    color: #64748b;
    font-weight: 700;
    white-space: nowrap;
}

.link-match-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #d1fae5;
    color: #047857;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.link-match-badge.is-close-match {
    background: #dbeafe;
    color: #1d4ed8;
}

.link-candidates-more-hint-btn {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px dashed #94a3b8;
    background: #f8fafc;
    color: #1e293b;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.link-candidates-more-hint-btn:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.link-candidate-sub {
    font-size: 13px;
    color: #334155;
    line-height: 1.3;
}

.link-candidate-card .dsc-items-scroll {
    flex: 1 1 0px;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding: 5px 8px;
    border-radius: 8px;
    background: #f1f5f9;
}

.link-candidate-numbers {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
    font-size: 12.5px;
    color: #475569;
    flex-shrink: 0;
}

.link-candidate-numbers-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.link-candidate-numbers .is-debt-now {
    color: #dc2626;
    font-size: 13.5px;
}

.link-candidate-numbers .is-debt-after {
    color: #059669;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-candidate-select-btn {
    width: 100%;
    height: 36px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 9px;
    border: none;
    background: var(--primary-gradient);
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: var(--primary-shadow);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.link-candidate-select-btn:hover {
    filter: brightness(1.06);
}

.link-candidates-empty {
    grid-column: 1 / -1;
    padding: 42px 24px;
    text-align: center;
    font-size: 15.5px;
    color: #475569;
    background: #f8fafc;
    border-radius: 14px;
    border: 1.5px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* ==========================================================================
   МОДУЛЬ: АРХИВ ЗАКАЗОВ И ИСТОРИЯ ВСЕХ ДЕЙСТВИЙ (КАК В 1С) + ОТМЕНА УДАЛЕНИЯ
   ========================================================================== */
.toast-item.has-action {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
}

.toast-item-text {
    line-height: 1.35;
}

.toast-action-btn {
    height: 32px;
    padding: 0 13px;
    border-radius: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #0f172a;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

.toast-action-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.refs-dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 6px 4px;
}

.refs-dropdown-archive-item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #1e293b !important;
    font-weight: 800 !important;
    background: #f8fafc;
}

.refs-dropdown-archive-item:hover {
    background: #eef2ff !important;
    color: #4338ca !important;
}

.refs-dropdown-archive-item.active {
    background: var(--primary-gradient) !important;
    color: #ffffff !important;
}

.refs-archive-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.orders-archive-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    border-radius: 11px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
    white-space: nowrap;
}

.orders-archive-toggle-btn:hover {
    border-color: #6366f1;
    background: #f5f3ff;
    color: #4338ca;
}

.orders-archive-toggle-btn.active {
    background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
    border-color: #312e81;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.28);
}

.orders-archive-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 800;
}

.debtor-actions-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.debtor-delete-order-btn {
    height: 36px;
    width: 36px;
    border-radius: 9px;
    border: 1.5px solid #fecaca;
    background: #fef2f2;
    color: #dc2626;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.debtor-delete-order-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.orders-archive-container {
    margin-top: 4px;
}

.orders-archive-panel {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.orders-archive-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border-bottom: 1.5px solid #e2e8f0;
}

.orders-archive-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.orders-archive-icon {
    font-size: 28px;
    line-height: 1;
}

.orders-archive-title {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
}

.orders-archive-subtitle {
    margin: 3px 0 0;
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.orders-archive-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.orders-archive-stat-pill {
    padding: 7px 14px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    color: #334155;
}

.orders-archive-back-btn {
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1.5px solid #4f46e5;
    background: #ffffff;
    color: #4338ca;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.orders-archive-back-btn:hover {
    background: #4f46e5;
    color: #ffffff;
}

.orders-archive-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.orders-archive-filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.archive-filter-pill {
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.archive-filter-pill:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.archive-filter-pill.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #ffffff;
    box-shadow: var(--primary-shadow);
}

.archive-filter-pill.is-danger-pill.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.orders-archive-right-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.orders-archive-period-group {
    display: inline-flex;
    background: #e2e8f0;
    padding: 3px;
    border-radius: 10px;
    gap: 3px;
}

.archive-period-btn {
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #475569;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}

.archive-period-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.orders-archive-search-input {
    width: 310px;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    font-family: inherit;
    font-size: 14.5px;
    color: #0f172a;
    outline: none;
}

.orders-archive-search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.orders-archive-table-wrap {
    overflow-x: auto;
    max-height: calc(100vh - 330px);
    overflow-y: auto;
}

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

.orders-archive-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
    color: #334155;
    font-size: 13.5px;
    font-weight: 800;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1.5px solid #cbd5e1;
    white-space: nowrap;
}

.orders-archive-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    font-size: 14.5px;
}

.archive-audit-row:hover {
    background: #f8fafc;
}

.archive-audit-row.is-deleted-row {
    background: #fffafa;
}

.archive-audit-row.is-restored-row {
    opacity: 0.78;
}

.archive-time-main {
    font-weight: 700;
    color: #1e293b;
    font-size: 14px;
}

.archive-time-sub {
    font-size: 12.5px;
    color: #64748b;
    margin-top: 2px;
}

.archive-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.archive-cat-badge.is-cat-order {
    background: #eef2ff;
    color: #4338ca;
}

.archive-cat-badge.is-cat-item {
    background: #fef3c7;
    color: #b45309;
}

.archive-cat-badge.is-cat-payment {
    background: #ecfdf5;
    color: #047857;
}

.archive-act-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.archive-act-badge.is-act-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.archive-act-badge.is-act-create {
    background: #dcfce7;
    color: #15803d;
}

.archive-act-badge.is-act-update {
    background: #e0f2fe;
    color: #0369a1;
}

.archive-act-badge.is-act-restore {
    background: #f3e8ff;
    color: #7e22ce;
}

.archive-act-badge.is-act-link {
    background: #ccfbf1;
    color: #0f766e;
}

.archive-act-badge.is-act-unlink {
    background: #ffedd5;
    color: #c2410c;
}

.archive-entry-title {
    font-weight: 800;
    color: #0f172a;
    font-size: 15px;
}

.archive-entry-sub {
    margin-top: 3px;
    font-size: 13.5px;
    color: #475569;
}

.archive-restore-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: 9px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.28);
    transition: all 0.15s ease;
}

.archive-restore-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.archive-restored-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.archive-open-order-btn {
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.archive-open-order-btn:hover {
    border-color: #6366f1;
    color: #4338ca;
    background: #f5f3ff;
}

.archive-empty-cell {
    padding: 40px 24px !important;
    text-align: center;
    color: #64748b;
    font-size: 15px;
}

/* ===================== ИДЕАЛЬНО РОВНАЯ КАРТОЧКА ОПЛАТЫ + БОКОВАЯ ПАНЕЛЬ КВАДРАТНЫХ КАРТОЧЕК ДОЛЖНИКОВ ===================== */
.global-context-menu.has-debtors-side-pane {
    width: 1180px;
    max-width: calc(100vw - 36px);
}

.gcm-split-workspace {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 0;
}

.gcm-left-main-pane {
    flex: 1 1 520px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.global-context-menu.has-debtors-side-pane .gcm-left-main-pane {
    flex: 0 0 540px;
    max-width: 540px;
    height: 510px;
    max-height: calc(100vh - 200px);
    border-right: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.gcm-body.is-two-col-grid .gcm-row:not(.is-full-width) .gcm-label {
    display: block;
    min-height: 22px;
    line-height: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gcm-income-helper-row {
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gcm-income-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.gcm-income-hint-text {
    font-size: 13.5px;
    font-weight: 700;
    color: #64748b;
}

.gcm-selected-debtor-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border: 1.5px solid #34d399;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

.gcm-sel-debtor-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.gcm-sel-debtor-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #10b981;
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gcm-sel-debtor-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gcm-sel-debtor-title {
    font-size: 14.5px;
    color: #065f46;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gcm-sel-debtor-sub {
    font-size: 13px;
    color: #047857;
}

.gcm-sel-debtor-clear {
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #a7f3d0;
    background: #ffffff;
    color: #047857;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.gcm-sel-debtor-clear:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Правая панель с квадратными карточками должников и поиском */
.gcm-right-debtors-pane {
    flex: 1 1 580px;
    min-width: 0;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    height: 510px;
    max-height: calc(100vh - 200px);
}

.gcm-debtors-pane-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.gcm-debtors-pane-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.gcm-debtors-pane-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.gcm-debtors-pane-icon {
    font-size: 18px;
}

.gcm-debtors-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 13.5px;
    font-weight: 800;
}

.gcm-debtors-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.gcm-debtors-search-icon {
    position: absolute;
    left: 12px;
    width: 17px;
    height: 17px;
    color: #64748b;
    pointer-events: none;
}

.gcm-debtors-search-input {
    width: 100%;
    height: 44px;
    padding: 0 70px 0 38px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    outline: none;
    transition: all 0.15s ease;
}

.gcm-debtors-search-input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.gcm-debtors-search-input.has-selected-person {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.gcm-debtors-search-input.is-invalid {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
}

.gcm-debtors-search-clear {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: #e2e8f0;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.14s ease;
}

.gcm-debtors-search-box.has-dropdown-arrow .gcm-debtors-search-clear {
    right: 40px;
}

.gcm-debtors-search-clear:hover {
    background: #fee2e2;
    color: #dc2626;
}

.gcm-debtors-dropdown-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #475569;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.gcm-debtors-dropdown-toggle:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.gcm-debtors-dropdown-toggle.open {
    color: var(--primary);
    transform: translateY(-50%) rotate(180deg);
}

.gcm-right-dist-dropdown {
    max-height: 340px;
    z-index: 1350;
}

.gcm-article-select-wrap.is-disabled-wrap .gcm-article-combo-input {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
}

.gcm-article-select-wrap.is-disabled-wrap .gcm-article-toggle-btn,
.gcm-article-select-wrap.is-disabled-wrap .gcm-article-clear-btn {
    display: none !important;
}

.gcm-debtors-square-grid {
    padding: 14px 16px 16px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 192px;
    gap: 12px;
    align-content: start;
    flex: 1;
}

.gcm-debtor-square-card {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px 14px;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 6px;
    height: 192px;
    box-sizing: border-box;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    position: relative;
}

.gcm-debtor-square-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.gcm-debtor-square-card.is-selected {
    border-color: #10b981 !important;
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%) !important;
    box-shadow: 0 0 0 2.5px rgba(16, 185, 129, 0.28), 0 6px 16px rgba(16, 185, 129, 0.14) !important;
}

.gcm-debtor-square-card.is-compact-side-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 56px;
    padding: 0 14px;
}

.gcm-debtor-square-card.is-compact-side-card .dsc-dist-name {
    font-size: 15px;
    -webkit-line-clamp: 1;
}

.gcm-debtors-square-grid:has(.is-compact-side-card) {
    grid-auto-rows: 56px;
    gap: 10px;
}

.dsc-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.dsc-order-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 7px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    border: none;
    cursor: pointer;
}

.dsc-order-badge.is-expense-badge {
    background: #fff1f2;
    color: #be123c;
}

.dsc-order-badge.is-refund-badge {
    background: #fffbeb;
    color: #b45309;
}

.tx-refund-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 6px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
    font-size: 11.5px;
    font-weight: 800;
    vertical-align: middle;
}

.tx-refund-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #b45309;
    font-size: 13px;
    font-weight: 700;
}

.gcm-article-option-sub {
    font-size: 13.5px;
    font-weight: 700;
    color: #64748b;
    flex-shrink: 0;
}

.gcm-article-option.active .gcm-article-option-sub {
    color: rgba(255, 255, 255, 0.88);
}

.dsc-date-text {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.dsc-dist-name {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.22;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.dsc-items-scroll {
    min-height: 0;
    overflow-y: auto;
    padding: 4px 6px;
    border-radius: 7px;
    background: rgba(241, 245, 249, 0.7);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dsc-items-scroll::-webkit-scrollbar {
    width: 4px;
}

.dsc-items-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.dsc-item-line {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    line-height: 1.28;
    word-break: break-word;
}

.dsc-item-line b {
    color: #0f172a;
    font-weight: 800;
}

.dsc-item-line.is-empty {
    color: #94a3b8;
    font-style: italic;
}

.dsc-bottom-row {
    padding-top: 7px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dsc-debt-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dsc-debt-caption {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #94a3b8;
    line-height: 1;
}

.dsc-debt-value {
    font-size: 15.5px;
    font-weight: 900;
    color: #dc2626;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    white-space: nowrap;
}

.dsc-select-btn {
    height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gcm-debtor-square-card:hover .dsc-select-btn {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.gcm-debtor-square-card.is-selected .dsc-select-btn {
    background: #10b981;
    border-color: #059669;
    color: #ffffff;
}

.gcm-debtors-empty-card {
    grid-column: 1 / -1;
    padding: 36px 20px;
    border-radius: 14px;
    border: 1.5px dashed #cbd5e1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.gcm-debtors-empty-icon {
    font-size: 28px;
}

.gcm-debtors-empty-title {
    font-size: 15.5px;
    font-weight: 800;
    color: #1e293b;
}

.gcm-debtors-empty-sub {
    font-size: 13.5px;
    color: #64748b;
}

/* Двухколоночная раскладка во вкладке «Должники» (таблица + боковые квадратные карточки должников) */
.debtors-split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 18px;
    align-items: start;
}

.debtors-side-cards-panel {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.debtors-side-cards-header {
    padding: 15px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.debtors-side-square-grid {
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 192px;
    gap: 12px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

/* ==================== АВТО-СКАНЕР ВЫПИСОК (ФОТО / ВИДЕО UZUM И PAYME) ==================== */
.plastic-scan-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 44px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: all 0.16s ease;
}

.plastic-scan-upload-btn:hover {
    border-color: #38bdf8;
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.18);
}

.plastic-scan-upload-btn:active {
    transform: translateY(0);
}

.plastic-scan-btn-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.statement-scanner-modal {
    width: min(1040px, 95vw) !important;
    max-width: 1040px !important;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.scanner-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scanner-modal-header-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.scanner-media-kind-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 800;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.scanner-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scanner-add-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    font-size: 13.5px;
}

.scanner-mini-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.statement-scanner-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
}

.scanner-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 20px;
    gap: 12px;
    text-align: center;
}

.scanner-loading-title {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
}

.scanner-loading-sub {
    font-size: 14px;
    color: #64748b;
}

.scanner-summary-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.scanner-table-scroll {
    max-height: 52vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.scanner-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.scanner-preview-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
    color: #334155;
    font-weight: 800;
    padding: 10px 12px;
    border-bottom: 1.5px solid #cbd5e1;
    text-align: left;
    white-space: nowrap;
}

.scanner-preview-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.scanner-preview-table tr.is-unchecked {
    opacity: 0.52;
    background: #f8fafc;
}

.scanner-preview-table tr.is-db-dup {
    background: #fffbeb;
}

.scanner-input-date,
.scanner-input-amount,
.scanner-input-note {
    width: 100%;
    height: 34px;
    padding: 4px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #0f172a;
    background: #ffffff;
}

.scanner-input-amount {
    text-align: right;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.scanner-op-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 108px;
    height: 32px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    border: 1.5px solid transparent;
    transition: all 0.14s ease;
}

.scanner-op-pill.income {
    background: #ecfdf5;
    color: #047857;
    border-color: #6ee7b7;
}

.scanner-op-pill.expense {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.scanner-time-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.scanner-dup-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.scanner-dup-badge.warn {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.scanner-dup-badge.info {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.statement-scanner-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.scanner-footer-hint {
    font-size: 13px;
    color: #64748b;
}

.scanner-footer-btns {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scanner-dual-intake-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.scanner-dual-intake-bar.is-dragover .scanner-intake-card {
    border-color: #0ea5e9;
    background: #e0f2fe;
}

.scanner-intake-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px dashed #cbd5e1;
    background: #f8fafc;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: all 0.16s ease;
}

.scanner-intake-card.paste-card {
    border-color: #86efac;
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
}

.scanner-intake-card.paste-card:hover {
    border-color: #22c55e;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.16);
    transform: translateY(-1px);
}

.scanner-intake-card.attach-card {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
}

.scanner-intake-card.attach-card:hover {
    border-color: #0284c7;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.16);
    transform: translateY(-1px);
}

.scanner-intake-icon {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.scanner-intake-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.scanner-intake-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #0f172a;
}

.scanner-intake-sub {
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

/* ==================== ВСПЛЫВАЮЩЕЕ БОКОВОЕ МЕНЮ В СТИЛЕ PINTODO (2 ВКЛАДКИ: ДОСТАВКИ + КУПЮРНИК) ==================== */
.pintodo-delivery-popup {
    position: fixed;
    top: 50%;
    right: 24px;
    bottom: auto;
    z-index: 940;
    width: 465px;
    max-width: calc(100vw - 68px);
    height: min(650px, calc(100vh - 48px));
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 38, 0.96);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border: 2px solid #38bdf8;
    border-radius: 22px;
    padding: 14px 18px 18px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(56, 189, 248, 0.32);
    color: #f1f5f9;
    transform: translate3d(130%, -50%, 0);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.pintodo-delivery-popup.is-cash-mode {
    border-color: #10b981;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 42px rgba(16, 185, 129, 0.32);
}

.pintodo-delivery-popup.active {
    transform: translate3d(0, -50%, 0);
    opacity: 1;
    pointer-events: auto;
}

/* Свёрнутое вбок состояние: вся карточка плавно уходит за правый край, оставляя снаружи только 2 ярлычка ровно по центру */
.pintodo-delivery-popup.active.collapsed-side {
    transform: translate3d(calc(100% + 24px), -50%, 0);
    opacity: 0.98;
}

.pintodo-delivery-popup.flash-add {
    border-color: #10b981;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 55px rgba(16, 185, 129, 0.62);
}

.pintodo-delivery-popup.flash-rem {
    border-color: #f59e0b;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 55px rgba(245, 158, 11, 0.58);
}

.pintodo-side-toggles-stack {
    position: absolute;
    left: -44px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}

.pintodo-side-toggle {
    position: relative;
    width: 44px;
    height: 104px;
    border-radius: 15px 0 0 15px;
    background: linear-gradient(180deg, #0284c7 0%, #10b981 100%);
    border: 2px solid #38bdf8;
    border-right: none;
    color: #ffffff;
    font-family: inherit;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 0;
    box-shadow: -6px 0 22px rgba(14, 165, 233, 0.45);
    transition: filter 0.2s ease, box-shadow 0.2s ease;
    pointer-events: auto;
}

.pintodo-side-toggle.is-cash-tab {
    background: linear-gradient(180deg, #059669 0%, #d97706 100%);
    border-color: #34d399;
    box-shadow: -6px 0 22px rgba(16, 185, 129, 0.42);
}

.pintodo-side-toggle:hover {
    filter: brightness(1.14);
    box-shadow: -8px 0 26px rgba(16, 185, 129, 0.58);
}

.pintodo-side-toggle.active-tab:not(.collapsed-handle) {
    filter: brightness(1.08);
}

.pintodo-side-toggle.has-active-items {
    box-shadow: -6px 0 26px rgba(16, 185, 129, 0.68), 0 0 16px rgba(56, 189, 248, 0.55);
}

.pintodo-side-icon {
    font-size: 18px;
    line-height: 1;
}

.pintodo-side-count {
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(12, 17, 27, 0.78);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.pintodo-side-toggle.is-delivery-tab.has-active-items .pintodo-side-count {
    background: #ef4444;
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.75);
}

.pintodo-side-toggle.is-cash-tab.has-active-items .pintodo-side-count {
    background: #f59e0b;
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.75);
}

.pintodo-side-arrow {
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    opacity: 0.95;
}

/* Верхняя панель переключения 2 вкладок внутри бокового меню */
.pintodo-top-tabs-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    margin-bottom: 10px;
    border-radius: 13px;
    background: rgba(12, 17, 27, 0.85);
    border: 1px solid #26354d;
    flex-shrink: 0;
}

.pintodo-top-tab-btn {
    flex: 1;
    height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    transition: all 0.16s ease;
}

.pintodo-top-tab-btn:hover {
    color: #f8fafc;
    background: rgba(30, 41, 59, 0.75);
}

.pintodo-top-tab-btn.active[data-side-tab="delivery"] {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(14, 165, 233, 0.35);
}

.pintodo-top-tab-btn.active[data-side-tab="cash"] {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35);
}

.pintodo-top-tab-badge {
    min-width: 20px;
    height: 19px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.65);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.pintodo-top-tab-btn.active .pintodo-top-tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.pintodo-collapse-close-btn {
    width: 32px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.pintodo-collapse-close-btn:hover {
    background: #334155;
    color: #ffffff;
}

.pintodo-tab-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.pintodo-tab-pane.hidden {
    display: none !important;
}

#pintodoPaneCash .cash-audit-body {
    padding: 2px 3px 2px 0;
}

.pintodo-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.pintodo-archive-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.pintodo-archive-btn:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
    color: #ffffff;
}

.pintodo-archive-btn.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #0284c7 100%);
    border-color: #c4b5fd;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.45);
}

.pintodo-archive-pill {
    min-width: 20px;
    height: 19px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #34d399;
    font-size: 11.5px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.pintodo-archive-btn.active .pintodo-archive-pill {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
}

.pintodo-delivery-popup.is-archive-mode {
    border-color: #a78bfa;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 42px rgba(139, 92, 246, 0.34);
}

.pintodo-popup-title {
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pintodo-delivery-popup.is-archive-mode .pintodo-popup-title {
    color: #c4b5fd;
}

.pintodo-popup-main-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 12px 0;
    flex-shrink: 0;
}

.pintodo-popup-hero {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(90deg, #38bdf8 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.pintodo-popup-hero.bump {
    filter: brightness(1.18);
}

.pintodo-popup-delta {
    font-size: 13.5px;
    font-weight: 900;
    padding: 4px 11px;
    border-radius: 999px;
    opacity: 0;
    transform: translateY(8px) scale(0.9);
    transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.pintodo-popup-delta.up {
    opacity: 1;
    transform: translateY(0) scale(1);
    background: rgba(16, 185, 129, 0.25);
    color: #34d399;
    border: 1px solid #10b981;
}

.pintodo-popup-delta.down {
    opacity: 1;
    transform: translateY(0) scale(1);
    background: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
    border: 1px solid #f59e0b;
}

.pintodo-popup-stats {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 10px;
    background: rgba(12, 17, 27, 0.78);
    border: 1px solid #26354d;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.pintodo-stat-label {
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 600;
}

.pintodo-stat-val {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}

.pintodo-stat-val.is-amber {
    color: #fbbf24;
}

.pintodo-stat-val.is-emerald {
    color: #34d399;
}

.pintodo-delivery-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.pintodo-delivery-list::-webkit-scrollbar {
    width: 6px;
}

.pintodo-delivery-list::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 999px;
}

.pintodo-delivery-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border-radius: 13px;
    border: 1px solid rgba(42, 56, 82, 0.9);
    background: #131c2e;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background-color 0.18s ease, border-color 0.18s ease, opacity 0.2s ease, transform 0.2s ease;
}

.pintodo-delivery-card:nth-child(even) {
    background: #182234;
}

.pintodo-delivery-card:hover {
    background: #1f2d46;
    border-color: rgba(56, 189, 248, 0.58);
}

.pintodo-delivery-card.selected {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.3) 0%, rgba(16, 185, 129, 0.2) 100%) !important;
    border-color: #34d399 !important;
    box-shadow: 0 0 22px rgba(16, 185, 129, 0.28), inset 4px 0 0 #34d399;
}

.pintodo-delivery-card.is-collapsing {
    opacity: 0;
    transform: translateX(48px) scale(0.94);
    pointer-events: none;
}

.pintodo-chk-circle {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 2px solid #475569;
    background: rgba(12, 17, 27, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(148, 163, 184, 0.35);
    font-weight: 900;
    font-size: 16px;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
}

.pintodo-delivery-card:hover .pintodo-chk-circle {
    border-color: #38bdf8;
    color: rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.pintodo-delivery-card.selected .pintodo-chk-circle {
    background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
    border-color: #ffffff;
    color: #ffffff;
    transform: scale(1.12);
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.65);
}

.pintodo-card-main {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.pintodo-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pintodo-card-dist {
    font-size: 14.5px;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pintodo-card-badges {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.pintodo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.pintodo-badge.is-jump {
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.pintodo-badge.is-jump:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
}

.pintodo-badge.is-date {
    background: #233047;
    color: #cbd5e1;
}

.pintodo-badge.is-today {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.pintodo-card-items {
    font-size: 12.5px;
    color: #cbd5e1;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pintodo-card-note {
    font-size: 12px;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    padding: 2px 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pintodo-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 3px;
    border-top: 1px dashed rgba(56, 189, 248, 0.22);
    font-size: 12px;
}

.pintodo-card-sum {
    font-weight: 800;
    color: #38bdf8;
    font-variant-numeric: tabular-nums;
}

.pintodo-card-pay-status {
    font-weight: 700;
    font-size: 11.5px;
}

.pintodo-card-pay-status.is-paid {
    color: #34d399;
}

.pintodo-card-pay-status.is-debt {
    color: #f87171;
}

.pintodo-delivery-card.is-archived-card {
    background: rgba(19, 28, 46, 0.88);
    border-color: rgba(16, 185, 129, 0.35);
    cursor: default;
}

.pintodo-delivery-card.is-archived-card:hover {
    border-color: rgba(52, 211, 153, 0.65);
    background: rgba(24, 36, 58, 0.95);
}

.pintodo-chk-circle.is-sent-archive {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #6ee7b7;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
    cursor: pointer;
}

.pintodo-sent-time-bar {
    margin-top: 3px;
    padding: 5px 9px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.16) 0%, rgba(14, 165, 233, 0.12) 100%);
    border: 1px solid rgba(16, 185, 129, 0.38);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pintodo-sent-time-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 700;
    color: #a7f3d0;
    white-space: nowrap;
}

.pintodo-sent-time-text b {
    color: #ffffff;
    font-weight: 800;
}

.pintodo-restore-delivery-btn {
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: rgba(15, 23, 42, 0.72);
    color: #38bdf8;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.pintodo-restore-delivery-btn:hover {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
}

.pintodo-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 16px;
    border-radius: 14px;
    background: rgba(12, 17, 27, 0.65);
    border: 1px dashed #334155;
    text-align: center;
    color: #94a3b8;
    font-size: 13.5px;
    line-height: 1.5;
}

.pintodo-click-fx {
    position: fixed;
    pointer-events: none;
    z-index: 2500;
    font-weight: 900;
    font-size: 15px;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #10b981 0%, #0284c7 100%);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.55);
    animation: pintodoFloatUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pintodoFloatUp {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.82); }
    30% { opacity: 1; transform: translate(-50%, -115%) scale(1.08); }
    100% { opacity: 0; transform: translate(-50%, -195%) scale(0.95); }
}

.quick-scroll-jump-dock {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 930;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.94) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 16px;
    padding: 5px;
    box-shadow:
        0 10px 28px -6px rgba(15, 23, 42, 0.16),
        0 2px 6px rgba(37, 99, 235, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.92);
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.quick-scroll-jump-dock.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.quick-scroll-jump-dock:hover {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow:
        0 14px 34px -6px rgba(37, 99, 235, 0.22),
        0 4px 10px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 #ffffff;
}

.quick-scroll-jump-divider {
    width: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.45), transparent);
    pointer-events: none;
}

.quick-scroll-jump-dock:has(.quick-scroll-jump-down.hidden) .quick-scroll-jump-divider {
    display: none;
}

.quick-scroll-jump-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    border: none;
    background: transparent;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.quick-scroll-jump-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.quick-scroll-jump-btn:active {
    transform: scale(0.93);
}

.quick-scroll-jump-label {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 4px 10px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.quick-scroll-jump-btn:hover .quick-scroll-jump-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.quick-scroll-jump-btn.hidden {
    display: none !important;
}

/* ==================== СВЕРКА НАЛИЧНЫХ («НАЛ»), ЗАКРАШИВАНИЕ СТРОК КАК В EXCEL И КУПЮРНИК ==================== */
.cash-audit-open-btn {
    height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid #6ee7b7;
    background: #ecfdf5;
    color: #047857;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.cash-audit-open-btn:hover {
    background: #d1fae5;
    border-color: #10b981;
}

.cash-audit-open-btn.is-active {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #047857;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3);
}

.cash-audit-open-badge {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #f59e0b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

/* Палитра цветных маркеров (пачек денег) в верхней панели «Нал» — единая капсула под стиль Остатка */
.cash-toolbar-marker-palette {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #94a3b8;
}

.cash-marker-swatch-btn {
    height: 22px;
    min-width: 22px;
    padding: 0;
    border-radius: 999px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    transition: all 0.14s ease;
}

.cash-marker-swatch-btn.has-sum {
    padding: 0 8px 0 2px;
    border: 1px solid transparent;
}

.cash-marker-swatch-dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 900;
    line-height: 1;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.cash-marker-swatch-btn:hover .cash-marker-swatch-dot {
    transform: scale(1.1);
}

.cash-marker-swatch-btn.color-yellow .cash-marker-swatch-dot {
    background: #f59e0b;
}
.cash-marker-swatch-btn.color-yellow.has-sum {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}
.cash-marker-swatch-btn.color-yellow.is-active-brush .cash-marker-swatch-dot {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3.5px #d97706;
}

.cash-marker-swatch-btn.color-green .cash-marker-swatch-dot {
    background: #10b981;
}
.cash-marker-swatch-btn.color-green.has-sum {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}
.cash-marker-swatch-btn.color-green.is-active-brush .cash-marker-swatch-dot {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3.5px #059669;
}

.cash-marker-swatch-btn.color-blue .cash-marker-swatch-dot {
    background: #0ea5e9;
}
.cash-marker-swatch-btn.color-blue.has-sum {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #075985;
}
.cash-marker-swatch-btn.color-blue.is-active-brush .cash-marker-swatch-dot {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3.5px #0284c7;
}

.cash-marker-swatch-btn.color-purple .cash-marker-swatch-dot {
    background: #8b5cf6;
}
.cash-marker-swatch-btn.color-purple.has-sum {
    background: #f3e8ff;
    border-color: #c4b5fd;
    color: #5b21b6;
}
.cash-marker-swatch-btn.color-purple.is-active-brush .cash-marker-swatch-dot {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3.5px #7c3aed;
}

.cash-marker-swatch-btn.color-rose .cash-marker-swatch-dot {
    background: #f43f5e;
}
.cash-marker-swatch-btn.color-rose.has-sum {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #9f1239;
}
.cash-marker-swatch-btn.color-rose.is-active-brush .cash-marker-swatch-dot {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3.5px #e11d48;
}

.cash-clear-marks-toolbar-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    margin-left: 2px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #e2e8f0;
    color: #475569;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.14s ease;
}

.cash-clear-marks-toolbar-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

/* Кнопка закрашивания строки (как в Excel) в первой колонке таблицы «Нал» */
.cash-index-cell-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cash-row-mark-btn {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.14s ease;
}

.cash-row-mark-btn:hover {
    border-color: #64748b;
    background: #f8fafc;
    color: #0f172a;
}

.cash-row-mark-btn.is-marked.mark-yellow {
    border-color: #d97706;
    background: #f59e0b;
    color: #ffffff;
}
.cash-row-mark-btn.is-marked.mark-green {
    border-color: #059669;
    background: #10b981;
    color: #ffffff;
}
.cash-row-mark-btn.is-marked.mark-blue {
    border-color: #0284c7;
    background: #0ea5e9;
    color: #ffffff;
}
.cash-row-mark-btn.is-marked.mark-purple {
    border-color: #7c3aed;
    background: #8b5cf6;
    color: #ffffff;
}
.cash-row-mark-btn.is-marked.mark-rose {
    border-color: #e11d48;
    background: #f43f5e;
    color: #ffffff;
}

/* 5 цветов закрашивания строк в таблице «Нал» (пачки денег как в Excel) */
.global-table tbody tr.cash-mark-yellow td {
    background: #fef08a !important;
    border-bottom-color: #facc15 !important;
    color: #0f172a !important;
}
.global-table tbody tr.cash-mark-yellow:hover td {
    background: #fde047 !important;
}
.global-table tbody tr.cash-mark-yellow td:first-child {
    box-shadow: inset 6px 0 0 #d97706;
}

.global-table tbody tr.cash-mark-green td {
    background: #bbf7d0 !important;
    border-bottom-color: #4ade80 !important;
    color: #0f172a !important;
}
.global-table tbody tr.cash-mark-green:hover td {
    background: #86efac !important;
}
.global-table tbody tr.cash-mark-green td:first-child {
    box-shadow: inset 6px 0 0 #059669;
}

.global-table tbody tr.cash-mark-blue td {
    background: #bae6fd !important;
    border-bottom-color: #38bdf8 !important;
    color: #0f172a !important;
}
.global-table tbody tr.cash-mark-blue:hover td {
    background: #7dd3fc !important;
}
.global-table tbody tr.cash-mark-blue td:first-child {
    box-shadow: inset 6px 0 0 #0284c7;
}

.global-table tbody tr.cash-mark-purple td {
    background: #e9d5ff !important;
    border-bottom-color: #c084fc !important;
    color: #0f172a !important;
}
.global-table tbody tr.cash-mark-purple:hover td {
    background: #d8b4fe !important;
}
.global-table tbody tr.cash-mark-purple td:first-child {
    box-shadow: inset 6px 0 0 #7c3aed;
}

.global-table tbody tr.cash-mark-rose td {
    background: #fecdd3 !important;
    border-bottom-color: #fb7185 !important;
    color: #0f172a !important;
}
.global-table tbody tr.cash-mark-rose:hover td {
    background: #fda4af !important;
}
.global-table tbody tr.cash-mark-rose td:first-child {
    box-shadow: inset 6px 0 0 #e11d48;
}

/* Сетка цветных пачек внутри боковой панели «Сверка и Купюрник» (2 колонки, компактно) */
.cash-color-bundles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.cash-color-bundle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 9px;
    border: 1.5px solid #26354d;
    background: #0f172a;
    cursor: pointer;
    transition: all 0.14s ease;
}

.cash-color-bundle-row:hover {
    background: #1e293b;
}

.cash-color-bundle-row.is-active-brush {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.22);
}

.cash-color-bundle-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cash-color-bundle-dot {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
}

.cash-color-bundle-dot.dot-yellow { background: #f59e0b; }
.cash-color-bundle-dot.dot-green { background: #10b981; }
.cash-color-bundle-dot.dot-blue { background: #0ea5e9; }
.cash-color-bundle-dot.dot-purple { background: #8b5cf6; }
.cash-color-bundle-dot.dot-rose { background: #f43f5e; }

.cash-color-bundle-name {
    font-size: 12.5px;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
}

.cash-color-bundle-count {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.cash-color-bundle-right {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.cash-color-bundle-sum {
    font-size: 13.5px;
    font-weight: 900;
    color: #fde047;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cash-color-bundle-clear {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cash-color-bundle-clear:hover {
    background: #ef4444;
    border-color: #f87171;
    color: #ffffff;
}

.cash-date-handed-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 5px;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 800;
    flex-shrink: 0;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.14s ease;
}

.cash-date-handed-badge:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #b91c1c;
}

/* Боковая панель Сверки «Нал» и Купюрника */
.cash-audit-drawer {
    position: fixed;
    top: 72px;
    right: 18px;
    bottom: 18px;
    width: 475px;
    max-width: calc(100vw - 36px);
    z-index: 950;
    background: #0f172a;
    border: 2px solid #10b981;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 36px rgba(16, 185, 129, 0.25);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
}

.cash-audit-drawer.hidden {
    display: none !important;
}

.cash-audit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 16px;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.18) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-bottom: 1px solid #1e293b;
    flex-shrink: 0;
}

.cash-audit-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cash-audit-icon {
    font-size: 24px;
    line-height: 1;
}

.cash-audit-title {
    font-size: 15.5px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.cash-audit-subtitle {
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 1px;
}

.cash-audit-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.cash-audit-close-btn:hover {
    background: #ef4444;
    border-color: #f87171;
    color: #ffffff;
}

.cash-audit-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.cash-audit-section {
    background: #162033;
    border: 1px solid #26354d;
    border-radius: 13px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.cash-audit-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cash-audit-sec-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cash-audit-sec-title {
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.cash-audit-clear-marks-btn,
.cash-audit-mark-handed-btn,
.cash-audit-reset-bills-btn {
    height: 24px;
    padding: 0 9px;
    border-radius: 6px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.cash-audit-clear-marks-btn:hover {
    background: #f59e0b;
    border-color: #fbbf24;
    color: #0f172a;
}

.cash-audit-mark-handed-btn:hover {
    background: #10b981;
    border-color: #34d399;
    color: #ffffff;
}

.cash-audit-mark-handed-btn.is-undo-mode {
    background: rgba(244, 63, 94, 0.16);
    border-color: #f43f5e;
    color: #fda4af;
}

.cash-audit-mark-handed-btn.is-undo-mode:hover {
    background: #e11d48;
    border-color: #fb7185;
    color: #ffffff;
}

.cash-audit-reset-bills-btn:hover {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
}

.cash-audit-mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.cash-audit-mode-btn {
    padding: 7px 8px;
    border-radius: 9px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #cbd5e1;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: all 0.15s ease;
}

.cash-audit-mode-btn b {
    font-size: 12.5px;
    font-weight: 900;
    color: #38bdf8;
    font-variant-numeric: tabular-nums;
}

.cash-audit-mode-btn:hover {
    border-color: #38bdf8;
    color: #ffffff;
}

.cash-audit-mode-btn.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.24) 0%, rgba(16, 185, 129, 0.24) 100%);
    border-color: #fbbf24;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.cash-audit-mode-btn.active b {
    color: #fde047;
}

/* Список дней по Налу */
.cash-audit-days-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 3px;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.cash-day-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 9px;
    border-radius: 9px;
    border: 1px solid #26354d;
    background: #0f172a;
    cursor: pointer;
    transition: background 0.14s ease, border-color 0.14s ease;
}

.cash-day-item:hover {
    background: #1e293b;
    border-color: #475569;
}

.cash-day-item.is-day-marked {
    background: rgba(245, 158, 11, 0.2);
    border-color: #fbbf24;
}

.cash-day-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cash-day-check-indicator {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid #475569;
    background: #162033;
    color: transparent;
    font-size: 12px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cash-day-item.is-day-marked .cash-day-check-indicator {
    background: #f59e0b;
    border-color: #fde047;
    color: #ffffff;
}

.cash-day-date-text {
    font-size: 13px;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
}

.cash-day-count-sub {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    white-space: nowrap;
}

.cash-day-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cash-day-net-sum {
    font-size: 13px;
    font-weight: 900;
    color: #34d399;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cash-day-net-sum.is-neg {
    color: #f87171;
}

.cash-day-handed-toggle {
    height: 23px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid #475569;
    background: #1e293b;
    color: #cbd5e1;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.14s ease;
}

.cash-day-handed-toggle:hover {
    border-color: #38bdf8;
    color: #ffffff;
}

.cash-day-handed-toggle.is-handed {
    background: rgba(16, 185, 129, 0.22);
    border-color: #10b981;
    color: #34d399;
}

.cash-day-handed-toggle.is-handed:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: #f43f5e;
    color: #fda4af;
}

/* Купюрник (сетка номиналов Узбекского сума) */
.cash-bills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.cash-bill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 9px;
    border: 1px solid #26354d;
    background: #0f172a;
}

.cash-bill-row.has-val {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.cash-bill-denom {
    font-size: 12.5px;
    font-weight: 900;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 58px;
}

.cash-bill-input {
    width: 66px;
    height: 28px;
    padding: 0 6px;
    border-radius: 7px;
    border: 1px solid #334155;
    background: #162033;
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
    outline: none;
}

.cash-bill-input:focus {
    border-color: #38bdf8;
    background: #1e293b;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.cash-bill-sub {
    font-size: 11px;
    font-weight: 800;
    color: #34d399;
    font-variant-numeric: tabular-nums;
    text-align: right;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cash-extra-sum-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px dashed #26354d;
}

.cash-extra-label {
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    white-space: nowrap;
}

.cash-extra-input {
    flex: 1;
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    font-variant-numeric: tabular-nums;
    outline: none;
}

.cash-extra-input:focus {
    border-color: #38bdf8;
}

/* Итоговое табло сверки */
.cash-audit-verdict-card {
    background: #162033;
    border: 1.5px solid #334155;
    border-radius: 14px;
    padding: 11px 13px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex-shrink: 0;
}

.cash-verdict-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.cash-verdict-col {
    background: #0f172a;
    border: 1px solid #26354d;
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cash-verdict-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
}

.cash-verdict-val {
    font-size: 17px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
}

.cash-verdict-val.is-program {
    color: #38bdf8;
}

.cash-verdict-val.is-physical {
    color: #fbbf24;
}

.cash-verdict-sub {
    font-size: 10.5px;
    font-weight: 600;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.cash-verdict-banner {
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 900;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.cash-verdict-banner.is-neutral {
    background: #0f172a;
    border: 1px dashed #475569;
    color: #94a3b8;
}

.cash-verdict-banner.is-match {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.28) 0%, rgba(5, 150, 105, 0.35) 100%);
    border: 1.5px solid #10b981;
    color: #6ee7b7;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.3);
}

.cash-verdict-banner.is-shortage {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.25) 0%, rgba(185, 28, 28, 0.32) 100%);
    border: 1.5px solid #ef4444;
    color: #fca5a5;
}

.cash-verdict-banner.is-surplus {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.32) 100%);
    border: 1.5px solid #f59e0b;
    color: #fde68a;
}








