/* ============================================================
   Qarz Daftari · Debt Book — веб-версия (desktop-first, светлая тема)
   Двухпанельный макет: список клиентов слева, детали/статистика справа.
   ============================================================ */

:root {
    color-scheme: light;
    --bg: #f1f3f6;
    --bg-grad-1: #ecfdf5;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef1f5;
    --border: #e6e8ec;
    --border-strong: #d6dae0;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-faint: #94a3b8;
    --primary: #10b981;
    --primary-600: #059669;
    --primary-700: #047857;
    --primary-soft: #ecfdf5;
    --primary-soft-border: #c7f0dd;
    --danger: #ef4444;
    --danger-600: #dc2626;
    --danger-soft: #fef2f2;
    --danger-soft-border: #fbd5d5;
    --warning: #f59e0b;
    --warning-soft: #fffbeb;
    --info: #3b82f6;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 4px 16px rgba(15, 23, 42, .08);
    --shadow-lg: 0 18px 48px rgba(15, 23, 42, .18);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 22px;
    --header-h: 62px;
    --left-w: 380px;
    --right-maxw: 900px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--primary); color: #fff; }

.mobile-only { display: none !important; }
.desktop-only { display: inline-flex; }

/* ---------- Spinner ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin .7s linear infinite; }
.spinner.sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 16px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 14.5px;
    background: var(--surface-3); color: var(--text);
    transition: transform .08s ease, background .15s ease, box-shadow .15s ease, opacity .15s, border-color .15s;
    white-space: nowrap; user-select: none; border: 1px solid transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -8px var(--primary); }
.btn-primary:hover { background: var(--primary-600); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-600); }
.btn-soft { background: var(--surface); border-color: var(--border); }
.btn-soft:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-block { width: 100%; }
.btn-lg { height: 50px; font-size: 16px; border-radius: var(--radius); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 11px; }
.btn-icon.btn-sm { width: 34px; height: 34px; }
.btn-debt { background: var(--danger-soft); color: var(--danger-600); border-color: var(--danger-soft-border); }
.btn-debt:hover { background: var(--danger); color: #fff; border-color: transparent; }
.btn-pay { background: var(--primary-soft); color: var(--primary-700); border-color: var(--primary-soft-border); }
.btn-pay:hover { background: var(--primary); color: #fff; border-color: transparent; }

/* ============================================================
   Поля ввода
   ============================================================ */
.field { display: block; margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 7px; }
.input, .textarea, .select {
    width: 100%; height: 46px; padding: 0 14px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s; font-size: 15px;
}
.textarea { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.select {
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
.input-money { font-size: 26px; font-weight: 700; height: 60px; letter-spacing: -.5px; }

.segment { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-3); border-radius: 12px; border: 1px solid var(--border); }
.segment.full { display: flex; }
.segment.full > button { flex: 1; }
.segment > button { height: 38px; padding: 0 16px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--text-muted); transition: all .15s; white-space: nowrap; }
.segment > button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segment.accent > button.active { background: var(--primary); color: #fff; }

/* ============================================================
   Каркас приложения: header + две панели
   ============================================================ */
.app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.header { flex: none; z-index: 30; display: flex; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); }
.header-top { height: var(--header-h); display: flex; align-items: center; gap: 14px; padding: 0 20px; }
.top-nav { display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; border-top: 1px solid var(--border); scrollbar-width: none; -ms-overflow-style: none; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav-item { display: inline-flex; align-items: center; gap: 7px; padding: 11px 13px; font-size: 14px; font-weight: 600; color: var(--text-muted); white-space: nowrap; flex: none; border-bottom: 2px solid transparent; transition: color .12s; }
.top-nav-item svg { width: 18px; height: 18px; flex: none; }
.top-nav-item:hover { color: var(--text); }
.top-nav-item.active { color: var(--primary-600); border-bottom-color: var(--primary-600); }
.brand { cursor: pointer; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.3px; }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-700)); box-shadow: 0 6px 14px -6px var(--primary); }
.brand .logo svg { width: 21px; height: 21px; }
.brand .name { font-size: 16px; }
.brand .name small { display: block; font-size: 11px; font-weight: 600; color: var(--text-faint); letter-spacing: 0; }
.header .spacer { flex: 1; }
.header .shop-select { height: 40px; min-width: 180px; max-width: 240px; }

.app-links { display: flex; gap: 8px; align-items: center; }
.app-badge { display: inline-flex; border-radius: 7px; transition: opacity .15s, transform .1s; }
.app-badge:hover { opacity: .82; }
.app-badge:active { transform: scale(.97); }
.store-badge { height: 36px; width: auto; display: block; }

.tg-link { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 10px; color: var(--text); font-size: 13px; font-weight: 600; transition: background .15s; white-space: nowrap; }
.tg-link:hover { background: var(--surface-3); }
.tg-link svg { width: 18px; height: 18px; color: #229ED9; flex: none; }
.tg-link .tg-role { color: var(--text-faint); font-weight: 600; }

.lang-toggle { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; border: 1px solid var(--border); }
.lang-toggle button { padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--text-faint); }
.lang-toggle button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.menu-wrap { position: relative; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-700)); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; padding: 6px; animation: pop .12s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.dropdown .dd-head { padding: 10px 12px; }
.dropdown .dd-head .nm { font-weight: 700; }
.dropdown .dd-head .sub { font-size: 13px; color: var(--text-muted); }
.dropdown .dd-sep { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown .dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; font-weight: 500; font-size: 14px; text-align: left; }
.dropdown .dd-item:hover { background: var(--surface-3); }
.dropdown .dd-item svg { width: 18px; height: 18px; color: var(--text-muted); }
.dropdown .dd-item.danger { color: var(--danger); }
.dropdown .dd-item.danger svg { color: var(--danger); }

.layout { flex: 1; display: flex; min-height: 0; }

