/* =====================================================================
   Кассиры ЦКС — стили страницы
   Используются переменные проекта (--primary, --surface, --border ...),
   поэтому тема (светлая/тёмная) подхватывается автоматически.
   ===================================================================== */

.cash-header-sub {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.1px;
}

/* ---------- KPI ---------- */
.cash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.cash-kpi {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background:
        radial-gradient(120% 120% at 100% 0%, var(--cash-tone-soft, rgba(153, 0, 0, 0.08)) 0%, transparent 62%),
        var(--surface);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: var(--text);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    overflow: hidden;
}

.cash-kpi::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--cash-tone, var(--primary));
    opacity: 0.85;
}

.cash-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.09);
    border-color: color-mix(in srgb, var(--cash-tone, var(--primary)) 35%, var(--border));
}

.cash-kpi.active {
    border-color: var(--cash-tone, var(--primary));
    box-shadow: 0 0 0 3px var(--cash-tone-soft, rgba(153, 0, 0, 0.12)), 0 10px 26px rgba(15, 23, 42, 0.08);
}

.cash-kpi-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: var(--cash-tone-soft, rgba(153, 0, 0, 0.1));
    color: var(--cash-tone, var(--primary));
    font-size: 1.02rem;
}

.cash-kpi-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cash-kpi-value {
    font-size: 1.32rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.4px;
}

.cash-kpi-label {
    margin-top: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cash-kpi[data-tone="primary"] { --cash-tone: var(--primary); --cash-tone-soft: rgba(var(--primary-rgb, 153, 0, 0), 0.1); }
.cash-kpi[data-tone="blue"]    { --cash-tone: #2563eb; --cash-tone-soft: rgba(37, 99, 235, 0.11); }
.cash-kpi[data-tone="amber"]   { --cash-tone: #d97706; --cash-tone-soft: rgba(217, 119, 6, 0.12); }
.cash-kpi[data-tone="green"]   { --cash-tone: #059669; --cash-tone-soft: rgba(5, 150, 105, 0.12); }
.cash-kpi[data-tone="red"]     { --cash-tone: #dc2626; --cash-tone-soft: rgba(220, 38, 38, 0.11); }
.cash-kpi[data-tone="slate"]   { --cash-tone: #475569; --cash-tone-soft: rgba(71, 85, 105, 0.1); }

[data-theme="dark"] .cash-kpi[data-tone="slate"] { --cash-tone: #94a3b8; --cash-tone-soft: rgba(148, 163, 184, 0.14); }

/* ---------- Бейдж отправок ---------- */
.cash-batch-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: 5px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1;
}

.cash-batch-badge:empty,
.cash-batch-badge[data-zero="1"] { display: none; }

/* ---------- Таблица ---------- */
#recordsView,
#batchesView {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#batchesView {
    overflow-y: auto;
    padding: 10px 28px 18px;
}

#recordsView .table-wrapper {
    min-height: 0;
}

#recordsView .table-container {
    padding-bottom: 46px;
}

.cash-table-wrap { width: 100%; }

.cash-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1000px;
}

.cash-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px 10px;
    background: var(--primary);
    color: #ffffff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    vertical-align: middle;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: none;
    white-space: normal;
    word-break: keep-all;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.cash-table thead th:hover { background: var(--primary-dark, var(--primary)); }
.cash-table thead th.sorted-asc,
.cash-table thead th.sorted-desc { background: var(--primary-dark, var(--primary)); }
.cash-table thead th.sorted-asc::after {
    content: "\f0dd";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.75rem;
    margin-left: 6px;
}
.cash-table thead th.sorted-desc::after {
    content: "\f0de";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.75rem;
    margin-left: 6px;
}
.cash-table thead th.no-sort { cursor: default; }
.cash-table thead th.no-sort:hover { background: var(--primary); }

.cash-table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.83rem;
    vertical-align: middle;
    color: var(--text);
}

.cash-table tbody tr {
    cursor: pointer;
    transition: background 0.13s ease;
}

.cash-table tbody tr:hover { background: var(--surface-2, rgba(148, 163, 184, 0.07)); }
.cash-table tbody tr:last-child td { border-bottom: none; }

.cash-person { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.cash-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--primary-rgb, 153, 0, 0), 0.14), rgba(var(--primary-rgb, 153, 0, 0), 0.04));
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.cash-person b { display: block; font-size: 0.84rem; line-height: 1.25; }
.cash-sub {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}
.cash-sub i { font-size: 0.58rem; opacity: 0.7; }

