﻿/* Мобильная версия (телефоны). Компьютерный вид не затрагивается: файл подключён только для экранов до 760px. */

html { -webkit-text-size-adjust: 100%; }
a, button, summary, label, input, select, textarea { touch-action: manipulation; -webkit-tap-highlight-color: rgba(91, 91, 214, .16); }

/* Шапка: логотип сверху, ниже одна строка меню, которую можно листать пальцем */
.topbar { height: auto; min-height: 0; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; padding: 6px 8px 4px; }
.topbar .brand-nav { gap: 8px; padding: 2px 6px 0; }
.topbar .top-actions { flex-wrap: nowrap; justify-content: flex-start; gap: 2px; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.topbar .top-actions::-webkit-scrollbar { display: none; }
.topbar .top-actions .nav-link, .topbar .top-actions .linkbtn { flex: 0 0 auto; padding: 10px 12px; white-space: nowrap; }
.topbar .top-actions form { flex: 0 0 auto; margin: 0; }
.topbar .top-actions .sidebar-divider, .topbar .top-actions .sidebar-caption { display: none !important; }
.topbar .top-actions .user-name { display: inline-block !important; flex: 0 0 auto; margin: 0; padding: 10px 12px; border: 0; color: #d6d7dc; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: visible; }
.topbar .top-actions .section-link { display: none; }

/* Поля ввода: 16px, иначе iPhone приближает страницу при нажатии */
input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }

/* Кнопки и значки, в которые удобно попадать пальцем */
.btn { min-height: 40px; }
.edit-pencil { min-width: 40px; min-height: 40px; }
.entity-delete-trigger { min-width: 34px; min-height: 34px; }
.icon-btn { min-width: 38px; min-height: 38px; }
.status-filter-chip { min-height: 40px; }
.direct-status-segments { height: 14px; }
.direct-status-segments > .status-segment, .direct-status-segments > form > .status-segment { height: 14px; min-width: 26px; }
.column-option { padding-top: 8px; padding-bottom: 8px; }
.task-tab, .comment-view-switch a { min-height: 38px; }

/* Фильтры: дополнительные поля прячутся за кнопкой */
.advanced-filter-form { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
/* В колонке «flex» означал бы высоту (180px, 250px…): все блоки берут высоту по содержимому */
.advanced-filter-form > * { flex: 0 0 auto !important; width: 100%; max-width: none; height: auto !important; min-height: 0 !important; margin-top: 0; margin-bottom: 0; box-sizing: border-box; }
.advanced-filter-form > .status-filter-row { order: -2 !important; }
.advanced-filter-form > .filter-more-toggle { order: -1 !important; align-self: flex-start; width: auto; min-height: 36px !important; padding-top: 6px; padding-bottom: 6px; }
.advanced-filter-form > .filter-actions { width: auto; }
.advanced-filter-form > .filter-range, .advanced-filter-form > .date-filter { gap: 10px; }

/* Кнопка «Новый лид» на всю ширину и без наезда на панель фильтров */
.search-toolbar { grid-template-columns: minmax(0, 1fr) !important; gap: 10px; }
.search-toolbar .search-form { margin-bottom: 0 !important; }

/* Переключатель «Займы / Недвижимость / Все» в одну строку */
.deal-type-tabs { flex-direction: row !important; flex-wrap: wrap; gap: 8px; }
.deal-type-tabs .deal-type-tab { flex: 1 1 0; width: auto; min-width: 0; text-align: center; justify-content: center; padding-left: 8px; padding-right: 8px; }
.search-toolbar .new-lead-trigger, .search-toolbar a.btn.primary { width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none !important; }
.advanced-filter-form > .filter-more-toggle { margin-right: auto !important; }
.search-toolbar + .filter-panel, .filter-panel { margin-top: 12px !important; }

/* «Столбцы» и другие кнопки в заголовках таблиц компактнее */
.table-head { min-height: 0; padding-top: 8px; padding-bottom: 8px; }
.table-head summary.btn, .table-head .btn { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.advanced-filter-form:not(.filter-extras-open) > .filter-extra, .advanced-filter-form:not(.filter-extras-open) > .filter-actions { display: none !important; }
.advanced-filter-form.filter-extras-open > .filter-actions { order: 2; }

/* Окна (новый лид, причина отказа и т.д.) не шире экрана */
dialog, .lead-dialog, .conversion-dialog, .entity-delete-dialog { max-width: calc(100vw - 20px); box-sizing: border-box; }

/* Таблицы листаются пальцем */
.table-scroll, .calculator-table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

/* Календарь и результат расчёта */
.calculator-result-title::after { content: "Таблица листается вправо →"; display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: #7a828f; }
.calculator-table th:first-child, .calculator-table td:first-child { position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: 1px 0 0 #e8eaee; }
.calculator-table thead th:first-child { background: #f7f8fb; }

/* График статистики читаемый: шире экрана, листается пальцем */
.chart-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-svg { min-width: 680px; }
/* Кликабельные телефоны и мессенджеры (только на телефонах и планшетах) */
.contact-link { color: #5b5bd6; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; padding: 6px 0; -webkit-tap-highlight-color: rgba(91, 91, 214, .2); }