/* ---------- Левая панель: список ---------- */
.left-pane { width: var(--left-w); flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.left-head { flex: none; padding: 16px 16px 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 11px; }
.left-top { display: flex; align-items: center; justify-content: space-between; }
.left-top .ttl { font-size: 16px; font-weight: 800; letter-spacing: -.3px; }
.left-top .ttl .cnt { font-size: 13px; font-weight: 600; color: var(--text-faint); margin-left: 6px; }
.left-tools { display: flex; gap: 8px; }
.left-tools .search { flex: 1; }
.left-tools .sort-select { flex: none; width: 44px; padding: 0; }
.left-list { flex: 1; overflow-y: auto; min-height: 0; }

.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-faint); pointer-events: none; }
.search .input { padding-left: 40px; height: 44px; }
.search .clear { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--text-faint); }
.search .clear:hover { background: var(--surface-3); color: var(--text); }

/* компактная иконка-кнопка сортировки с нативным select поверх */
.sort-wrap { position: relative; flex: none; }
.sort-wrap .sort-btn { width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; color: var(--text-muted); }
.sort-wrap .sort-btn:hover { border-color: var(--border-strong); }
.sort-wrap .sort-btn svg { width: 19px; height: 19px; }
.sort-wrap select { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 12px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); transition: all .15s; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--border-strong); }
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .cnt { font-size: 11px; opacity: .7; }
.chip-manage { background: var(--surface-3); color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; }
.chip-manage svg { width: 15px; height: 15px; }

/* Управление папками */
.folder-rows { display: flex; flex-direction: column; }
.folder-row { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--border); }
.folder-row:last-child { border-bottom: none; }
.folder-row .fr-ic { color: var(--text-faint); display: inline-flex; flex: none; }
.folder-row .fr-ic svg { width: 18px; height: 18px; }
.folder-row .fr-name { flex: 1; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-row .fr-cnt { font-size: 12px; font-weight: 700; color: var(--text-faint); background: var(--surface-3); padding: 2px 9px; border-radius: 999px; flex: none; }

/* Выбор папок в форме клиента */
.folder-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.folder-toggle { cursor: pointer; }
.folder-toggle.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Настройки */
.modal-card.settings-modal { max-width: 600px; }
.settings-tabs { display: flex; gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--border); flex: none; }
.settings-tab { padding: 13px 14px; font-weight: 600; font-size: 14px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.settings-tab.active { color: var(--primary-700); border-bottom-color: var(--primary); }
.settings-tab:hover { color: var(--text); }

.shop-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.shop-card-head { display: flex; align-items: center; gap: 12px; }
.shop-card-head .sc-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-muted); flex: none; }
.shop-card-head .sc-ic svg { width: 20px; height: 20px; }
.sc-info { flex: 1; min-width: 0; }
.sc-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-sub { font-size: 12.5px; color: var(--text-faint); margin-top: 1px; }
.sc-section { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.sc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); margin-bottom: 8px; }
.cashier-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 14px; }
.cashier-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--border); }
.acc-row .acc-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.acc-row .acc-val { font-weight: 600; }

/* Аналитика: график и мини-списки */
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 12px; }
.chart-head .segment { padding: 3px; }
.chart-head .segment > button { height: 30px; padding: 0 12px; font-size: 13px; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.chart-svg { width: 100%; height: 150px; display: block; }
.chart-legend { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .lg::before { content: ''; width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-legend .lg-debt::before { background: var(--danger); }
.chart-legend .lg-pay::before { background: var(--primary); }
.chart-legend .chart-max { margin-left: auto; color: var(--text-faint); font-weight: 700; }
.chart-empty { text-align: center; color: var(--text-faint); padding: 46px 0; font-size: 14px; }

.mini-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); width: 100%; text-align: left; background: transparent; transition: background .12s; }
.mini-row:last-child { border-bottom: none; }
.mini-row:hover { background: var(--surface-2); }
.mini-av { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; }
.mini-meta { flex: 1; min-width: 0; }
.mini-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-sub { font-size: 12px; color: var(--text-faint); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row .amount { font-size: 14px; flex: none; }

/* строки клиентов */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background .12s; text-align: left; width: 100%; background: transparent; position: relative; }
.row:hover { background: var(--surface-2); }
.row.active { background: var(--primary-soft); }
.row.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.row .meta { flex: 1; min-width: 0; }
.row .nm { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.row .nm .tx-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .nm .pin { width: 13px; height: 13px; color: var(--warning); flex: none; }
.row .sub { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .bal { text-align: right; flex: none; max-width: 46%; }

.avatar { width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; background-size: cover; background-position: center; }

.amount { font-weight: 800; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.amount.owe { color: var(--danger); }
.amount.credit { color: var(--primary-600); }
.amount.zero { color: var(--text-faint); }
.amount-sub { font-size: 12px; font-weight: 700; margin-top: 1px; }
.bal-label { font-size: 10.5px; color: var(--text-faint); font-weight: 600; margin-top: 1px; }

.load-more { margin: 14px auto; display: block; }

/* ---------- Правая панель ---------- */
.right-pane { flex: 1; overflow-y: auto; background: var(--bg); min-height: 0; }
.right-inner { max-width: var(--right-maxw); margin: 0 auto; padding: 26px 28px 60px; }
.right-center { height: 100%; display: grid; place-items: center; }

.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-faint); margin: 26px 2px 12px; }
.overview-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.overview-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.overview-head .muted { color: var(--text-faint); font-size: 14px; }

/* ============================================================
   Карточки статистики
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat.wide { grid-column: span 2; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat .lbl { font-size: 12.5px; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .lbl svg { width: 15px; height: 15px; }
.stat .val { font-size: 24px; font-weight: 800; margin-top: 9px; letter-spacing: -.5px; line-height: 1.15; }
.stat .val.sub { font-size: 15px; font-weight: 700; color: var(--text-muted); margin-top: 3px; }
.stat.accent { background: linear-gradient(135deg, var(--primary), var(--primary-700)); border-color: transparent; color: #fff; }
.stat.accent .lbl { color: rgba(255, 255, 255, .85); }
.stat.accent .val.sub { color: rgba(255, 255, 255, .85); }
.stat.accent-owe { background: linear-gradient(135deg, #6366F1, #8B5CF6); border-color: transparent; color: #fff; }
.stat.accent-owe .lbl { color: rgba(255, 255, 255, .85); }
.stat.accent-owe .val.sub { color: rgba(255, 255, 255, .85); }
.stat.danger .val { color: var(--danger); }
.period-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface-2); margin-top: 18px; }
.period-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.period-group-head .section-title { margin: 0; }
.period-group .chart-head { margin: 18px 0 12px; }
.stat .pill { position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--danger-soft); color: var(--danger-600); }

/* ---------- Пустое состояние ---------- */
.empty { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty .ic { width: 64px; height: 64px; border-radius: 20px; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 16px; }
.empty .ic svg { width: 30px; height: 30px; color: var(--text-faint); }
.empty h3 { font-size: 17px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 14px; max-width: 300px; margin: 0 auto 18px; }
.empty.list-empty { padding: 40px 20px; }

/* ============================================================
   Карточка клиента (правая панель)
   ============================================================ */
.detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-muted); padding: 8px 12px 8px 8px; border-radius: 10px; }
.back-btn:hover { background: var(--surface-3); color: var(--text); }
.back-btn svg { width: 19px; height: 19px; }
.head-actions { display: flex; gap: 6px; margin-left: auto; }

.cust-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm); }
.cust-top { display: flex; align-items: center; gap: 18px; }
.cust-top .avatar { width: 72px; height: 72px; border-radius: 22px; font-size: 27px; flex: none; }
.cust-top .ci { min-width: 0; }
.cust-top .cname { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.cust-top .cphone { color: var(--text-muted); font-size: 14px; margin-top: 3px; display: inline-flex; align-items: center; gap: 6px; }
.cust-top .cphone svg { width: 14px; height: 14px; }
.cust-card .cnotes { color: var(--text-muted); font-size: 14px; margin-top: 16px; padding: 12px 16px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--border); }