.cash-shop b { display: block; font-size: 0.83rem; }
.cash-branch {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.cash-code {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 7px;
    background: var(--surface-2, rgba(148, 163, 184, 0.1));
    border: 1px solid var(--border);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}
.cash-code.empty { color: var(--text-faint); border-style: dashed; background: transparent; }

.cash-updated { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* Статусы */
.cash-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.3;
    white-space: nowrap;
    border: 1px solid transparent;
}
.cash-status i { font-size: 0.64rem; }
.cash-status.works   { color: #065f46; background: rgba(5, 150, 105, 0.16); border-color: rgba(5, 150, 105, 0.35); }
.cash-status.added   { color: #1e40af; background: rgba(37, 99, 235, 0.15); border-color: rgba(37, 99, 235, 0.35); }
.cash-status.sent    { color: #92400e; background: rgba(217, 119, 6, 0.16); border-color: rgba(217, 119, 6, 0.35); }
.cash-status.created { color: #065f46; background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.38); }
.cash-status.error   { color: #991b1b; background: rgba(220, 38, 38, 0.14); border-color: rgba(220, 38, 38, 0.35); }
.cash-status.removed { color: #475569; background: rgba(100, 116, 139, 0.15); border-color: rgba(100, 116, 139, 0.32); }

/* Чип статуса в шапке карточки: белая подложка на цветном фоне */
.ds-hero .cash-status {
    background: #ffffff;
    color: #0f2338;
    border-color: rgba(255, 255, 255, 0.75);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
    font-size: 0.74rem;
    font-weight: 800;
}
.ds-hero .cash-status.works   { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.ds-hero .cash-status.added   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.ds-hero .cash-status.sent    { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.ds-hero .cash-status.created { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.ds-hero .cash-status.error   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.ds-hero .cash-status.removed { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }

[data-theme="dark"] .cash-status.works   { color: #6ee7b7; }
[data-theme="dark"] .cash-status.added   { color: #93c5fd; }
[data-theme="dark"] .cash-status.sent    { color: #fcd34d; }
[data-theme="dark"] .cash-status.created { color: #6ee7b7; }
[data-theme="dark"] .cash-status.error   { color: #fca5a5; }
[data-theme="dark"] .cash-status.removed { color: #cbd5e1; }

/* Выделение статуса в форме редактирования */
#recStatus.status-added   { border-color: rgba(37, 99, 235, 0.5); background: rgba(37, 99, 235, 0.1); color: #1d4ed8; font-weight: 700; }
#recStatus.status-removed { border-color: rgba(100, 116, 139, 0.45); background: rgba(100, 116, 139, 0.1); color: #475569; font-weight: 700; }
#recStatus.status-works   { border-color: rgba(5, 150, 105, 0.45); background: rgba(5, 150, 105, 0.1); color: #047857; font-weight: 700; }
#recStatus.status-error   { border-color: rgba(220, 38, 38, 0.45); background: rgba(220, 38, 38, 0.09); color: #b91c1c; font-weight: 700; }
#recStatus.status-sent    { border-color: rgba(217, 119, 6, 0.45); background: rgba(217, 119, 6, 0.1); color: #b45309; font-weight: 700; }
[data-theme="dark"] #recStatus.status-added   { color: #93c5fd; }
[data-theme="dark"] #recStatus.status-removed { color: #cbd5e1; }
[data-theme="dark"] #recStatus.status-works   { color: #6ee7b7; }
[data-theme="dark"] #recStatus.status-error   { color: #fca5a5; }
[data-theme="dark"] #recStatus.status-sent    { color: #fcd34d; }

/* Список паспортов в карточке */
.cash-passport-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.cash-passport-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2, var(--bg));
}
.cash-passport-item.selected { border-color: rgba(5, 150, 105, 0.45); background: rgba(5, 150, 105, 0.07); }
.cash-passport-item input[type="radio"] { flex: 0 0 auto; width: 15px; height: 15px; accent-color: #059669; cursor: pointer; }
.cash-passport-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cash-passport-main b { font-size: 0.75rem; font-weight: 700; word-break: break-word; }
.cash-passport-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.cash-passport-preview { flex-shrink: 0; font-size: 0.72rem; }
[data-theme="dark"] .cash-passport-item { background: rgba(255, 255, 255, 0.03); }

.cash-batch-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(217, 119, 6, 0.1);
    color: #b45309;
    font-size: 0.62rem;
    font-weight: 700;
    white-space: nowrap;
}
[data-theme="dark"] .cash-batch-tag { color: #fcd34d; }

/* Паспорт */
.cash-pass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 0.72rem;
}
.cash-pass.yes { color: #047857; background: rgba(5, 150, 105, 0.13); }
.cash-pass.no  { color: #b91c1c; background: rgba(220, 38, 38, 0.1); }
[data-theme="dark"] .cash-pass.yes { color: #6ee7b7; }
[data-theme="dark"] .cash-pass.no  { color: #fca5a5; }

.cash-actions { white-space: nowrap; text-align: right; }
.cash-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-left: 4px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.14s ease;
    font-size: 0.72rem;
}
.cash-icon-btn:hover { color: var(--primary); border-color: rgba(var(--primary-rgb, 153, 0, 0), 0.4); background: rgba(var(--primary-rgb, 153, 0, 0), 0.06); }
.cash-icon-btn.danger:hover { color: #dc2626; border-color: rgba(220, 38, 38, 0.4); background: rgba(220, 38, 38, 0.07); }

.cash-empty {
    padding: 54px 20px;
    text-align: center;
    color: var(--text-muted);
}
.cash-empty i { font-size: 2.4rem; opacity: 0.25; display: block; margin-bottom: 12px; }
.cash-empty b { display: block; font-size: 0.95rem; color: var(--text); margin-bottom: 4px; }
.cash-empty span { font-size: 0.8rem; }

/* ---------- Отправки ---------- */
.cash-batches-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}
.cash-batches-toolbar #newBatchBtn { flex-shrink: 0; white-space: nowrap; }
.cash-batches-title { font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.cash-batches-title i { color: var(--primary); }
.cash-batches-sub { margin-top: 3px; font-size: 0.76rem; color: var(--text-muted); }

.cash-batch-list { display: flex; flex-direction: column; gap: 10px; }

.cash-batch-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 18px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 3px 14px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.cash-batch-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
    border-color: rgba(var(--primary-rgb, 153, 0, 0), 0.3);
}

.cash-batch-main { flex: 1; min-width: 0; }
.cash-batch-number { font-size: 0.95rem; font-weight: 800; letter-spacing: -0.2px; }
.cash-batch-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 5px;
    font-size: 0.73rem;
    color: var(--text-muted);
}
.cash-batch-meta span { display: inline-flex; align-items: center; gap: 4px; }
.cash-batch-meta i { font-size: 0.62rem; opacity: 0.7; }

.cash-batch-results { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.cash-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
}
.cash-chip.ok { color: #047857; background: rgba(5, 150, 105, 0.12); }
.cash-chip.err { color: #b91c1c; background: rgba(220, 38, 38, 0.1); }
.cash-chip.pending { color: #b45309; background: rgba(217, 119, 6, 0.12); }
[data-theme="dark"] .cash-chip.ok { color: #6ee7b7; }
[data-theme="dark"] .cash-chip.err { color: #fca5a5; }
[data-theme="dark"] .cash-chip.pending { color: #fcd34d; }

/* ---------- Кнопки ---------- */
.cash-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}
.cash-btn:hover { border-color: rgba(var(--primary-rgb, 153, 0, 0), 0.4); color: var(--primary); }
.cash-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark, var(--primary)));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb, 153, 0, 0), 0.25);
}
.cash-btn.primary:hover { filter: brightness(1.05); color: #fff; transform: translateY(-1px); }
.cash-btn.ghost { background: transparent; }
.cash-btn.danger { color: #fff; background: #dc2626; border-color: transparent; }
.cash-btn.danger:hover { background: #b91c1c; color: #fff; }
.cash-btn.mini { padding: 6px 10px; font-size: 0.72rem; border-radius: 8px; }
.cash-btn.ok { color: #047857; border-color: rgba(5, 150, 105, 0.3); background: rgba(5, 150, 105, 0.07); }
.cash-btn.err { color: #b91c1c; border-color: rgba(220, 38, 38, 0.3); background: rgba(220, 38, 38, 0.06); }
.cash-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
[data-theme="dark"] .cash-btn.ok { color: #6ee7b7; }
[data-theme="dark"] .cash-btn.err { color: #fca5a5; }

/* ---------- Карточка (детали) ---------- */
#cashierDetail .sidebar-content { padding-top: 8px; }

.cash-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 0 4px;
}
.cash-detail-actions .cash-btn { flex: 1 1 auto; }

.cash-detail-value-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.cash-detail-copy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 7px;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.62rem;
    cursor: pointer;
}
.cash-detail-copy:hover { color: var(--primary); border-color: rgba(var(--primary-rgb, 153, 0, 0), 0.35); }

.cash-history-item {
    padding: 9px 10px;
    border-bottom: 1px dashed var(--border);
}
.cash-history-item:last-child { border-bottom: none; }
.cash-history-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cash-history-number { font-size: 0.76rem; font-weight: 700; }
.cash-history-meta { margin-top: 3px; font-size: 0.68rem; color: var(--text-muted); }
.cash-history-comment { margin-top: 4px; font-size: 0.7rem; color: var(--text-secondary); }

/* ---------- Модальные окна ---------- */
.cash-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
}
.cash-modal-backdrop.open { display: flex; animation: cashFadeIn 0.16s ease; }

.cash-modal {
    width: min(620px, 100%);
    max-height: min(90vh, 900px);
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.32);
    animation: cashSlideUp 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}
.cash-modal--sm { width: min(430px, 100%); }
.cash-modal--lg { width: min(820px, 100%); }
.cash-modal--xl { width: min(1100px, 100%); }

.cash-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(var(--primary-rgb, 153, 0, 0), 0.04), transparent);
}
.cash-modal-head h3 { margin: 0; font-size: 1.02rem; font-weight: 800; letter-spacing: -0.2px; }
.cash-modal-head p { margin: 4px 0 0; font-size: 0.76rem; color: var(--text-muted); }
.cash-modal-close {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.14s ease;
}
.cash-modal-close:hover { color: var(--primary); border-color: rgba(var(--primary-rgb, 153, 0, 0), 0.35); }

.cash-modal-body { padding: 18px 20px; overflow-y: auto; }
.cash-modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2, rgba(148, 163, 184, 0.04));
}
.cash-modal-foot .cash-btn:first-child { margin-right: auto; }

/* ---------- Формы ---------- */
.cash-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}
.cash-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cash-field--full { grid-column: 1 / -1; }
.cash-field label { font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); }
.cash-req { color: #dc2626; }
.cash-field input,
.cash-field select,
.cash-field textarea {
    width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--input-bg, var(--surface));
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.cash-field input:focus,
.cash-field select:focus,
.cash-field textarea:focus {
    outline: none;
    border-color: rgba(var(--primary-rgb, 153, 0, 0), 0.55);
}
.cash-field input[readonly] { background: var(--surface-2, rgba(148, 163, 184, 0.06)); color: var(--text-muted); }
.cash-field textarea { resize: vertical; min-height: 56px; }

.cash-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.07);
    border: 1px solid rgba(37, 99, 235, 0.14);
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.45;
}
.cash-hint i { color: #2563eb; margin-top: 2px; }
.cash-hint.warn { background: rgba(217, 119, 6, 0.08); border-color: rgba(217, 119, 6, 0.18); }
.cash-hint.warn i { color: #d97706; }
.cash-hint.ok { background: rgba(5, 150, 105, 0.09); border-color: rgba(5, 150, 105, 0.22); }
.cash-hint.ok i { color: #047857; }

.cash-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    padding: 0;
    border: none;
    background: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
}
.cash-link:hover { text-decoration: underline; }

/* ---------- Комбобокс ---------- */
.cash-combo { position: relative; }
.cash-combo-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--input-bg, var(--surface));
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.cash-combo-input:focus-within {
    border-color: rgba(var(--primary-rgb, 153, 0, 0), 0.55);
}
.cash-combo-input > i { font-size: 0.72rem; color: var(--text-muted); }
.cash-combo-input input {
    flex: 1;
    padding: 9px 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
}
.cash-combo-clear {
    border: none;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    padding: 4px;
    font-size: 0.72rem;
}
.cash-combo-clear:hover { color: var(--primary); }

.cash-combo-list {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 5px);
    max-height: 260px;
    overflow-y: auto;
    padding: 5px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.18);
    display: none;
}
.cash-combo-list.open { display: block; animation: cashFadeIn 0.12s ease; }
.cash-combo-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.12s ease;
}
.cash-combo-item:hover,
.cash-combo-item.active { background: var(--surface-2, rgba(148, 163, 184, 0.1)); }
.cash-combo-item .cash-avatar { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 8px; font-size: 0.6rem; }
.cash-combo-item-main { min-width: 0; flex: 1; }
.cash-combo-item-main b { display: block; font-size: 0.79rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cash-combo-item-main span { display: block; margin-top: 2px; font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cash-combo-item-badge {
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 700;
    background: rgba(5, 150, 105, 0.1);
    color: #047857;
}
.cash-combo-item-badge.off { background: rgba(100, 116, 139, 0.12); color: #64748b; }
[data-theme="dark"] .cash-combo-item-badge { color: #6ee7b7; }
[data-theme="dark"] .cash-combo-item-badge.off { color: #cbd5e1; }
.cash-combo-empty { padding: 12px 10px; text-align: center; font-size: 0.76rem; color: var(--text-muted); }

/* ---------- Импорт ---------- */
.cash-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 30px 18px;
    border-radius: 16px;
    border: 2px dashed var(--border);
    background: var(--surface-2, rgba(148, 163, 184, 0.04));
    text-align: center;
    cursor: pointer;
    transition: all 0.16s ease;
}
.cash-drop:hover,
.cash-drop.dragover {
    border-color: rgba(var(--primary-rgb, 153, 0, 0), 0.55);
    background: rgba(var(--primary-rgb, 153, 0, 0), 0.04);
}
.cash-drop i { font-size: 1.9rem; color: var(--primary); opacity: 0.8; }
.cash-drop b { font-size: 0.9rem; }
.cash-drop span { font-size: 0.76rem; color: var(--text-muted); }
.cash-drop em { margin-top: 4px; font-style: normal; font-size: 0.73rem; font-weight: 600; color: var(--text-secondary); word-break: break-all; }

.cash-import-cols { margin-top: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2, rgba(148, 163, 184, 0.04)); }
.cash-import-cols b { font-size: 0.76rem; }
.cash-import-col-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 7px; }
.cash-import-col-list span { padding: 2px 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-size: 0.66rem; font-weight: 600; color: var(--text-secondary); }
.cash-muted { font-size: 0.71rem; color: var(--text-muted); line-height: 1.45; }

.cash-import-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.cash-import-stat { padding: 10px; border-radius: 10px; background: var(--surface-2, rgba(148, 163, 184, 0.06)); border: 1px solid var(--border); text-align: center; }
.cash-import-stat b { display: block; font-size: 1.1rem; }
.cash-import-stat span { font-size: 0.66rem; color: var(--text-muted); }
.cash-import-warn { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(217, 119, 6, 0.08); border: 1px solid rgba(217, 119, 6, 0.2); font-size: 0.74rem; color: var(--text-secondary); max-height: 160px; overflow-y: auto; }
.cash-import-warn b { display: block; margin-bottom: 4px; color: #b45309; }
[data-theme="dark"] .cash-import-warn b { color: #fcd34d; }

/* ---------- Отправка: выбор записей ---------- */
.cash-batch-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 8px; }
.cash-batch-toolbar-left { display: flex; align-items: center; gap: 12px; }
.cash-batch-records { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.cash-batch-record { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.cash-batch-record:last-child { border-bottom: none; }
.cash-batch-record:hover { background: var(--surface-2, rgba(148, 163, 184, 0.06)); }
.cash-batch-record input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }
.cash-batch-record-main { flex: 1; min-width: 0; }
.cash-batch-record-main b { display: block; font-size: 0.8rem; }
.cash-batch-record-main span { display: block; margin-top: 2px; font-size: 0.69rem; color: var(--text-muted); }
.cash-batch-record .cash-pass { flex-shrink: 0; }
.cash-batch-record .cash-code { flex-shrink: 0; }

.cash-check { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.cash-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.cash-allow-missing { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(217, 119, 6, 0.08); border: 1px solid rgba(217, 119, 6, 0.18); align-items: flex-start; line-height: 1.4; }

.cash-passport-block {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px dashed var(--border);
    background: var(--surface-2, rgba(148, 163, 184, 0.04));
}
.cash-passport-block-head { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 800; margin-bottom: 4px; }
.cash-passport-block-head i { color: var(--primary); }
.cash-passport-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Детали отправки ---------- */
.cash-batch-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.cash-batch-summary .cash-import-stat { text-align: left; }
.cash-batch-files { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cash-batch-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2, rgba(148, 163, 184, 0.05));
    color: var(--text);
    text-decoration: none;
    font-size: 0.76rem;
    font-weight: 700;
    transition: all 0.14s ease;
}
.cash-batch-file:hover { border-color: rgba(var(--primary-rgb, 153, 0, 0), 0.4); color: var(--primary); }
.cash-batch-file i { color: var(--primary); }

.cash-items-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 0.78rem; }
.cash-items-table th { position: static; padding: 8px 9px; text-align: left; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); background: var(--surface-2, rgba(148, 163, 184, 0.06)); border-bottom: 1px solid var(--border); }
.cash-items-table td { padding: 8px 9px; border-bottom: 1px solid var(--border); }
.cash-items-table tr:last-child td { border-bottom: none; }

.cash-response-toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cash-response-list { display: flex; flex-direction: column; gap: 8px; }
.cash-response-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2, rgba(148, 163, 184, 0.04)); }
.cash-response-row-main { flex: 1; min-width: 0; }
.cash-response-row-main b { display: block; font-size: 0.8rem; }
.cash-response-row-main span { display: block; margin-top: 2px; font-size: 0.69rem; color: var(--text-muted); }
.cash-response-actions { display: flex; gap: 5px; flex-shrink: 0; }
.cash-response-comment { width: 220px; }
.cash-response-comment input { width: 100%; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--input-bg, var(--surface)); color: var(--text); font-family: inherit; font-size: 0.74rem; }
.cash-response-comment input:focus { outline: none; border-color: rgba(var(--primary-rgb, 153, 0, 0), 0.5); }

.cash-radio-group { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface); }
.cash-radio-group button { border: none; padding: 6px 10px; background: transparent; color: var(--text-secondary); font-family: inherit; font-size: 0.7rem; font-weight: 700; cursor: pointer; transition: all 0.12s ease; }
.cash-radio-group button + button { border-left: 1px solid var(--border); }
.cash-radio-group button.active.ok { background: rgba(5, 150, 105, 0.14); color: #047857; }
.cash-radio-group button.active.err { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
[data-theme="dark"] .cash-radio-group button.active.ok { color: #6ee7b7; }
[data-theme="dark"] .cash-radio-group button.active.err { color: #fca5a5; }

.cash-confirm-text { margin: 0; font-size: 0.86rem; line-height: 1.55; color: var(--text-secondary); white-space: pre-line; }

/* ---------- Уведомления ---------- */
#notification { position: fixed; top: 18px; right: 18px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.cash-toast {
    min-width: 260px;
    max-width: 380px;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.2);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 9px;
    pointer-events: auto;
    animation: cashSlideLeft 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.cash-toast i { margin-top: 2px; }
.cash-toast.success i { color: #059669; }
.cash-toast.error i { color: #dc2626; }
.cash-toast.warning i { color: #d97706; }
.cash-toast.info i { color: #2563eb; }
.cash-toast.out { animation: cashFadeOut 0.18s ease forwards; }

/* ---------- Анимации ---------- */
@keyframes cashFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cashFadeOut { to { opacity: 0; transform: translateX(10px); } }
@keyframes cashSlideUp { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes cashSlideLeft { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------- Адаптивность ---------- */
@media (max-width: 1280px) {
    .cash-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .header .org-name { display: none; }
    .cash-header-sub { display: none; }
    .header-right { gap: 8px; }
}

@media (max-width: 900px) {
    .cash-header-sub { display: none; }
    .cash-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }    .cash-batch-card { flex-wrap: wrap; }
    .cash-batch-results { width: 100%; justify-content: flex-start; }
    .cash-form-grid { grid-template-columns: 1fr; }
    .cash-field--full { grid-column: auto; }
    .cash-import-summary,
    .cash-batch-summary { grid-template-columns: repeat(2, 1fr); }
    .cash-modal { max-height: 94vh; }
    .cash-modal-backdrop { padding: 10px; }

    /* На узких экранах страница прокручивается целиком, таблица — внутри */
    body { overflow-y: auto; height: auto; }
    .container { height: auto; min-height: 100vh; overflow: visible; padding-bottom: 16px; }
    #recordsView, #batchesView { flex: none; min-height: 0; }
    #batchesView { padding: 10px 12px 16px; }
    .cash-batches-toolbar { padding: 12px 14px; }
    #recordsView .table-wrapper { flex: none; }
    #recordsView .table-container { height: 58vh; min-height: 260px; }
    .status-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .status-tab { flex: 0 0 auto; white-space: nowrap; }
}

@media (max-width: 760px) {
    .header-right { gap: 6px; }
    #refreshBtn { display: none !important; }
    #importBtn { font-size: 0; padding: 9px 10px; }
    #importBtn i { font-size: 0.86rem; }
    #cashierDetail { width: 100%; }
}

@media (max-width: 620px) {
    .cash-kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .cash-kpi { padding: 11px; border-radius: 13px; }
    .cash-kpi-icon { flex-basis: 34px; width: 34px; height: 34px; border-radius: 10px; font-size: 0.86rem; }
    .cash-kpi-value { font-size: 1.08rem; }
    .cash-kpi-label { font-size: 0.63rem; }
    .cash-batches-toolbar { flex-direction: column; align-items: flex-start; }
    .cash-response-row { flex-direction: column; align-items: stretch; }
    .cash-response-comment { width: 100%; }
    .cash-batch-summary,
    .cash-import-summary { grid-template-columns: 1fr 1fr; }
    .cash-modal-foot { flex-wrap: wrap; }
    .cash-modal-foot .cash-btn:first-child { margin-right: 0; }
}
