html {
  position: relative;
  min-height: 100%;
}
body {
  /* Margin bottom by footer height */
  margin-bottom: 60px;
}

span.glyphicon-pencil {
    font-size: 1.4em;
}

span.glyphicon-remove {
    font-size: 1.4em;
}
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  /* Set the fixed height of the footer here */
  height: 60px;
  background-color: #f5f5f5;
}

/* === Navbar offset — единая CSS-переменная ===
   --navbar-h обновляется JS-ом (base.html ResizeObserver на .navbar-fixed-top).
   На страницах с navbar в обычном flow JS ставит --navbar-h:0px.
   Десктоп И мобила используют ОДНУ переменную — никаких @media-override.
   Раньше mobile @media зануляли margin-top, и контент налезал на fixed
   navbar при открытом accordion (resize не фиксится → JS не пересчитывал). */
:root { --navbar-h: 64px; --subheader-h: 0px; }
.maincontent
{
    /* margin-bottom: 100px; */
}
.col-xs-12.maincontent { margin-top: var(--navbar-h) !important; }

/* Desktop: на страницах с .fix_menu (toolbar position:fixed top:var(--navbar-h))
   in-flow content (collapses, panel-body) должен начинаться НИЖЕ subheader'а,
   иначе sticky thead на top:calc(navbar+subheader) визуально наезжает на
   первую карточку tbody. Раньше использовалась цепная sibling-magic
   (~ .collapse ~ .panel-body { 0 }), которая для DOM мониторинга занулял
   margin у единственной .panel-body → баг.

   Новый подход — padding-top на .panel.calls (КОНТЕЙНЕР). Это смещает ВСЕ
   in-flow дети вниз на высоту subheader'а, независимо от порядка/видимости
   sibling'ов. fix_menu сам position:fixed → padding parent на него не влияет.
   На mobile .fix_menu = position:relative → --subheader-h=0 → padding=0. */
@media (min-width: 601px) {
    .panel.calls {
        padding-top: var(--subheader-h, 50px);
    }
}

/* === Sticky table header (мониторинг + все .iswork_table-таблицы) ============
   Level 1: navbar — position:fixed, высота → --navbar-h (ResizeObserver)
   Level 2: subheader .panel-heading.fix_menu — position:fixed at top:--navbar-h,
            высота → --subheader-h (ResizeObserver)
   Level 3: thead th — position:sticky прямо под subheader'ом

   z-index ОБЯЗАН быть < 1000 (Bootstrap .dropdown-menu default = 1000), иначе
   при открытии Actions/Color dropdown'a в первой строке tbody меню перекрывается
   sticky-заголовком и пользователь видит «наезд». Раньше было 1029 → визуально
   читалось как «thead перекрывает первую карточку тендера».

   tbody/tr/td не имеют z-index → sticky thead со своим stacking context'ом
   корректно покрывает прокручиваемые строки даже при низком z-index'е. */
.iswork_table thead th {
    position: -webkit-sticky;
    position: sticky;
    top: calc(var(--navbar-h, 64px) + var(--subheader-h, 0px));
    z-index: 10;
    background: #f5f5f5;
    box-shadow: inset 0 -1px 0 #ddd;
}

.col-xs-12 {
    padding:0px
    
}
.container
{
    min-width: 1300px !important;
    max-width: 100%;
	/* margin-top: 5px; */

}

.cont {
	padding-top: 5px;	
}

.fix_menu {
    /* T3 v3 + Oscar feedback: используем динамическую --navbar-h из base.html
       ResizeObserver (fallback 64px). Subheader sticky прямо под navbar при
       прокрутке таблицы мониторинга, не налезает и не прячется. */
    top: var(--navbar-h, 64px); z-index:1031;
    padding-left: 15px; padding-right: 15px; width:100%;
}

.fix_filter{
    
    top:180px; z-index:1031;    padding-left: 15px;
    padding-right: 15px; width:100%
}