.balances { display: flex; gap: 14px; margin-top: 22px; }
.bal-box { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.bal-box .l { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.bal-box .v { font-size: 24px; font-weight: 800; margin-top: 5px; letter-spacing: -.5px; }
.bal-box .s { font-size: 11.5px; font-weight: 600; margin-top: 2px; color: var(--text-faint); }

.cust-actions { display: flex; gap: 14px; margin-top: 22px; }
.cust-actions .btn { flex: 1; height: 52px; font-size: 15px; }
.cust-actions + * { margin-top: 22px; }

/* ---------- Транзакции ---------- */
.tx-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.tx { border-bottom: 1px solid var(--border); }
.tx:last-child { border-bottom: none; }
.tx-main { display: flex; align-items: center; gap: 14px; padding: 15px 18px; width: 100%; text-align: left; background: transparent; transition: background .12s; }
.tx-main:hover { background: var(--surface-2); }
.tx .tx-ic { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; }
.tx .tx-ic svg { width: 19px; height: 19px; }
.tx-ic.debt { background: var(--danger-soft); color: var(--danger-600); }
.tx-ic.payment { background: var(--primary-soft); color: var(--primary-700); }
.tx .tx-meta { flex: 1; min-width: 0; }
.tx .tx-type { font-weight: 600; font-size: 14.5px; }
.tx .tx-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; word-break: break-word; }
.tx .tx-date { font-size: 12px; color: var(--text-faint); margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tx .tx-right { text-align: right; flex: none; }
.tx .tx-amt { font-weight: 800; white-space: nowrap; font-size: 15px; }
.tx-amt.owe { color: var(--danger); }
.tx-amt.credit { color: var(--primary-600); }
.due-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-muted); }
.due-badge svg { width: 11px; height: 11px; }
.due-badge.overdue { background: var(--danger-soft); color: var(--danger-600); }
.edit-hint { width: 18px; height: 18px; color: var(--text-faint); opacity: 0; transition: opacity .15s; flex: none; }
.tx-main:hover .edit-hint { opacity: 1; }
.tx-thumbs { display: flex; gap: 6px; padding: 0 18px 12px 72px; flex-wrap: wrap; }
.tx-thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; cursor: pointer; border: 1px solid var(--border); transition: transform .1s; }
.tx-thumb:hover { transform: scale(1.05); }
.tx-more { font-size: 12px; font-weight: 700; color: var(--text-faint); align-self: center; }

/* Аватар с загрузкой */
.avatar-wrap { position: relative; flex: none; }
.avatar-edit { position: relative; overflow: hidden; cursor: pointer; padding: 0; }
.avatar-edit .av-cam { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.avatar-edit:hover .av-cam { opacity: 1; }
.avatar-edit .av-cam svg { width: 16px; height: 16px; color: #fff; }
.av-del { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--danger); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.av-del svg { width: 13px; height: 13px; }

/* Сетка фото */
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-cell { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.photo-cell .ph-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.photo-cell .ph-del svg { width: 12px; height: 12px; }

/* Лайтбокс */
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; animation: fade .15s ease; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox .lb-close { position: fixed; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; display: grid; place-items: center; }
.lightbox .lb-close svg { width: 22px; height: 22px; }

/* Вкладки карточки клиента */
.cust-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 24px 0 16px; }
.cust-tab { padding: 11px 16px; font-weight: 600; font-size: 14.5px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.cust-tab.active { color: var(--primary-700); border-bottom-color: var(--primary); }
.cust-tab:hover { color: var(--text); }

/* Заметки */
.notes-list { display: flex; flex-direction: column; gap: 12px; }
.note-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.note-by { font-size: 12px; color: var(--text-faint); font-weight: 600; }
.note-acts { display: flex; gap: 2px; }
.note-text { margin-top: 8px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.note-card .photo-grid { margin-top: 10px; }

/* SMS история */
.sms-hist { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.sms-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.sms-meta { font-size: 11.5px; color: var(--text-faint); font-weight: 600; }
.sms-txt { font-size: 13px; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }

/* ============================================================
   Модалки
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal-card { width: 100%; max-width: 460px; max-height: calc(100vh - 40px); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; animation: modal-in .2s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 20px 20px 6px; }
.modal-head h2 { font-size: 19px; font-weight: 800; letter-spacing: -.3px; flex: 1; }
.modal-head .x { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--text-muted); flex: none; }
.modal-head .x:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px 20px; display: flex; gap: 10px; }
.modal-foot .btn { flex: 1; }
.confirm-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin: 6px auto 14px; background: var(--danger-soft); color: var(--danger); }
.confirm-icon svg { width: 26px; height: 26px; }
.confirm-text { text-align: center; }
.confirm-text h2 { font-size: 18px; margin-bottom: 6px; }
.confirm-text p { color: var(--text-muted); font-size: 14px; }

/* ============================================================
   Тосты
   ============================================================ */
#toast-root { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px 24px; pointer-events: none; }
.toast { pointer-events: auto; max-width: 440px; display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--surface); padding: 13px 18px; border-radius: 13px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; animation: toast-in .25s cubic-bezier(.2, .9, .3, 1.1); }
.toast.out { animation: toast-out .2s ease forwards; }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.success svg { color: var(--primary); }
.toast.error svg { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(16px); } }

/* ============================================================
   Аутентификация
   ============================================================ */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 18px; background-image: radial-gradient(1100px 560px at 50% -10%, var(--bg-grad-1), transparent 70%); }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 32px 28px; animation: fade .3s ease; }
.auth-logo { width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-700)); box-shadow: 0 12px 26px -10px var(--primary); }
.auth-logo svg { width: 33px; height: 33px; }
.auth h1 { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.auth .tagline { text-align: center; color: var(--text-muted); font-size: 14px; margin-top: 6px; margin-bottom: 24px; }
.auth .segment.full { margin-bottom: 20px; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--text-faint); margin-top: 20px; }
.auth-apps { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; }
.auth-apps-label { font-size: 12.5px; font-weight: 600; color: var(--text-faint); margin-bottom: 12px; }
.auth-apps-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.auth-apps .store-badge { height: 40px; }
.code-inputs { display: flex; gap: 10px; justify-content: center; margin: 8px 0 4px; }
.code-inputs input { width: 56px; height: 64px; text-align: center; font-size: 26px; font-weight: 800; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.code-inputs input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.auth-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-weight: 600; font-size: 14px; margin-bottom: 16px; cursor: pointer; }
.auth-back svg { width: 18px; height: 18px; }
.sent-to { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.sent-to b { color: var(--text); }
.link-btn { color: var(--primary-600); font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.field-err { color: var(--danger); font-size: 13px; margin-top: 8px; text-align: center; font-weight: 500; }
.lang-floating { position: fixed; top: 18px; right: 18px; }

/* ============================================================
   Скелетоны
   ============================================================ */
.skel { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.skel-av { width: 42px; height: 42px; border-radius: 13px; flex: none; }
.skel-line { height: 12px; }

/* ============================================================
   Адаптив: на узких экранах сворачиваем в одну панель
   ============================================================ */
@media (max-width: 920px) {
    .app { height: auto; min-height: 100vh; overflow: visible; }
    .header { position: sticky; top: 0; padding: 0 14px; gap: 10px; }
    .header .shop-select { min-width: 130px; max-width: 160px; }
    .brand .name { font-size: 15px; }
    .app-links { display: none; }
    .tg-link .tg-text { display: none; }
    .tg-link { padding: 7px; }
    .layout { display: block; min-height: 0; }
    .left-pane { width: auto; border-right: none; }
    .left-list { overflow: visible; }
    .right-pane { overflow: visible; background: var(--bg); }
    .right-inner { padding: 18px 16px 80px; }
    .mobile-only { display: inline-flex !important; }
    .desktop-only { display: none !important; }
    body.qd-detail .left-pane { display: none; }
    body.qd-list .right-pane { display: none; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .cust-actions { position: sticky; bottom: 0; }
}

@media (max-width: 560px) {
    .modal { align-items: flex-end; padding: 0; }
    .modal-card { max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh; animation: sheet-in .26s cubic-bezier(.2, .9, .3, 1); }
    @keyframes sheet-in { from { transform: translateY(100%); } }
    .modal-foot { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
    .cust-top { flex-direction: column; text-align: center; gap: 12px; }
    .cust-top .head-actions { margin: 0; }
    .balances { flex-direction: column; }
}

/* ===== Pro / касса / насия ===== */
.btn-pro-badge { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-weight: 700; font-size: 14px; cursor: pointer; }
.btn-pro-badge svg { width: 17px; height: 17px; }
.btn-pro-badge:hover { background: #fdecc8; }
.dd-pro-tag { margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: .5px; color: #fff; background: var(--warning); padding: 2px 6px; border-radius: 6px; }
.head-title { font-size: 20px; font-weight: 700; color: var(--text); }
.btn-block { width: 100%; justify-content: center; }
.nasiya-btn { margin-top: 10px; }

.pro-page { text-align: center; }
.pro-hero { padding: 14px 0 8px; }
.pro-hero-ic { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: var(--warning-soft); color: var(--warning); }
.pro-hero-ic svg { width: 34px; height: 34px; }
.pro-hero h1 { font-size: 26px; margin: 0 0 6px; }
.pro-hero p { color: var(--text-muted); margin: 0; }
.pro-benefits { display: flex; flex-direction: column; gap: 10px; margin: 22px 0; text-align: left; }
.pro-benefit { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-weight: 600; }
.pro-benefit svg { width: 20px; height: 20px; color: var(--primary-600); flex-shrink: 0; }
.pro-cta { margin: 10px 0; height: 50px; font-size: 16px; }
.pro-buy-hint { color: var(--text-muted); font-size: 14px; margin: 18px 0 12px; }
.pro-store-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pro-tg-btn { background: #229ED9; color: #fff; gap: 8px; height: 48px; font-size: 15px; }
.pro-tg-btn svg { width: 20px; height: 20px; }
.pro-tg-btn:hover { background: #1d8ec2; }
.pro-active-card { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--primary-soft); border: 1px solid var(--primary-soft-border); border-radius: var(--radius-sm); text-align: left; }
.pro-active-card svg { width: 22px; height: 22px; color: var(--primary-600); flex-shrink: 0; }
.pro-active-card .sub { color: var(--text-muted); font-size: 13px; font-weight: 500; }

.cash-filter { margin: 14px 0; }
.cash-sum-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 6px; }
.cash-sum-l { color: var(--text-faint); font-size: 13px; }
.cash-sum-bal { font-size: 26px; font-weight: 800; margin: 4px 0; }
.cash-sum-row { display: flex; gap: 16px; font-weight: 600; font-size: 14px; }
.cash-row .tx-desc { color: var(--text-muted); font-size: 13px; }

.inst-row .nm { font-weight: 600; }
.inst-row .sub { color: var(--text-muted); font-size: 13px; }
.inst-meta { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.inst-meta > div { display: flex; justify-content: space-between; font-size: 14px; }
.inst-meta span { color: var(--text-muted); }
.section-title { font-size: 15px; font-weight: 700; margin: 20px 0 10px; }
.inst-schedule { display: flex; flex-direction: column; gap: 8px; }
.inst-pay-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.inst-pay-info .nm { font-weight: 600; }
.inst-pay-info .sub { font-size: 12px; }

/* ============================================================
   Торговый модуль (товары · продажи · склад · поставщики · сотрудники)
   ============================================================ */
.tx-row:not(.cash-row) { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.tx-row:not(.cash-row) > .tx-main { flex: 1; width: auto; min-width: 0; padding: 0; gap: 12px; }
.tx-row:not(.cash-row) > .tx-main:hover { background: transparent; }
.tx-row:not(.cash-row) + .tx-row:not(.cash-row) { border-top: 1px solid var(--border); }
.tx-row[data-action] { cursor: pointer; transition: background .12s; }
.tx-row[data-action]:hover { background: var(--surface-2); }
.tx-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; word-break: break-word; }

.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

.detail-info { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 16px; margin-bottom: 12px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-l { color: var(--text-muted); font-size: 14px; }
.info-v { font-weight: 500; text-align: right; }

.cat-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.cat-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 14px; background: var(--surface-3); border-radius: var(--radius-sm); cursor: pointer; }
.cat-item:hover { background: var(--surface-2); }

.bal-row { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.bal-card { flex: 1; min-width: 150px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.bal-card span { font-size: 13px; color: var(--text-muted); }
.bal-card b { font-size: 18px; }

.trade-search { margin-bottom: 10px; }

.prod-thumb { width: 42px; height: 42px; flex: none; border-radius: 10px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--text-muted); }
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-thumb svg { width: 22px; height: 22px; }
.prod-stock { font-weight: 700; white-space: nowrap; font-size: 15px; }

.prod-photo-cell { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.prod-photo-prev { width: 64px; height: 64px; border-radius: 12px; background: var(--surface-3); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--text-muted); }
.prod-photo-prev img { width: 100%; height: 100%; object-fit: cover; }

.sale-form { margin-top: 8px; }
.sale-table-head { display: flex; gap: 6px; font-size: 12px; color: var(--text-muted); padding: 6px 2px; margin-top: 6px; }
.sale-table-head span:first-child { flex: 1; }
.sale-table-head span:nth-child(2) { width: 64px; }
.sale-table-head span:nth-child(3) { width: 90px; }
.sale-table-head span:last-child { width: 38px; }
.sale-row { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 6px; }
.sale-row .input { margin: 0; height: 44px; }
.sale-name-wrap { position: relative; flex: 1; min-width: 0; }
.sale-row .sale-qty { width: 64px; flex: none; }
.sale-row .sale-price { width: 90px; flex: none; }
.sale-row .sale-del { flex: none; height: 44px; }
.sale-sug { position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; display: none; }
.sale-sug-item { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; cursor: pointer; font-size: 14px; }
.sale-sug-item:hover { background: var(--surface-2); }
.sale-sug-item span { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.sale-add-actions { display: flex; gap: 8px; margin: 8px 0; }
.sale-total-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 2px; font-size: 16px; font-weight: 700; border-top: 1px solid var(--border); margin-top: 8px; }

.emp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.emp-actions .btn { flex: 1; min-width: 120px; }

/* Кнопка-меню в шапке + футер */
.menu-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; background: var(--surface-3); color: var(--text); font-weight: 600; font-size: 14px; transition: background .15s; }
.menu-btn:hover { background: var(--border); }
.menu-btn svg { width: 20px; height: 20px; flex: none; }

.app-footer { flex: none; display: flex; align-items: center; justify-content: center; gap: 16px 22px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.app-footer .app-links { display: flex; }
.app-footer .tg-link .tg-text { display: inline; }
@media (max-width: 560px) {
    .menu-btn-label { display: none; }
    .menu-btn { padding: 0 11px; }
    .app-footer { gap: 10px 16px; padding: 9px 12px; }
    .app-footer .store-badge { height: 34px; }
}

/* ============================================================
   SMS-напоминания должникам
   ============================================================ */
.sms-banner { display: flex; gap: 14px; align-items: flex-start; padding: 16px; margin-bottom: 18px; border: 1px solid var(--primary-soft-border); border-radius: var(--radius); background: linear-gradient(135deg, var(--primary-soft), var(--surface)); }
.sms-banner-skeleton { min-height: 96px; border-color: var(--border); background: var(--surface-2); }
.sms-banner-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--primary); color: #fff; }
.sms-banner-ic svg { width: 22px; height: 22px; }
.sms-banner-main { flex: 1; min-width: 0; }
.sms-banner-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; font-weight: 700; color: var(--text); }
.sms-banner-sub { margin-top: 3px; font-size: 13px; color: var(--text-muted); }
.sms-banner-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; font-size: 13px; color: var(--text-muted); }
.sms-banner-stats b { color: var(--text); font-size: 14px; }
.sms-banner-warn { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--danger-soft); color: var(--danger-600); font-size: 13px; }
.sms-banner-warn svg { width: 16px; height: 16px; flex: none; }
.sms-banner-actions { flex: none; display: flex; flex-direction: column; gap: 8px; }
.sms-chip { padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-muted); font-size: 12px; font-weight: 600; }
.sms-chip.on { background: var(--primary); color: #fff; }
.sms-chip.off { background: var(--surface-3); color: var(--text-muted); }
.sms-chip.new { background: var(--primary-soft); color: var(--primary-700); }
@media (max-width: 720px) {
    .sms-banner { flex-wrap: wrap; }
    .sms-banner-actions { flex-direction: row; width: 100%; }
    .sms-banner-actions .btn { flex: 1; }
}

/* Мастер настройки */
.sms-steps { display: flex; gap: 6px; padding: 0 18px 12px; border-bottom: 1px solid var(--border); }
.sms-step { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-faint); white-space: nowrap; }
.sms-step + .sms-step::before { content: ''; width: 14px; height: 1px; background: var(--border-strong); }
.sms-step-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); font-size: 12px; font-weight: 700; }
.sms-step-n svg { width: 13px; height: 13px; }
.sms-step.active { color: var(--text); font-weight: 600; }
.sms-step.active .sms-step-n { background: var(--primary); color: #fff; }
.sms-step.done .sms-step-n { background: var(--primary-soft); color: var(--primary-700); }
.sms-toggle { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 14px; cursor: pointer; }
.sms-recipients { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sms-recipient { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.sms-recipient:last-child { border-bottom: none; }
.sms-recipient-phone { color: var(--text-muted); font-size: 13px; }
.sms-recipient-debt { font-weight: 600; white-space: nowrap; }
.sms-preview { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; line-height: 1.55; }
.sms-note { margin-top: 8px; font-size: 13px; color: var(--text-muted); }
.sms-warn { display: flex; gap: 8px; margin-top: 12px; padding: 11px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger-600); font-size: 13px; line-height: 1.5; }
.sms-warn svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* Отчёты и пакеты */
.sms-report-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.sms-stat { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.sms-stat-label { font-size: 13px; color: var(--text-muted); }
.sms-stat-value { margin-top: 4px; font-size: 24px; font-weight: 700; }
.sms-stat-sub { margin-top: 2px; font-size: 12px; color: var(--text-faint); }
.sms-rows { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.sms-row { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--border); font-size: 14px; }
.sms-row:last-child { border-bottom: none; }
.sms-row > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sms-row-sub { color: var(--text-muted); font-size: 13px; }
.sms-row-msg { flex-direction: column; align-items: stretch; gap: 5px; }
.sms-row-text { font-size: 14px; line-height: 1.5; }
.sms-row-meta { font-size: 12px; color: var(--text-muted); }
.sms-badge { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-muted); }
.sms-badge.active { background: var(--primary-soft); color: var(--primary-700); }
.sms-badge.pending { background: #fef3c7; color: #b45309; }
.sms-badge.cancelled, .sms-badge.expired { background: var(--surface-3); color: var(--text-faint); }
.sms-packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.sms-package { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: center; }
.sms-package-count { font-size: 18px; font-weight: 700; }
/* Кнопка покупки — главное действие карточки: крупная, с ценой в подписи */
.sms-package-buy { height: 46px; font-size: 14px; font-weight: 700; }
.sms-package-buy svg { width: 17px; height: 17px; flex: none; }
.sms-package-price { font-size: 15px; font-weight: 600; color: var(--primary-700); }
.sms-package-sub { font-size: 12px; color: var(--text-muted); }
.sms-package .btn { margin-top: 8px; }
.sms-cust-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sms-mode { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 14px; cursor: pointer; }
.sms-mode:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.modal-card.modal-wide { max-width: 560px; }
.sms-buy-pkg { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 14px; margin-bottom: 12px; border-radius: var(--radius-sm); background: var(--primary-soft); border: 1px solid var(--primary-soft-border); }
.sms-buy-pkg b { font-size: 18px; }
.sms-buy-pkg span { font-weight: 600; color: var(--primary-700); }
.sms-buy-text { font-size: 14px; line-height: 1.55; color: var(--text-muted); }

/* Оплата пакета: реквизиты карты и загрузка чека */
.sms-pay-step { margin: 16px 0 8px; font-size: 13px; font-weight: 700; color: var(--text); }
.sms-pay-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sms-pay-hint { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
/* Реквизиты — главное на экране оплаты, поэтому карточка выделена цветом */
.sms-card { padding: 16px; margin-bottom: 10px; border: 1px solid var(--primary-soft-border); border-radius: var(--radius-sm); background: var(--primary-soft); }
.sms-card-label { font-size: 12px; font-weight: 600; color: var(--primary-700); text-transform: uppercase; letter-spacing: .04em; }
/* Номер длинный: моноширинный шрифт и разрядка — чтобы сверять по цифрам */
/* Шестнадцать цифр с разрядкой в узкий экран одной строкой не влезали */
.sms-card-num { margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: .02em; color: var(--text); user-select: all; white-space: nowrap; }
@media (max-width: 380px) { .sms-card-num { font-size: 19px; } }
.sms-card-holder { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; }
.sms-copy-card { height: 46px; font-size: 15px; font-weight: 700; }
.sms-copy-card.copied { background: var(--primary-700); border-color: var(--primary-700); }
.sms-copied-note { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-700); font-size: 13px; font-weight: 600; }
.sms-copied-note svg { width: 16px; height: 16px; flex: none; }
/* Чек — обязательный второй шаг, поэтому это зона, а не мелкая кнопка */
.sms-receipt-drop { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 2px dashed var(--primary-soft-border); border-radius: var(--radius-sm); background: var(--surface); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.sms-receipt-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.sms-receipt-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--primary); color: #fff; }
.sms-receipt-ic svg { width: 20px; height: 20px; }
.sms-receipt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sms-receipt-text b { font-size: 15px; color: var(--text); }
.sms-receipt-text span { font-size: 13px; line-height: 1.4; color: var(--text-muted); }
/* Живой контакт прямо на экране оплаты: перевод руками легко сделать не так */
.sms-pay-help { margin-top: 16px; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.sms-pay-help-text { margin-bottom: 10px; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.sms-pay-waiting { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-700); font-size: 13px; font-weight: 600; }
.sms-pay-waiting svg { width: 16px; height: 16px; flex: none; }

/* Выбор кассы: логотип узнают быстрее названия, поэтому он первый */
.pay-methods { display: flex; flex-direction: column; gap: 8px; }
.pay-method { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.pay-method:hover { border-color: var(--border-strong); }
.pay-method.active { border-color: var(--primary); background: var(--primary-soft); }
.pay-method-logo { width: 76px; height: 26px; flex: none; object-fit: contain; object-position: left center; font-size: 14px; font-weight: 700; color: var(--text); }
.pay-method-name { flex: 1; font-size: 15px; font-weight: 600; color: var(--text); }
/* Галочка занимает место всегда: без этого строки прыгали при выборе */
.pay-method-mark { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--surface-3); color: transparent; }
.pay-method-mark svg { width: 14px; height: 14px; }
.pay-method.active .pay-method-mark { background: var(--primary); color: #fff; }

/* Касса в песочнице: настоящих денег не будет, и это должно быть заметно */
.pay-test { margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: var(--warning-soft); color: #b45309; font-size: 11px; font-weight: 700; letter-spacing: .04em; }

/* Ожидание подтверждения кассы */
.pay-wait { display: grid; place-items: center; padding: 6px 0 16px; }

/* «Чек отправлен»: объясняем ожидание, а не просто закрываем окно */
.sms-sent { text-align: center; }
.sms-sent-ic { display: grid; place-items: center; width: 52px; height: 52px; margin: 4px auto 12px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-700); }
.sms-sent-ic svg { width: 26px; height: 26px; }
.sms-sent h2 { font-size: 19px; margin-bottom: 8px; }
.sms-sent-text { font-size: 14px; line-height: 1.55; color: var(--text-muted); }
.sms-sent-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; text-align: left; }
.sms-sent-hint { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--text-faint); }

/* История покупок: заявки и пакеты со статусами */
.sms-history { display: flex; flex-direction: column; gap: 10px; }
.sms-hist { display: flex; flex-direction: column; gap: 4px; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.sms-hist-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sms-hist-top b { font-size: 15px; }
.sms-hist-sub { font-size: 13px; color: var(--text-muted); }
.sms-hist-note { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--primary-700); }
.sms-hist .btn { margin-top: 8px; align-self: flex-start; }

/* Покупка Pro на главной: широкая кнопка над блоками напоминаний */
.pro-banner { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; margin-bottom: 10px; border: 1px solid var(--primary); border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%); color: #fff; text-align: left; cursor: pointer; }
.pro-banner:hover { filter: brightness(1.05); }
.pro-banner-ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 11px; background: rgba(255,255,255,.2); }
.pro-banner-ic svg { width: 19px; height: 19px; }
.pro-banner-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pro-banner-title { font-size: 15px; font-weight: 700; }
.pro-banner-sub { font-size: 13px; opacity: .9; }
.pro-banner-arrow { display: grid; place-items: center; opacity: .8; }
.pro-banner-arrow svg { width: 18px; height: 18px; }

/* Компактные строки напоминаний на главной: SMS и звонки — отдельно */
.sms-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: left; transition: border-color .15s, background .15s; }
.sms-row:hover { border-color: var(--primary-soft-border); background: var(--primary-soft); }
.sms-row-ic { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--primary); color: #fff; }
.sms-row-ic.call { background: var(--info, #3b82f6); }
.sms-row-ic svg { width: 17px; height: 17px; }
.sms-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sms-row-note { font-size: 12px; line-height: 1.35; color: var(--text-muted); }
.sms-row-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sms-row-main .sms-row-title { flex: none; overflow: visible; white-space: normal; text-overflow: clip; }
.sms-row-balance { font-size: 13px; font-weight: 700; color: var(--primary-700); white-space: nowrap; }
.sms-row-balance.empty { color: var(--danger-600); }
.sms-row-arrow { display: grid; place-items: center; color: var(--text-faint); }
.sms-row-arrow svg { width: 17px; height: 17px; }

/* Страница SMS: действия, быстрый выбор дней, покупка */
.sms-report-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.sms-buy-btn { height: 46px; font-size: 15px; font-weight: 700; }
.sms-link { display: block; width: 100%; margin-top: 14px; padding: 9px 0; font-size: 13px; color: var(--text-muted); text-align: center; text-decoration: underline; text-underline-offset: 3px; }
.sms-link:hover { color: var(--text); }
.sms-day-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sms-day-chip { padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text-muted); }
.sms-day-chip:hover { border-color: var(--border-strong); }
.sms-day-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.sms-buy-note { margin: 16px 0 10px; padding: 13px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; line-height: 1.55; color: var(--text-muted); }

/* Оферта: обязательный экран, закрыть его нельзя */
.offer-text { font-size: 14px; line-height: 1.6; color: var(--text); margin-bottom: 12px; }
.offer-list { margin: 0 0 14px; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.offer-list li { font-size: 13.5px; line-height: 1.55; color: var(--text-muted); }
.offer-link { display: inline-block; font-size: 14px; font-weight: 600; color: var(--primary-700); }

/* Демо звонка: услышать пример до покупки честнее, чем прочитать описание */
.call-demo { margin: 4px 0 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.call-demo-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.call-demo-head svg { width: 17px; height: 17px; color: var(--primary); }
.call-demo audio { width: 100%; }
/* SMS показываем «пузырём»: так видно, что приходит она не с личного номера */
.sms-sample-bubble { padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--primary-soft-border); font-size: 13.5px; line-height: 1.55; color: var(--text); }

/* Пакеты SMS и звонков считаются раздельно, поэтому и выбираются раздельно */
.sms-pkg-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; }
.sms-pkg-tab { flex: 1; height: 38px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--text-muted); transition: all .15s; }
.sms-pkg-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.spinner-inline { display: inline-block; width: 16px; height: 16px; border-width: 2px; vertical-align: middle; }

/* Подсказка на карточке клиента */
.sms-cust-label { display: flex; align-items: center; gap: 7px; }
.sms-help-btn { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); color: var(--text-muted); font-size: 11px; font-weight: 800; line-height: 1; }
.sms-help-btn:hover { background: var(--primary); color: #fff; }
.sms-help-text p { margin-bottom: 10px; font-size: 14px; line-height: 1.6; }
.sms-help-text p:last-child { margin-bottom: 0; }
.phone-input { display: flex; align-items: stretch; }
.phone-prefix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border); border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--surface-2); color: var(--text-muted); font-size: 15px; font-weight: 600; }
.phone-input .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.sms-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.sms-switch-text { font-size: 14px; font-weight: 600; color: var(--text); }
.sms-switch { position: relative; appearance: none; width: 46px; height: 27px; flex: none; border-radius: 999px; background: var(--surface-3); transition: background .18s; cursor: pointer; }
.sms-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.sms-switch:checked { background: var(--primary); }
.sms-switch:checked::after { transform: translateX(19px); }