.header
{
    
    padding-right: 0;
    padding-left: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #BBCAD4;
background: rgba(244,247,247,1);
background: -moz-linear-gradient(top, rgba(244,247,247,1) 0%, rgba(230,234,235,1) 100%);
background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(244,247,247,1)), color-stop(100%, rgba(230,234,235,1)));
background: -webkit-linear-gradient(top, rgba(244,247,247,1) 0%, rgba(230,234,235,1) 100%);
background: -o-linear-gradient(top, rgba(244,247,247,1) 0%, rgba(230,234,235,1) 100%);
background: -ms-linear-gradient(top, rgba(244,247,247,1) 0%, rgba(230,234,235,1) 100%);
background: linear-gradient(to bottom, rgba(244,247,247,1) 0%, rgba(230,234,235,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f7f7', endColorstr='#e6eaeb', GradientType=0 );
}
.logo
{
    float: left;
}

.logo img
{
    width: 200px;
}

.logo a:hover
{
    text-decoration: none;
}
.menu
{
    /* Horizontally scroll the navbar when icons would otherwise wrap to a
       second row on narrow viewports. Children use white-space:nowrap +
       inline-block (not float:left) so they stay on one line and the parent
       owns the horizontal scroll. Scrollbar hidden visually; gesture still
       works (trackpad swipe, drag, iOS momentum). */
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox */
}
.menu::-webkit-scrollbar { display: none; }   /* Chrome, Safari, iOS */
.menu ul { padding: 0; margin: 0; white-space: nowrap; }
.menu li
{
    list-style:none;
    /* Was: float:left. inline-block + parent white-space:nowrap is the
       standard pattern for horizontally-scrollable lists — float would
       break out of the inline flow and still wrap. */
    display: inline-block;
    float: none;
    vertical-align: top;
    margin-right: 10px;
    width: 75px;
    text-align: center;
}
.menu li a
{
    color: #2A2A2B;
    position: relative;
    font-size: 12px;
}
.menu li .active
{
    text-decoration: none;
}
.menu li img
{
    width: 40px;
    
}
.user-info
{
    float: right;
    padding-top: 12px;
    padding-left: 90px;
}
.user-info img
{
    width: 70px;
    float: left;
    margin-right: 10px;
}
.user-info a
{
    font-size: 12px;
    color: #2A2A2B;
}
.user-info a img
{
    width: 16px;
}
.arrow-up {
    position: absolute;
    /* left: 5%; */
    margin-left: 35px;
    top: 83px;
    height: 22px;
    width: 37px;
    text-indent: -9999px;
    background: url("/static/img/submenu_triangle.gif") no-repeat 0 0;
}

.ui-datepicker
{
    width: 10em;
}
.new
{
    margin-bottom: 10px;
}
.new p
{
    margin-bottom: 0px;
}
.new .text-muted
{
    font-size: 12px;
}
.new_task
{
    width: 322px;
}
.todo ul
{
    list-style: none;
    padding-left: 20px;
}
.start-edge {
background-image: url("/static/img/ragged-paper-edge.png");
height: 10px;
}

.footer p
{
    margin-top: 20px;
}

.emp_button
{
    text-align: center;
    margin-bottom: 10px;
    font-size: 12px;
}

.emp_button span
{
    font-size: 36px;
}

.emp_add a
{
    color: #94B300;
}

.emp_delete a, .emp_delete
{
    color: rgb(224, 105, 105);
}
.emp .col-xs-2
{
    padding-top: 30px;
}

.nav-icon.active::after {
    /* border-bottom on the <a> doesn't render reliably here — the link
       wraps two block-level <div>s (menu-img, menu-title), which collapses
       the inline anchor's own bottom edge in most browsers. Pseudo-element
       with absolute positioning anchors to the parent's relative box
       (`.menu li a { position: relative }`) and is unaffected by the
       inline/block mix-up. */
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 3px;
    background-color: #e8820c;
}

.debt-row-overdue { background-color: #ffe0e0 !important; }
.debt-row-pending { background-color: #fff5d6 !important; }
.debt-row-paid    { background-color: #dff5d6 !important; }



.message_button span{
    font-size: 16px;		
}

h3
{
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 20px;
}
.form-add .col-xs-2
{
    text-align: left;
}
.form-add .control-label
{
    font-weight: normal;
}
.panel
{
    margin-bottom: 50px;
}

.addclient li
{
    list-style: none;
    float: left;
    margin-right: 10px;
}
h4
{
    font-weight: bold;
}
.journal
{
    margin-top: 50px;
    position: relative;
}
.journal .well
{
    height: 150px;
}
.journal img
{
    float: left;
    margin-right: 10px;
    height: 71px;
}
.journal textarea
{
    width: 646px;
    margin-bottom: 10px;
}
.journal .btn
{
    position: absolute;
    left: 108px;
}
.chat img
{
    width: 40px;
    float: left;
    margin-right: 10px;
}
.chat .date
{
    font-size: 12px;
    margin-left: 5px;
}
.chat a
{
    text-decoration: underline;
}
.chat_view
{
    max-height: 500px;
    overflow-y: scroll;
}
.docs img
{
    width: 50px;
}
.addclient
{
    margin-bottom: 20px;
}
.ava 
{
    text-align: center;
}
.ava img
{
    width: 200px;
    margin-bottom: 10px;
}
.ava .btn
{
    width: 200px;
}
#changeAva .modal-body
{
    padding-left: 20px;
}
.dl-horizontal dt
{
    width: 72px;
}
.dl-horizontal dd
{
    margin-left: 100px;
}
.add_good .col-xs-4
{
    padding-left: 2px;
    padding-right: 2px;
}
.client-panel
{
    background-color: #F5F5F5;
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
}
.client-panel li
{
    margin-right: 10px;
    padding: 10px;
}
.client-panel .active
{
    border-radius: 25px;
    border: 1px solid #ddd;    
}
.client-panel .badge
{
    background-color: #5CB85C;
}
.clients table, .calls table
{
    font-size: 12px;
}
.clients ol
{
    padding: 0;
}
.clients thead th, .calls table th
{
    text-align: center;
}
.clients table .glyphicon
{
    color: #5BC0DE;
}

table.table-centered td{
    text-align: center;
    vertical-align: middle !important;
}

.add_org, .add_city, .add_theme
{
    font-size: 24px;
    float: right;
    position: relative;
    left: 35px;
    top: -28px;
}
.col-form1, .col-form2
{
    margin-bottom: 5px;
}

.col-form2 .form-control
{
    width: 90px !important;
}
.col-form1 label, .col-form2 label
{
    font-weight: normal;
}
.col-form2 p
{
    margin: 11px 0px 0px 0px;
}
.nav-tabs
{
    margin-bottom: 20px;
}

.cl_well .well {
  border-radius: 0;		
  margin-bottom: 0;
  border-top: none;
  border-right: none;
  border-left: none;
}

.dialog {
	border-bottom: 1px solid #e4e8ed;
    height: 80px;
}



.dialog a {
	display: block;	
	height: 100%;
	color: #000;
}

.dialog_body {
	padding: 15px 10px 5px 7px;
}

a.dialog_body:hover {
	background-color: #edf1f5;
}

.message_block {
    height: 320px;		
	overflow-y: scroll;	
}

.message_body {
	border-bottom: 1px solid #e4e8ed;
	padding: 15px 10px 5px 7px;
	
}


.blue, a.blue:hover {
	color: #2089C6;
}

.gray, a.gray:hover {
	color: #8B8989;
}

.red, a.red:hover {
	color: rgb(224, 105, 105);
}

.green, a.green:hover {
	color: #5CB85C;
}

.small_font {
	font-size: 12px;
}



.panel .label {
	font-size: 13px;	
}

.panel-body {
	min-height: 430px;
	
}

.remember_list ul {
	list-style: none;
	padding: 0; /* Убираем поля */
    margin-left: 20px;	
}

.remember_list a{
	text-decoration: none;
}

.block {
	padding: 5px 0 5px 0;
	border-bottom: 1px solid #e4e8ed;
}

ul.errorlist {
	list-style: none;	
	color: rgb(224, 105, 105);
	font-size: 13px;
}

.small_block {
	height: 380px;
	overflow: hidden;
}

.error_bck {
	background-color: #F8ECE0;
}

.new_message {
	background-color: #F5F5F5;		
}

.dialog_block .new_message {
	margin: 5px 0 5px 0;	
}

.delete {
    color: rgb(224, 105, 105);	
	font-family: 'Glyphicons Halflings';
}

#pdf, #html, #own {
	display: none;
}

.not_li ul{
	list-style: none;			
	padding: 0;
}

.pull_marg_right {
	margin-right: 10px;
}

th{
    text-align: center;
}

.iswork_table table td {
	word-break: normal;
	padding: 6px !important;
	
}

.chosen-container{
  width: 100% !important;
}

.iswork_table ol, .iswork_table ul {
	padding: 0;
	margin: 0;	
}
.menu-img
{
    height: 45px;
}
.table-hover tbody tr:hover
{
    cursor: pointer;
}
/* Hover на td не должен перебивать цвет tr (inline style или CSS-класс).
   Bootstrap применяет серый к td — inherit пробрасывает цвет от tr. */
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
    background-color: inherit !important;
}
.endless_page_current
{
    color: #fff;
    background-color: #337ab7;
    border-color: #2e6da4;
}
.endless_page_current, .endless_page_link{
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.endless_page_link:first-child:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.sro-table>thead>tr>th {
    position: relative;
}
.table-hover thead span {
    position: absolute;
    top: 18px;
    left: 15px;
    color: #999;
    font-size: 14px;
}
.sro-table>thead>tr>th .form-control {
    font-weight: normal;
    padding-left: 24px;
}
.btn-group {
    margin-bottom: 20px;
}
.client-info li {
    margin-bottom: 5px;
}
.member-tab {
    padding-left: 50px;
    padding-right: 50px;
    padding-top: 20px;
    font-size: 16px;
}
.member-info th
{
    text-align: left !important;
}
.member-title
{
    margin-top: 20px;
    margin-bottom: 30px;
}
.alert-sro
{
    margin-top: 15px;
}
.employer-sro th
{
    text-align: left;
}
.employer-sro
{
    margin-top: 15px;
}
.inline .form-group, .inline .input-group
{
    float: left;
    margin-right: 10px;
}
.sro-title
{
    font-weight: bold;
    font-size: 24px;
    margin-bottom: 20px;
}
#sro_form
{
    margin-bottom: 20px;
}
.graph_title
{
    margin-top: 33%;
    font-size: 26px;
}
.sro-member
{
    border: 1px solid #ccc;
    padding: 12px;
    margin-bottom: 10px;

}
.m-title
{
    font-size: 16px;
    margin-bottom: 5px;
}
.m-title a
{
    font-weight: bold;
    color: #000;
}
.m-sro
{
    font-weight: bold;
    margin-bottom: 8px;
}
.m-date
{
    margin-top: 10px;
}
.form-div th
{
  /*  text-align: left !important;*/
}
.m-inn
{
    color: #777;
    font-weight: bold;
}
.insure_date
{
    font-size: 16px;
    font-weight: normal;
}

.done-panel li
{
    margin-left: 10px;
	font-weight: normal;

}
.done-panel .active
{
	padding: 5px;
    border-radius: 25px;
    border: 1px solid #ddd;    
}

hr:last-child {
	border: none;
}

table td p {
	margin: 0;
	padding-top: 2px;
	padding-bottom: 2px;
}

.panel-heading {
    padding: 5px 15px;
    border-bottom: 1px solid transparent;
    border-top-right-radius: 3px;
    border-top-left-radius: 3px;
}

/* Add user form */
.add-user-form, .add-tender-org-form {
    max-width: 400px;
}

/* File link */
form.file-links > p.input-group > a.form-control {
    height: inherit;
}
/* Navbar scroll fix v2 — force UL to inline-block */
div.menu {
    overflow-x: auto !important;
    white-space: nowrap !important;
}
div.menu ul {
    display: inline-block !important;
    white-space: nowrap !important;
    width: auto !important;
}
div.menu li {
    display: inline-block !important;
    float: none !important;
    vertical-align: top !important;
    white-space: normal !important;
}

/* Navbar scroll fix v3 — flexbox approach */
div.cont.header {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
}
div.menu.col-xs-8 {
    flex: 1 !important;
    width: auto !important;
    float: none !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
}
div.menu.col-xs-8::-webkit-scrollbar { display: none !important; }
div.menu ul {
    display: flex !important;
    flex-wrap: nowrap !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
div.menu li {
    flex-shrink: 0 !important;
    float: none !important;
    display: block !important;
}

/* Navbar icons — responsive scaling to prevent second row at high zoom */
@media (max-width: 1500px) {
    .menu li { width: 68px !important; margin-right: 6px !important; }
}
@media (max-width: 1200px) {
    .menu li { width: 58px !important; margin-right: 4px !important; }
}
@media (max-width: 1000px) {
    .menu li { width: 48px !important; margin-right: 2px !important; }
}

/* CRITICAL mobile fix — выше в этом же файле .container жёстко
   выставлен в min-width:1300px !important для desktop-вёрстки. После
   <meta viewport="width=device-width"> mobile-браузер перестал авто-
   зумить страницу, и контент вылезал за viewport на 925px — юзер видел
   только левую ~1/4 экрана. Сбрасываем min-width для ≤768px (телефоны
   и планшеты — ранее покрывало только ≤600px).
   Применяется на всех страницах (login.html и monitoring.html обе грузят
   style.css), поэтому держим фикс здесь а не в одном из base.html. */
@media (max-width: 768px) {
    .container { min-width: 0 !important; width: 100% !important; }
    body, html { overflow-x: hidden; }
}

/* ============== UI-баги после серии спринтов (2026-05-25) ============== */

/* Bug 1 — поле «Быстрый поиск» съезжало на вторую строку.
   panel-heading.fix_menu заполняется float-right кнопками (Экспорт /
   Добавить / Фильтр / Настройки), а search_input float-right с width:300px
   уже не помещается на узких desktop'ах (<1400px). Делаем panel-heading
   flex-контейнером с wrap:nowrap чтобы все элементы стояли в одну строку,
   и режем search-input до 220px чтобы помещался. */
.panel-heading.fix_menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
}
.panel-heading.fix_menu > * { flex-shrink: 0; }
.panel-heading.fix_menu .pull-left,
.panel-heading.fix_menu .pull-right { float: none !important; }
.panel-heading.fix_menu .done-panel { margin-right: auto !important; }
.panel-heading.fix_menu .search_input { display: inline-block; }
.panel-heading.fix_menu .form-control_search { width: 220px !important; }
/* monitoring-ellipsis: ⋯ съезжал на самый край, отделённый от кнопок
   «Фильтр/Добавить» строкой поиска. Отправляем поиск в конец флекс-ряда
   (order:1), чтобы ⋯ стоял вплотную к кнопкам действий, а не у края.
   flex-shrink:1 + min-width:0 — поиск единственный элемент что может
   сжаться, если тулбар не влезает по ширине (иначе обрезался справа). */
.panel-heading.fix_menu .search-wrapper { order: 1; flex-shrink: 1; min-width: 0; }
.panel-heading.fix_menu .search-wrapper .form-control_search { width: 100% !important; min-width: 80px; box-sizing: border-box; }
/* Tabs (Все/Обработ./Необраб./Корзина) должны прижиматься компактно */
.panel-heading.fix_menu .done-panel li a { padding: 4px 8px; }

/* User-info navbar block (имя + Поиск + Настройка + Выйти).
   Desktop: flex-row, иконки выровнены по вертикали, ссылки inline-flex.
   Раньше использовался <br>-стэк + padding-left:90px + col-xs-2 — на
   узких экранах «Выйти» клипалась за края, иконки разной высоты «прыгали».
   Сейчас: flex layout — иконки align-center, gap, имя ellipsis. */
.user-info {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px 8px;
    /* padding-bottom повышен с 6px до 14px: на узких desktop'ах
       (~1280px col-xs-2 = 213px) 3 иконки не помещаются в одну строку,
       «Выйти» уезжает на 3-ю строку и заходит под fix_menu (top:95px,
       z-index:1031). Доп. padding-bottom + overflow:visible гарантируют
       что нижняя кнопка не клипается. */
    padding: 4px 8px 14px !important;
    min-width: 240px;
    overflow: visible;
    line-height: 1.2;
}
.user-info p {
    margin: 0;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.2;
    flex: 0 0 100%;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-info br { display: none; }
.user-info a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    line-height: 1.2;
    padding: 2px 0;
    white-space: nowrap;
    margin: 0;
}
.user-info a img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    margin: 0;
}
/* Navbar: inline style="height:100px" клиппит user-info когда
   контент wrap'нулся в 3 строки. Делаем height:auto, чтобы блок
   рос под содержимое; fix_menu остаётся на top:95px, поэтому
   на широких экранах визуально ничего не сдвигается. */
.navbar.navbar-default.navbar-fixed-top {
    height: auto !important;
    min-height: 100px;
    overflow: visible !important;
}

/* Bug 4 — badge «99+» на иконке Мониторинга обрезался. Причина —
   div.menu.col-xs-8 имеет overflow-y:hidden (для скрытия горизонтального
   скроллбара), а сам badge позиционируется top:-4px / right:-8px —
   вылазит из бокса .menu-img. Меняем overflow-y на visible + добавляем
   padding-top, чтобы остался горизонтальный скролл, но badge не клипался. */
div.menu.col-xs-8 {
    overflow-y: visible !important;
    padding-top: 6px !important;
}
/* badge: дополнительно гарантируем что не клипается и хорошо читается */
#monitoringUnprocessedBadge {
    z-index: 2;
    line-height: 1.2;
    min-width: 22px;
    text-align: center;
}

/* Tablet (601-1024px) tablet-блок удалён 2026-05-27 — clean slate.
   Все iPad-правила теперь живут в inline <style> base.html (минимальный
   набор для .search-wrapper). */

/* =================================================================
   MOBILE (≤600px) — общие правила для всех модулей.
   Принципы:
   - Таблицы: horizontal scroll вместо hide-columns (юзер увидит все
     данные, листая горизонтально).
   - Канбан-доски: были grid 1fr на 540px → меняем на flex с
     горизонтальным скроллом, каждая колонка min-width:250px.
   - Модули с одинаковой шапкой .panel-heading.fix_menu — фиксы уже
     в base.html (toolbar layout). Здесь добавляем не-fix_menu шапки
     (например, /accounting/, /platforms/).
   - Модалки: 95% ширины (Bootstrap default = центрированы + max-width).
   - Pagination / select2 — full-width.
   ================================================================= */
@media (max-width: 600px) {
    /* === Таблицы — везде horizontal scroll. Снимаем display:none
       прежних фиксов (invoice-list / counterparty-list / voronka-list)
       чтобы юзер видел все столбцы через свайп. === */
    .invoice-list-page table th:nth-child(2),
    .invoice-list-page table td:nth-child(2),
    .invoice-list-page table th:nth-child(4),
    .invoice-list-page table td:nth-child(4),
    .counterparty-list-page table th:nth-child(3),
    .counterparty-list-page table td:nth-child(3),
    .counterparty-list-page table th:nth-child(4),
    .counterparty-list-page table td:nth-child(4),
    .counterparty-list-page table th:nth-child(6),
    .counterparty-list-page table td:nth-child(6),
    .voronka-list-page table th:nth-child(4),
    .voronka-list-page table td:nth-child(4),
    .voronka-list-page table th:nth-child(5),
    .voronka-list-page table td:nth-child(5),
    .voronka-list-page table th:nth-child(7),
    .voronka-list-page table td:nth-child(7),
    .voronka-list-page table th:nth-child(8),
    .voronka-list-page table td:nth-child(8),
    .voronka-list-page table th:nth-child(9),
    .voronka-list-page table td:nth-child(9) { display: table-cell !important; }

    /* Все таблицы внутри panel-body — горизонтальный скролл с touch */
    .panel-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .panel-body > table.table,
    .panel-body > table.table-bordered,
    .panel-body > .table-responsive > table {
        min-width: 720px;
        display: table;
    }
    /* Accounting + voronka + platforms таблицы — общий min-width */
    .accounting-content table.table,
    .voronka-list-page table.table,
    .platforms-list-page table.pl-table { min-width: 720px; }

    /* === Канбан-доски — горизонтальный скролл вместо 1fr (раньше на
       540px все 5-6 колонок схлопывались в одну, теряя UX «доски»). === */
    .voronka-cols,
    .rasp-board-cols,
    .pod-board-cols {
        display: flex !important;
        grid-template-columns: none !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        gap: 8px !important;
        padding-bottom: 6px;
    }
    .voronka-cols > *,
    .rasp-board-cols > *,
    .pod-board-cols > * {
        flex: 0 0 250px;
        min-width: 250px;
        max-width: 280px;
    }

    /* === Шапки модулей без .fix_menu (accounting, platforms) — flex
       в столбец, кнопки в одну компактную строку. === */
    .accounting-content .panel-heading,
    .platforms-list-page .panel-heading {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        padding: 8px !important;
    }
    .accounting-content .panel-heading > div,
    .platforms-list-page .panel-heading > div {
        flex: 1 1 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
    .accounting-content .panel-heading form.form-inline {
        flex: 1 1 100% !important;
        margin: 0 !important;
    }
    .accounting-content .panel-heading form.form-inline .input-group {
        width: 100% !important;
    }
    .accounting-content .panel-heading .btn,
    .platforms-list-page .panel-heading .btn { font-size: 11px; padding: 6px 8px; }

    /* === Модалки 95% width === */
    .modal-dialog {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto !important;
    }
    .modal-content { border-radius: 6px; }
    .modal-body { padding: 10px !important; }
    /* Кнопки в модалках — full width, кроме маленьких .btn-xs */
    .modal-footer .btn,
    .modal-body .btn:not(.btn-xs):not(.btn-link),
    .modal-body input[type="submit"] {
        display: block;
        width: 100%;
        margin: 4px 0 !important;
    }
    .modal-footer { display: flex; flex-direction: column; gap: 4px; }

    /* === Pagination — цифры страниц не клипаются === */
    .pagination,
    ul.endless_page_list,
    ul.endless_container {
        flex-wrap: wrap !important;
        gap: 2px;
        padding-left: 0 !important;
    }
    .pagination > li > a,
    .pagination > li > span,
    .endless_page_link {
        padding: 4px 8px !important;
        font-size: 12px;
    }

    /* === Select2 + chosen — full width === */
    .select2-container,
    .chosen-container { width: 100% !important; }

    /* === Билинг — карточки тарифов стекаются вертикально === */
    .plan-card {
        margin-bottom: 12px;
        padding: 14px 12px 12px !important;
    }
    .plan-card .plan-price { font-size: 28px !important; }
    /* Bootstrap col-md/col-sm-4 для тарифов — на xs уже 100%, но если есть
       inline-style width, перебиваем */
    [class*="col-"][class*="-4"].plan-card-col,
    [class*="col-"][class*="-6"].plan-card-col { width: 100% !important; float: none !important; }

    /* === Voronka analytics — Chart.js canvas responsive === */
    .voronka-analytics canvas,
    .chart-container canvas,
    canvas.chartjs-render-monitor {
        max-width: 100% !important;
        height: auto !important;
    }
    .voronka-analytics .row > [class*="col-"] {
        width: 100% !important;
        float: none !important;
        margin-bottom: 12px;
    }

    /* === Common: длинные подписи в action-bar обрезаются эллипсисом === */
    #monitoringBulkBar, .accounting-bulk-bar {
        flex-wrap: wrap;
        gap: 4px;
        font-size: 11px;
    }

    /* === stickyTableHeaders плагин ломает мобильный лэйаут таблиц:
       window-scroll vs .table-responsive horizontal-scroll расходятся,
       и склонированный thead вставляется посреди списка. JS-инициализация
       уже пропускается на ≤600px (base.html), но если юзер открыл страницу
       на desktop и ресайзнул окно — плагин уже отработал. Принудительно
       прячем floating-клон и возвращаем original в static. */
    .tableFloatingHeader,
    thead.sticky,
    .table-header-sticky,
    .js-sticky-thead { display: none !important; }
    .tableFloatingHeaderOriginal,
    thead.tableFloatingHeaderOriginal,
    table thead.is-sticky {
        position: static !important;
        top: auto !important;
        left: auto !important;
        margin-top: 0 !important;
    }

    /* === Убираем все огромные gap'ы между navbar и контентом ===
       Несколько источников вертикального пространства складывались:
       - Bootstrap .navbar { margin-bottom: 20px } (default)
       - .navbar inline style="height:100px" (уже перекрыт height:auto, но
         margin-bottom не трогали)
       - .maincontent inline style="margin-top: 140px" (override до 8px)
       - .panel margin-top (Bootstrap default 0, но reset на всякий)
       - .panel-heading.fix_menu top:95px (для desktop fixed; reset до 0
         на относительной)
       Жёстко обнуляем все вертикальные отступы выше тулбара. */
    body { padding-top: 0 !important; margin-top: 0 !important; }
    .navbar,
    .navbar-fixed-top,
    .navbar.navbar-default { margin-bottom: 0 !important; }
    .cont, .cont.header { padding-top: 0 !important; }
    /* .maincontent margin-top больше НЕ зануляем здесь — единая
       --navbar-h управляет offset'ом везде (desktop & mobile). */
    .maincontent {
        padding-top: 0 !important;
    }
    .panel,
    .panel.panel-default,
    .panel.calls { margin-top: 0 !important; padding-top: 0 !important; }
    .panel-heading.fix_menu,
    .fix_menu,
    .fix_filter {
        position: relative !important;
        top: 0 !important;
        margin-top: 0 !important;
    }
    /* Любой элемент сразу после .fix_menu — без верхнего отступа */
    .fix_menu + *,
    .panel-heading.fix_menu + * { margin-top: 0 !important; }

    /* === Брутфорс: всё что лежит ПРЯМО в body или .maincontent — нулевой
       верхний отступ. Безопасно для мониторинга, потому что layout
       управляется явно через .panel-heading. === */
    body > div,
    body > .container,
    body > .container > * { margin-top: 0 !important; }
    .maincontent > *,
    .maincontent > .panel,
    .maincontent > div { margin-top: 0 !important; padding-top: 0 !important; }
    /* Bootstrap .navbar padding-top/bottom — режем для compact-mobile */
    .navbar, .navbar-default, .navbar-fixed-top {
        padding-top: 0 !important;
        padding-bottom: 4px !important;
        min-height: 0 !important;
        border: 0 !important;
    }
    /* Подстраховка: подтянуть тулбар на 1-2px к низу navbar (на случай
       residual padding от Bootstrap-сетки col-xs-12). */
    .panel.calls > .panel-heading.fix_menu:first-child { margin-top: -2px !important; }

    /* === Inline-edit поля на мобильном: убираем 300ms tap delay,
       гарантируем minimum tap-target 32px высоты, читаемый размер. === */
    .js-inline-edit,
    .js-inline-edit-comment {
        touch-action: manipulation;
        min-height: 28px;
        line-height: 1.4;
        padding: 4px 6px !important;
        /* iOS Safari иногда не отрабатывает click на span без явного
           cursor:pointer; дублируем здесь как safety net (шаблоны его
           тоже ставят inline, но не везде гарантированно). */
        cursor: pointer;
    }
    /* Когда span превращается в textarea/input — даём комфортную высоту
       и шрифт ≥16px, чтобы iOS не зумил viewport при фокусе на инпут. */
    .js-inline-edit input,
    .js-inline-edit textarea,
    .js-inline-edit select,
    .js-inline-edit-comment textarea {
        font-size: 16px !important;
        min-height: 36px;
        width: 100% !important;
    }

    /* === Per-template точечные фиксы (от code review) === */

    /* postavka_pagination.html:4 — inline table-layout:fixed ломает
       autosize на мобильном */
    .iswork_table table[style*="table-layout"] { table-layout: auto !important; }

    /* raspisanie_pagination.html — emoji-иконки 2em в td раздувают строку */
    .iswork_table table tbody td { line-height: 1.2; }
    .iswork_table table tbody td span[style*="font-size:2em"],
    .iswork_table table tbody td span[style*="font-size:3em"] {
        font-size: 1.4em !important;
    }

    /* platforms/list.html:53 — th min-width:180px (Пароли) — обрезаем */
    .platforms-list-page table.pl-table th[style*="min-width"],
    .platforms-list-page table.pl-table td[style*="min-width"] {
        min-width: 100px !important;
    }

    /* accounting/counterparty_list_partial.html:13 — th width:160px → auto */
    .counterparty-list-page table th[style*="width:"] { width: auto !important; }

    /* accounting/debt_list.html — таблица без .table-responsive обёртки,
       полагаемся на .panel-body { overflow-x:auto } (уже выше), но
       дополнительно даём table min-width чтобы scroll реально появился */
    .debt-list-page .panel-body > table.table-bordered { min-width: 720px; }

    /* raspisanie_filtrs.html — inline display:inline-block ломает stack
       на мобильном (поля .form-group склеиваются в строку) */
    #collapseExample .form-group[style*="inline-block"],
    #collapseExample .form-group { display: block !important; }

    /* Все .col-xs-N внутри фильтра — full-width на мобильном. Bootstrap 3
       xs-сетка by-design рассчитана на phone, но 4-х колоночные раскладки
       (col-xs-4 = 33%) на 360px дают селекты по ~100px, в которые опции
       вроде «По дате (новее →)» не помещаются. Стэкуем вертикально. */
    #collapseExample [class*="col-xs-"] {
        width: 100% !important;
        float: none !important;
        padding-left: 8px;
        padding-right: 8px;
        margin-bottom: 4px;
    }
    /* pull-left/pull-right reset-кнопки внутри фильтров — на мобильном
       collapse_example уже сделал колонки 100%, но float остаётся */
    #collapseExample .pull-left,
    #collapseExample .pull-right { float: none !important; }
    #collapseExample .reset-button { display: inline-block; margin-left: 4px; }

    /* Bug fix `.form-group-with-reset` — flexbox для пары input+reset.
       Историческая попытка через float (a2c0ffa) была хрупкой: width:calc()
       + restored floats полагались на отсутствие whitespace, padding inputs,
       и точное соответствие margin reset-button. На разных вьюпортах ±2px и
       layout ломался. Flexbox — единственно правильный pattern. См. правило
       вне @media — оно применяется на ВСЕХ размерах. */

    /* podacha.html — header использует свой набор кнопок без .fix_menu */
    .panel-heading > .pull-right,
    .panel-heading > .pull-left { float: none !important; }

    /* ===== Поставка / Расписание / Подача — мобильные таблицы =====
       Корневая проблема: postavka_pagination.html имеет inline-style
       `table-layout: fixed; overflow-wrap: break-word;`. На мобильном
       (виewport ~360px) и 13 колонках браузер сжимает каждую до ~20px
       и текст ломается ПОБУКВЕННО (вертикальная «лесенка»). Аналогично
       сломаны raspisanie (8 колонок) и podacha (7 колонок) — у них fixed
       нет, но 8+ колонок всё равно нечитаемы.

       Фикс:
       1. min-width 900px форсирует таблицу на 900px ширины — родитель
          (.table-responsive / .panel-body { overflow-x:auto }) даёт
          горизонтальный скролл.
       2. table-layout: auto перебивает inline fixed → колонки получают
          размеры по контенту, текст не ломается.
       3. nth-child-скрытие второстепенных колонок: фокус на 4-5 главных.
          Юзер свайпом видит остальные если нужно. */

    .post-mobile-table,
    .rasp-mobile-table,
    .pod-mobile-table {
        min-width: 900px !important;
        table-layout: auto !important;
    }
    .post-mobile-table th,
    .post-mobile-table td,
    .rasp-mobile-table th,
    .rasp-mobile-table td,
    .pod-mobile-table th,
    .pod-mobile-table td {
        overflow-wrap: normal !important;
        word-break: normal !important;
    }

    /* Postavka — 13 колонок. Скрываем: checkbox(1), Продукты(5), ОК(7),
       Комментарий(8), Сроки(9), Контакты(10), Согласование(11),
       Документы(12). Оставляем видимыми: №(2), Заказчик(3), Суммы(4),
       Контракт(6), Оплата(13) — соответствует «оставить» из задачи. */
    .post-mobile-table th:nth-child(1),
    .post-mobile-table td:nth-child(1),
    .post-mobile-table th:nth-child(5),
    .post-mobile-table td:nth-child(5),
    .post-mobile-table th:nth-child(7),
    .post-mobile-table td:nth-child(7),
    .post-mobile-table th:nth-child(8),
    .post-mobile-table td:nth-child(8),
    .post-mobile-table th:nth-child(9),
    .post-mobile-table td:nth-child(9),
    .post-mobile-table th:nth-child(10),
    .post-mobile-table td:nth-child(10),
    .post-mobile-table th:nth-child(11),
    .post-mobile-table td:nth-child(11),
    .post-mobile-table th:nth-child(12),
    .post-mobile-table td:nth-child(12) { display: none !important; }

    /* Raspisanie — 8 колонок: checkbox(1), №(2), Дата(3), Сумма(4),
       Продукты(5), Площадка(6), Коммент(7), Заказчик(8).
       Скрываем: checkbox(1), Продукты(5), Площадка(6), Коммент(7). */
    .rasp-mobile-table th:nth-child(1),
    .rasp-mobile-table td:nth-child(1),
    .rasp-mobile-table th:nth-child(5),
    .rasp-mobile-table td:nth-child(5),
    .rasp-mobile-table th:nth-child(6),
    .rasp-mobile-table td:nth-child(6),
    .rasp-mobile-table th:nth-child(7),
    .rasp-mobile-table td:nth-child(7) { display: none !important; }

    /* Podacha — 7 колонок: №(1), Время окончания(2), Дедлайн(3),
       Сумма(4), Площадка(5), Комментарии(6), Статус(7).
       Скрываем: Время окончания(2), Площадка(5), Комментарии(6). */
    .pod-mobile-table th:nth-child(2),
    .pod-mobile-table td:nth-child(2),
    .pod-mobile-table th:nth-child(5),
    .pod-mobile-table td:nth-child(5),
    .pod-mobile-table th:nth-child(6),
    .pod-mobile-table td:nth-child(6) { display: none !important; }
}