/* ============================================================
   Карточка товара, штрих-коды и печать этикеток
   ============================================================ */
.prod-card-top { display: flex; gap: 14px; align-items: flex-start; padding: 14px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.prod-card-photo { display: grid; place-items: center; width: 92px; height: 92px; flex: none; overflow: hidden; border-radius: 12px; background: var(--surface-2); color: var(--text-faint); }
.prod-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.prod-card-photo svg { width: 30px; height: 30px; }
.prod-card-info { flex: 1; min-width: 0; }
.prod-card-name { font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--text); }
.prod-card-cat { margin-top: 3px; font-size: 13px; color: var(--text-muted); }
.prod-card-price { margin-top: 7px; font-size: 19px; font-weight: 800; color: var(--primary-700); }
.prod-card-stock { margin-top: 5px; font-size: 13px; font-weight: 600; }
.prod-card-stock.ok { color: var(--primary-600); }
.prod-card-stock.out { color: var(--danger); }

/* Блок со штрих-кодом: сам код, подпись и действия под ним */
.barcode-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 14px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.barcode-img { max-width: 100%; height: auto; background: #fff; border-radius: 6px; }
.barcode-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; letter-spacing: 2px; color: var(--text-muted); }
.barcode-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }

/* Выбор товаров для печати */
.lb-check { display: flex; align-items: center; gap: 9px; padding: 9px 2px; font-size: 14px; color: var(--text); cursor: pointer; }
.lb-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.lb-row { cursor: pointer; }
.lb-row.on { border-color: var(--primary-soft-border); background: var(--primary-soft); }
.lb-mark { display: grid; place-items: center; width: 22px; height: 22px; flex: none; margin-right: 10px; border: 1.5px solid var(--border-strong); border-radius: 6px; color: #fff; }
.lb-row.on .lb-mark { background: var(--primary); border-color: var(--primary); }
.lb-mark svg { width: 14px; height: 14px; }

/* ============================================================
   Реквизиты накладной (сворачиваемый блок)
   ============================================================ */
.wb-block { margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.wb-block > summary { display: flex; align-items: center; gap: 9px; padding: 13px 14px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; list-style: none; }
.wb-block > summary::-webkit-details-marker { display: none; }
.wb-block > summary svg { width: 18px; height: 18px; flex: none; color: var(--primary-600); }
.wb-block[open] > summary { border-bottom: 1px solid var(--border); }
.wb-body { padding: 14px; }

/* ============================================================
   Голосовые заметки к долгу
   ============================================================ */
.voice-list { display: flex; flex-direction: column; gap: 8px; }
.voice-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.voice-item.pending { border-style: dashed; border-color: var(--primary-soft-border); background: var(--primary-soft); }
.voice-item.recording { border-color: var(--danger-soft-border); background: var(--danger-soft); }
.voice-item.compact { padding: 7px 10px; }
.voice-play { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--primary); color: #fff; }
.voice-play:hover { background: var(--primary-600); }
.voice-play svg { width: 15px; height: 15px; }
.voice-dur { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-muted); white-space: nowrap; }
.voice-del { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; color: var(--text-faint); }
.voice-del:hover { background: var(--danger-soft); color: var(--danger); }
.voice-del svg { width: 14px; height: 14px; }
.voice-rec-label { flex: 1; font-size: 13px; font-weight: 600; color: var(--danger-600); }
.voice-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--danger); animation: voice-pulse 1s infinite; }
@keyframes voice-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* Столбики громкости — рисуем то, что сняли при записи */
.wave { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; height: 26px; overflow: hidden; }
.wave i { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: var(--primary-soft-border); }
.voice-item.recording .wave i { background: var(--danger-soft-border); }
.tx-voices { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 10px 54px; }

/* Сегмент выбора способа оплаты в модалках */
.pay-seg button { font-size: 13px; }

/* Запись голосовой удержанием микрофона */
.voice-hold { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.voice-hold.recording .voice-mic { background: var(--danger); transform: scale(1.08); }
.voice-mic { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--primary); color: #fff; cursor: pointer; transition: background .15s, transform .12s; -webkit-user-select: none; user-select: none; touch-action: none; }
.voice-mic:hover { background: var(--primary-600); }
.voice-mic svg { width: 20px; height: 20px; pointer-events: none; }
.voice-hold-text { display: flex; flex-direction: column; gap: 1px; }
.voice-hold-text b { font-size: 14px; color: var(--text); }
.voice-hold-text span { font-size: 12px; color: var(--text-muted); }

/* Индикатор идущей записи */
.voice-item.recording .wave.live i { background: var(--danger); opacity: .75; }
.voice-item.recording.will-cancel { background: var(--danger-soft); border-color: var(--danger-soft-border); }
.voice-item.recording .voice-rec-label { flex: none; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.voice-item.recording.will-cancel .voice-rec-label { color: var(--danger); }

/* Сканер отдельным блоком в шапке меню */
.dd-scanner { display: flex; align-items: center; gap: 12px; width: calc(100% - 16px); margin: 8px; padding: 12px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--primary-600)); color: #fff; text-align: left; box-shadow: 0 4px 14px rgba(16, 185, 129, .3); }
.dd-scanner:hover { filter: brightness(1.06); }
.dd-scanner-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.dd-scanner-ic svg { width: 22px; height: 22px; }
.dd-scanner-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dd-scanner-text b { font-size: 15px; font-weight: 700; }
.dd-scanner-text small { font-size: 12px; opacity: .88; }
.dd-scanner-pro { flex: none; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .25); font-size: 10px; font-weight: 800; }