/* filtрс-панели (monitoring/postavka/raspisanie/podacha): пара date-input +
   `<a class="reset-button">×</a>` через flexbox. История: f53b4c3 → b2bd642
   → a2c0ffa → 1201fa5 пытались справиться через width:calc(100%-26px) +
   float или inline-block — все ломались на iPhone из-за whitespace между
   inline-block, ID-специфичности `#collapseExample .form-control`, или
   принудительного float:none у `.pull-left/.pull-right` на mobile. Flexbox —
   правильный pattern: gap не зависит от whitespace, flex:1 honor контейнер
   независимо от child padding/border, специфичность не важна потому что
   родитель управляет layout детей. !important на width перебивает
   `#collapseExample .form-control { width: 100% !important }` из base.html. */
.form-group-with-reset {
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap !important;
    gap: 4px;
}
.form-group-with-reset > .form-control-with-reset {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    float: none !important;
}
.form-group-with-reset > .reset-button {
    flex: 0 0 auto;
    width: 20px;
    padding: 6px 4px;
    line-height: 1;
    color: #999;
    text-decoration: none;
    cursor: pointer;
    float: none !important;
}
.form-group-with-reset > .reset-button:hover { color: #333; }
/* Видимая метка «с/по» перед date-input. На iOS native type=date placeholder
   НЕ показывается (native UI выводит свой date display поверх), поэтому юзер
   видит две одинаковые строки и часто заполняет «с» думая что это «по» —
   получает finish_date1=gte вместо finish_date2=lte → фильтр работает в
   обратную сторону (виден баг 8bce36b: "до 01.06.2026" → показывает 2-5 июня
   потому что dateout >= 01.06.2026). Видимая метка устраняет неоднозначность. */
.form-group-with-reset > .period-label {
    flex: 0 0 auto;
    font-size: 11px;
    color: #999;
    padding: 0 4px;
    text-transform: lowercase;
    min-width: 16px;
    text-align: center;
}

/* --- 16. Bottom filter bar (under_page_block) — Bug 3 fix ---
   bootstrap.min.css has position:sticky; bottom:0 but the element lives
   inside .table-responsive (overflow-x:auto) which creates a new overflow
   context and breaks sticky relative to the viewport. Override to fixed. */
.under_page_block {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1039;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    min-height: 36px;
    height: auto !important;
    padding: 4px 20px;
    box-shadow: 0 -2px 6px rgba(0,0,0,.06);
}
/* Prevent last table rows from being hidden behind the fixed bar */
.iswork_table { padding-bottom: 50px; }
