/* ==========================================================================
   2Kolesa CRM · общие стили
   Токены совпадают с макетами интерфейса (Design-артефакт, версия 24).
   ========================================================================== */

@font-face {
    font-family: 'Manrope';
    src: url('../vendor/fonts/manrope-cyrillic-wght-normal.woff2') format('woff2');
    font-weight: 200 800;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Manrope';
    src: url('../vendor/fonts/manrope-latin-wght-normal.woff2') format('woff2');
    font-weight: 200 800;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bs-body-font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-bg: #F3F4F6;
    --bs-body-color: #14171C;
    --bs-primary: #C2410C;
    --bs-primary-rgb: 194, 65, 12;
    --bs-success: #14663A;
    --bs-success-rgb: 20, 102, 58;
    --bs-danger: #B42318;
    --bs-danger-rgb: 180, 35, 24;
    --bs-border-color: #E3E5E9;
    --bs-border-radius: 10px;
    --bs-border-radius-lg: 14px;
    --bs-link-color: #C2410C;
    --bs-link-hover-color: #A8370A;
    --bs-link-color-rgb: 194, 65, 12;
    --bs-link-hover-color-rgb: 168, 55, 10;
    --bs-focus-ring-color: rgba(194, 65, 12, .25);

    --topbar-h: 56px;
    --ink: #14171C;
    --ink-2: #4B5563;
    --line: #E3E5E9;
    --surface: #FFFFFF;
    --col-bg: #E9EBEF;
}

body.app { font-feature-settings: 'tnum' 1; -webkit-font-smoothing: antialiased; }
.text-secondary { color: var(--ink-2) !important; }

/* Кнопки в цвет бренда */
.btn-primary {
    --bs-btn-bg: #C2410C; --bs-btn-border-color: #C2410C;
    --bs-btn-hover-bg: #A8370A; --bs-btn-hover-border-color: #A8370A;
    --bs-btn-active-bg: #932F08; --bs-btn-active-border-color: #932F08;
    --bs-btn-disabled-bg: #C2410C; --bs-btn-disabled-border-color: #C2410C;
    --bs-btn-focus-shadow-rgb: 194, 65, 12;
}
.btn-outline-primary {
    --bs-btn-color: #C2410C; --bs-btn-border-color: #C2410C;
    --bs-btn-hover-bg: #C2410C; --bs-btn-hover-border-color: #C2410C;
    --bs-btn-active-bg: #A8370A; --bs-btn-active-border-color: #A8370A;
}
.form-control:focus, .form-select:focus {
    border-color: #C2410C;
    box-shadow: 0 0 0 .2rem rgba(194, 65, 12, .18);
}

/* Цвета статусов: класс строится из order_statuses.color */
.status-primary   { --st-bg: #E6F0FF; --st-fg: #1D4ED8; }
.status-warning   { --st-bg: #FFF1D6; --st-fg: #8A4B00; }
.status-secondary { --st-bg: #E8EAEE; --st-fg: #3F4651; }
.status-success   { --st-bg: #DDF4E6; --st-fg: #14663A; }
.status-dark      { --st-bg: #2B3038; --st-fg: #FFFFFF; }
.status-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px;
    border-radius: 999px; font-size: .8rem; font-weight: 600;
    background: var(--st-bg); color: var(--st-fg);
}

/* --- Верхняя панель ------------------------------------------------------- */
.topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--topbar-h); display: flex; align-items: center; gap: 8px;
    padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; }
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px; background: #C2410C; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
.topnav { display: flex; gap: 2px; margin-left: 8px; }
.topnav-link {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
    border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem;
}
.topnav-link:hover { background: #F3F4F6; color: var(--ink); }
.topnav-link.is-active { background: #FFF1E8; color: #C2410C; }
.topbar-spacer { flex: 1; }
.user-btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px;
    background: transparent; border: 0; border-radius: 10px; color: var(--ink); font-weight: 600;
}
.user-btn:hover { background: #F3F4F6; }
.user-btn .bi { font-size: 1.35rem; }

/* --- Страница ------------------------------------------------------------- */
.page { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 14px; }
.page-title { font-size: 1.35rem; font-weight: 800; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }

.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.stat {
    display: flex; flex-direction: column; justify-content: center; min-width: 96px;
    padding: 6px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.stat-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; }
.stat-value { font-size: 1.05rem; font-weight: 800; line-height: 1.2; }

/* --- Доска ---------------------------------------------------------------- */
.board {
    display: flex; gap: 12px; align-items: stretch;
    overflow-x: auto; overscroll-behavior-x: contain;
    height: calc(100dvh - var(--topbar-h) - 100px); min-height: 420px;
    padding-bottom: 6px; scroll-snap-type: x proximity;
}
.kcol {
    flex: 1 1 216px; min-width: 216px; max-width: 360px; display: flex; flex-direction: column; min-height: 0;
    background: var(--col-bg); border-radius: 14px; scroll-snap-align: start;
}
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.kcol-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--st-fg, #3F4651); }
.kcol-name { font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: #3F4651; }
.kcol-count {
    margin-left: auto; min-width: 24px; padding: 0 8px; text-align: center; line-height: 22px;
    border-radius: 999px; background: #fff; font-size: .78rem; font-weight: 700; color: var(--ink-2);
}
.kcol-body { flex: 1 1 auto; min-height: 80px; overflow-y: auto; padding: 4px 8px 8px; }
.kcol-empty { text-align: center; padding: 18px 0; color: #9AA1AD; font-size: .85rem; }

.kcard {
    position: relative; background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
    border-left: 4px solid #C9CDD4; box-shadow: 0 1px 2px rgba(20, 23, 28, .06);
    cursor: grab; transition: box-shadow .15s, transform .15s;
}
.kcard:hover { box-shadow: 0 4px 12px rgba(20, 23, 28, .1); }
.kcard.state-debt { border-left-color: #B42318; }
.kcard.state-ok   { border-left-color: #14663A; }
.kcard.state-zero { border-left-color: #C9CDD4; }
.kcard.is-busy { opacity: .55; pointer-events: none; }
.kcard.sortable-ghost { opacity: .35; }
.kcard.sortable-chosen { cursor: grabbing; box-shadow: 0 8px 24px rgba(20, 23, 28, .18); }

.kc-top { display: flex; align-items: center; gap: 8px; padding-right: 30px; margin-bottom: 4px; }
.kc-num { font-weight: 800; color: var(--ink); text-decoration: none; }
.kc-works { font-size: .78rem; font-weight: 700; color: #8A4B00; display: inline-flex; gap: 4px; align-items: center; }
.kc-works.is-done { color: #14663A; }
.kc-date { margin-left: auto; font-size: .78rem; color: var(--ink-2); }
.kc-title { font-weight: 700; font-size: .92rem; line-height: 1.25; margin-bottom: 4px; overflow-wrap: anywhere; }
.kc-bike { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 6px; }
.kc-plate { font-weight: 800; color: #C2410C; letter-spacing: .02em; }
.kc-model { font-size: .82rem; color: var(--ink-2); }
.kc-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px solid #F0F1F4; }
.kc-client { font-size: .82rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-money { font-size: .88rem; font-weight: 800; white-space: nowrap; }
.kc-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.kc-flag { font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #FFF1D6; color: #8A4B00; }

.kc-move {
    position: absolute; top: 4px; right: 4px; z-index: 2; width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: 8px; color: #9AA1AD; font-size: 1rem;
}
.kc-move:hover, .kc-move:focus-visible { background: #F3F4F6; color: var(--ink); }
@media (pointer: coarse) { .kc-move { width: 44px; height: 44px; top: 0; right: 0; } .kc-top { padding-right: 44px; } }

/* Перетаскиваемая копия (режим forceFallback в SortableJS) */
.sortable-fallback { opacity: .9 !important; transform: rotate(2deg); }

/* --- Окно «Работы и оплата» ---------------------------------------------- */
.gate-debt { background: #FDECEA; border-radius: 12px; padding: 10px 14px; text-align: center; }
/* возврат выданного наряда в работу (администратор, 22.11) */
.gate-reopen { display: flex; gap: 10px; align-items: flex-start; background: #FFF4E5; border-radius: 12px; padding: 10px 14px; color: #7A4A00; }
.gate-reopen > .bi { font-size: 1.25rem; line-height: 1.2; }
#gateReopen:not(.d-none) + #gateWorks { margin-top: 1rem; }
.gate-debt-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #B42318; font-weight: 700; }
.gate-debt-value { font-size: 1.6rem; font-weight: 800; color: #B42318; }
#gateWorksList .list-group-item { display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer; }
#gateWorksList .form-check-input { width: 1.4em; height: 1.4em; margin: 0; flex: none; }
#gateWorksList .list-group-item.is-checked .gate-name { color: #14663A; text-decoration: line-through; }

.picker-sheet { height: auto; max-height: 80dvh; border-top-left-radius: 16px; border-top-right-radius: 16px; }
#statusPickerList .list-group-item { display: flex; align-items: center; gap: 12px; min-height: 52px; font-weight: 600; }
#statusPickerList .list-group-item[disabled] { opacity: .45; }

/* --- Вход и ошибки -------------------------------------------------------- */
.bare-wrap { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; }
.login-logo {
    width: 52px; height: 52px; border-radius: 14px; background: #C2410C; color: #fff; margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.login-title { text-align: center; font-size: 1.35rem; font-weight: 800; margin: 0; }
.login-sub { text-align: center; color: var(--ink-2); margin: 4px 0 20px; }
.error-box { text-align: center; padding: 56px 16px; }
.error-code { font-size: 4rem; font-weight: 800; color: #C2410C; line-height: 1; }
.error-text { color: var(--ink-2); margin: 12px 0 20px; }

/* --- Поиск в верхней панели ----------------------------------------------- */
.topbar-search {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; margin-right: 4px;
    border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem;
    border: 1px solid var(--line); background: #FAFAFB;
}
.topbar-search:hover, .topbar-search.is-active { background: #FFF1E8; color: #C2410C; border-color: #F5D5C3; }
.topbar-search kbd { font-size: .7rem; background: #fff; color: var(--ink-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }

/* Телефон: в верхней панели у администратора больше всего значков (доска, наряды, финансы, база, новый наряд, поиск,
   колокольчик ассистента, меню). Плотнее отступы, чтобы страница не уезжала вбок; кнопки остаются не уже 36 px.
   .topbar .assistant-bell: два класса, чтобы правило побеждало assistant.css независимо от порядка подключения. */
@media (max-width: 480px) {
    .topbar { gap: 2px; padding: 0 6px; }
    .topnav { margin-left: 0; gap: 0; }
    .topnav-link { padding: 0 9px; }
    .topbar-search { padding: 0 9px; margin-right: 0; }
    .user-btn { padding: 0 6px; }
    .topbar .assistant-bell { margin-right: 0; }
}
/* Узкий экран (до 360 px): значок-логотип прячется, на доску ведёт первая кнопка меню */
@media (max-width: 359.98px) {
    .topbar .brand { display: none; }
}
/* Планшет и небольшой ноутбук: подписи у значков шапки появляются только там, где помещаются (13.11).
   С разделами «Склад» и «Магазин» и колокольчиком ассистента шапка с подписями Bootstrap (d-sm/d-md/d-lg-inline)
   была шире экрана: у администратора от 576 до 1168 px, у менеджера до 1120 px.
   Подписи разделов скрываются, только когда разделов пять и больше: у механика их три, и подписи помещаются. */
@media (max-width: 1199.98px) {
    .topnav:has(> .topnav-link:nth-child(5)) .topnav-link > span { display: none !important; }
}
/* Имя сотрудника в шапке — с 1280 px (оно же первым пунктом в меню сотрудника), длинное обрезается многоточием;
   подсказка «Ctrl K» у поиска — с 1400 px */
@media (max-width: 1279.98px) {
    .topbar .user-btn > span { display: none !important; }
}
@media (max-width: 1399.98px) {
    .topbar-search kbd { display: none !important; }
}
.topbar-search kbd, .topnav-link > span { white-space: nowrap; }
.user-btn > span { white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 991.98px) {
    .topbar .brand-name { display: none !important; }
}
@media (max-width: 767.98px) {
    .topbar .topbar-new > span { display: none !important; }
}

/* --- Список нарядов ------------------------------------------------------- */
.page-sub { margin: 2px 0 0; color: var(--ink-2); font-size: .9rem; }

.sumbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sumcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.sumcard-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; }
.sumcard-value { font-size: 1.35rem; font-weight: 800; line-height: 1.25; }
.sumcard-unit { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.sumcard-note { font-size: .78rem; color: var(--ink-2); text-decoration: none; }
a.sumcard-note:hover { color: #C2410C; }
.sumbar-progress { height: 5px; border-radius: 3px; background: #E8EAEE; overflow: hidden; margin: 4px 0 2px; }
.sumbar-progress > span { display: block; height: 100%; background: #14663A; }

.filterbar {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px;
}
.filterbar-q { position: relative; flex: 1 1 280px; }
.filterbar-q .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.filterbar-q .form-control { padding-left: 36px; }
.filterbar-date { display: flex; align-items: center; gap: 6px; }
.filterbar-date .form-control { width: 150px; }
.filterbar-actions { display: flex; gap: 6px; }

.otable-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.otable { width: 100%; border-collapse: collapse; }
.otable th {
    text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2);
    font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FAFAFB; white-space: nowrap;
}
.otable th.text-end { text-align: right; }
.otable td { padding: 10px 14px; border-bottom: 1px solid #EEF0F3; vertical-align: top; }
.otable tbody tr:last-child td { border-bottom: 0; }
.orow { position: relative; }
.orow:hover { background: #FFF8F3; }
.orow-num { font-weight: 800; white-space: nowrap; }
.orow-num a { color: var(--ink); text-decoration: none; }
.orow-num a:hover { color: #C2410C; }
.orow-date { white-space: nowrap; color: var(--ink-2); font-size: .9rem; }
.orow-main { min-width: 220px; }
.orow-title { font-weight: 700; }
.orow-title.is-empty { color: var(--ink-2); font-weight: 500; font-style: italic; }
.orow-bike { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: .86rem; color: var(--ink-2); }
.orow-sum { font-weight: 700; white-space: nowrap; }
.plate {
    display: inline-block; padding: 0 6px; border: 1px solid #C9CDD4; border-radius: 5px; background: #fff;
    color: var(--ink); font-weight: 700; font-size: .78rem; letter-spacing: .03em;
}
.pay-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pay-chip.is-ok   { background: #DDF4E6; color: #14663A; }
.pay-chip.is-debt { background: #FDE8E6; color: #B42318; }
.pay-chip.is-zero { background: #E8EAEE; color: #3F4651; }
.otable-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--ink-2); }
.empty-state { padding: 48px 16px; text-align: center; }
.empty-title { font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; }

/* --- Общий поиск ---------------------------------------------------------- */
.searchbox { position: relative; display: flex; gap: 8px; margin-bottom: 14px; max-width: 880px; }
.searchbox > .bi-search { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; font-size: 1.1rem; z-index: 2; }
.searchbox .form-control { padding-left: 46px; flex: 1 1 auto; }
.searchbox-btn { flex: 0 0 auto; }
#searchResults { max-width: 880px; transition: opacity .12s; }
#searchResults.is-loading { opacity: .55; }
.sr-hint { background: var(--surface); border: 1px dashed #CBD0D8; border-radius: 14px; padding: 20px; color: var(--ink-2); }
.sr-hint-title { font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.sr-hint-list { margin: 0; padding-left: 18px; line-height: 1.8; }
.sr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sr-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .86rem; font-weight: 600; }
.sr-chip:hover { border-color: #C2410C; color: #C2410C; }
.sr-chip b { color: var(--ink-2); }
.sr-section { margin-bottom: 16px; scroll-margin-top: calc(var(--topbar-h) + 8px); }
.sr-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 800; margin: 0 0 6px 2px; display: flex; align-items: center; gap: 6px; }
.sr-count { background: #E8EAEE; color: #3F4651; border-radius: 999px; padding: 0 8px; font-size: .75rem; }
.sr-list { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.sr-item { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #EEF0F3; }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover { background: #FFF8F3; }
.sr-main { display: flex; gap: 12px; min-width: 0; flex: 1 1 auto; color: inherit; text-decoration: none; }
.sr-num { flex: 0 0 auto; min-width: 54px; font-weight: 800; color: var(--ink); }
.sr-num .bi { color: var(--ink-2); font-size: 1.15rem; }
.sr-body { display: flex; flex-direction: column; min-width: 0; }
.sr-line1 { font-weight: 700; overflow-wrap: anywhere; }
.sr-line2 { font-size: .86rem; color: var(--ink-2); overflow-wrap: anywhere; }
.sr-note { font-size: .82rem; color: #8A4B00; background: #FFF1D6; border-radius: 6px; padding: 0 8px; margin-top: 3px; align-self: flex-start; }
.sr-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.sr-meta { font-size: .8rem; color: var(--ink-2); }
.sr-last { position: relative; z-index: 2; font-size: .82rem; font-weight: 600; text-decoration: none; }
.sr-all { display: inline-block; margin: 6px 2px 0; font-weight: 700; text-decoration: none; }
.sr-more { margin: 6px 2px 0; font-size: .82rem; color: var(--ink-2); }

/* --- Страница наряда ------------------------------------------------------ */
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
    text-decoration: none; font-size: 1.15rem; cursor: pointer;
}
.icon-btn:hover { border-color: #C2410C; color: #C2410C; }
.ohead { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.ohead-main { flex: 1 1 auto; min-width: 0; }
.ohead-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.ohead-num { font-size: 1.5rem; font-weight: 800; margin: 0; }
.ohead-title { font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.ohead-title.is-empty { color: var(--ink-2); font-weight: 500; font-style: italic; }
.ohead-meta { font-size: .86rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.ohead-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.status-btn { border: 0; cursor: pointer; padding: 4px 12px; font-size: .88rem; }
.status-btn:hover { filter: brightness(.96); }
.status-menu { min-width: 220px; padding: 6px; border-radius: 12px; }
.status-menu .dropdown-item { display: flex; align-items: center; gap: 10px; border-radius: 8px; min-height: 40px; font-weight: 600; }
.status-menu .dropdown-item:disabled { opacity: .55; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--st-fg); flex: 0 0 auto; }
.closed-note { background: #F1F2F4; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; color: var(--ink-2); font-size: .9rem; }
/* «Вернуть в работу» у выданного наряда (администратор, 22.11): справа от текста, на телефоне — под ним во всю ширину */
.closed-note:has(.closed-reopen) { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.closed-note:has(.closed-reopen) > span { flex: 1 1 240px; }
.closed-reopen { flex: 0 0 auto; min-height: 38px; }
@media (max-width: 575.98px) { .closed-reopen { flex: 1 1 100%; } }

.opage { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.omain { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ocard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.ocard-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--ink-2); }
.ocard-title .bi { margin-right: 4px; }
.ocount { font-size: .8rem; text-transform: none; letter-spacing: 0; font-weight: 700; color: #14663A; background: #DDF4E6; border-radius: 999px; padding: 1px 10px; }
.oempty { color: var(--ink-2); padding: 6px 0; }
.ocomment { white-space: normal; overflow-wrap: anywhere; }

.ocols { display: grid; gap: 14px 24px; grid-template-columns: 1fr 1fr; }
.oblock-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--ink-2); margin: 0 0 6px; }
.oblock-title .bi { margin-right: 4px; }
.oblock-main { font-size: 1.1rem; font-weight: 800; overflow-wrap: anywhere; }
.oblock-phone { display: inline-block; font-weight: 600; text-decoration: none; margin-top: 2px; }
.oblock-sub { font-size: .88rem; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.oblock-link { display: inline-block; margin-top: 6px; font-size: .86rem; font-weight: 600; text-decoration: none; }
.oblock-empty { color: var(--ink-2); font-style: italic; }

.otbl { width: 100%; border-collapse: collapse; }
.otbl th { white-space: nowrap; text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.otbl th.text-end { text-align: right; } .otbl th.text-center { text-align: center; }
.otbl td { padding: 8px; border-bottom: 1px solid #EEF0F3; vertical-align: top; }
.otbl tbody tr:last-child td { border-bottom: 0; }
.otbl-check { width: 44px; text-align: center; }
.otbl-check .form-check-input { width: 1.3rem; height: 1.3rem; margin: 0; cursor: pointer; }
.otbl-check .form-check-input:disabled { cursor: default; }
.otbl-check .form-check-input:checked { background-color: #14663A; border-color: #14663A; }
.otbl-name { overflow-wrap: anywhere; }
.otbl tr.is-done .otbl-name { color: #14663A; text-decoration: line-through; }

.ofin { align-self: start; }
.ofin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.ofin-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; }
.ofin-val { font-weight: 700; }
.ofin-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 8px; margin-bottom: 6px; }
.ofin-total b { font-size: 1.45rem; font-weight: 800; }
.ofin-row { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 0; }
.opay-list { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.opay-list summary { cursor: pointer; font-weight: 700; font-size: .88rem; color: var(--ink-2); }
.opay-list ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.opay-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 0 10px; align-items: center; }
.opay-sum { font-weight: 800; white-space: nowrap; }
.opay-meta { font-size: .82rem; color: var(--ink-2); align-self: center; }
.opay-comment { grid-column: 1 / -1; font-size: .82rem; color: var(--ink-2); }
/* Сторно оплаты (этап 2.5): отменённый платёж зачёркнут, встречная запись помечена */
.opay-list li.is-reversed .opay-sum { text-decoration: line-through; color: var(--ink-2); }
.opay-list li.is-reversed .opay-meta { color: #8A909B; }
.opay-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: #E8EAEE; color: #3F4651; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.opay-tag.is-red { background: #FDECEA; color: #B42318; }
.opay-rev { grid-column: 3; grid-row: 1; width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: var(--ink-2); cursor: pointer; }
.opay-rev:hover, .opay-rev:focus-visible { border-color: #B42318; color: #B42318; }
/* Перенос оплаты на другую дату (06.11, только администратор): значок-календарь рядом со сторно */
.opay-acts { grid-column: 3; grid-row: 1; display: inline-flex; gap: 6px; }
.opay-date { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: var(--ink-2); cursor: pointer; }
.opay-date:hover, .opay-date:focus-visible { border-color: var(--bs-primary); color: var(--bs-primary); }
.pdt-box { background: #F3F4F6; border-radius: 12px; padding: 10px 14px; text-align: center; }
.pdt-box-sum { font-size: 1.5rem; font-weight: 800; }
.pdt-box-meta { font-size: .85rem; color: var(--ink-2); }
.rev-box { background: #FDECEA; border-radius: 12px; padding: 10px 14px; text-align: center; }
.rev-box-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #B42318; font-weight: 700; }
.rev-box-sum { font-size: 1.6rem; font-weight: 800; color: #B42318; }
.rev-box-meta { font-size: .85rem; color: var(--ink-2); }
.rev-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rev-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: .85rem; cursor: pointer; color: inherit; }
.rev-chip:hover, .rev-chip:focus-visible { border-color: #B42318; color: #B42318; }
@media (max-width: 767.98px) {
    .opay-rev, .opay-date { width: 44px; height: 44px; }
    .rev-chip { min-height: 44px; padding: 0 14px; }
}

.ojournal { align-self: start; }
.jlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.jlist li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; }
.jlist li > .bi { color: var(--ink-2); font-size: 1rem; line-height: 1.4; }
.jtext { font-size: .9rem; overflow-wrap: anywhere; }
.jmeta { font-size: .78rem; color: var(--ink-2); }

@media (min-width: 992px) {
    .opage { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "main fin" "main jr"; grid-template-rows: auto 1fr; align-items: start; }
    .omain { grid-area: main; } .ofin { grid-area: fin; } .ojournal { grid-area: jr; }
}

/* --- Правка наряда на месте (этап 2.1) ------------------------------------ */
.topbar-new { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.ohead-title-input {
    display: block; width: 100%; max-width: 640px; margin: 2px 0 0; padding: 4px 8px; margin-left: -8px;
    border: 1px solid transparent; border-radius: 8px; background: transparent;
    font: inherit; font-size: 1.05rem; font-weight: 700; color: var(--ink);
}
.ohead-title-input::placeholder { color: var(--ink-2); font-weight: 500; font-style: italic; }
.ohead-title-input:hover { border-color: var(--line); }
.ohead-title-input:focus { outline: none; border-color: #C2410C; background: #fff; box-shadow: 0 0 0 3px rgba(194, 65, 12, .15); }
.save-state { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.save-state.is-saved { color: #14663A; }
.save-state.is-error { color: #B42318; }
.icon-btn-danger:hover { border-color: #B42318; color: #B42318; }
.oblock-toggle { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 12px; border: 1px dashed #CBD0D8; border-radius: 10px; background: transparent; color: var(--ink-2); font-size: .88rem; font-weight: 600; cursor: pointer; }
.oblock-toggle:hover { border-color: #C2410C; color: #C2410C; }

.einput {
    width: 100%; min-height: 38px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px;
    background: transparent; font: inherit; color: var(--ink);
}
.einput::placeholder { color: #9AA1AC; }
.einput:hover { border-color: var(--line); }
.einput:focus { outline: none; border-color: #C2410C; background: #fff; box-shadow: 0 0 0 3px rgba(194, 65, 12, .15); }
.e-num { text-align: right; font-variant-numeric: tabular-nums; }
.e-code { min-height: 28px; padding-top: 2px; padding-bottom: 2px; font-size: .82rem; color: var(--ink-2); }
.e-area { display: block; resize: none; line-height: 1.45; min-height: 64px; border-color: var(--line); background: #FAFAFB; }

.otbl-edit { table-layout: fixed; }
.otbl-edit td { vertical-align: middle; padding: 4px; }
/* заголовки встают над текстом в полях: отступ ячейки 4 + поле 8 + рамка 1 */
.otbl-edit th { padding: 6px 13px; }
.otbl-edit th.text-center { text-align: right; }
.otbl-edit th.otbl-check, .otbl-edit th.e-del { padding-left: 0; padding-right: 0; }
/* ширины колонок задаёт строка заголовков (table-layout: fixed): иначе «Наименование» делит место поровну с цифрами */
.otbl-edit th.th-price, .otbl-edit th.th-sum { width: 120px; }
.otbl-edit th.th-qty { width: 84px; }
.otbl-edit .otbl-check { width: 44px; }
.otbl-edit .e-price { width: 120px; }
.otbl-edit .e-qty { width: 84px; }
.otbl-edit .e-sum { width: 120px; text-align: right; font-weight: 600; padding-right: 13px; }
.otbl-edit .e-del { width: 44px; text-align: center; }
.otbl-edit.is-parts .otbl-name { vertical-align: top; }
.otbl-edit .erow.is-done .e-name { color: #14663A; text-decoration: line-through; }
.otbl-edit .erow.is-saving { opacity: .6; }
.otbl-edit .erow.is-error { background: #FDECEA; }
.otbl-edit .erow-new { border-top: 1px dashed var(--line); }
.otbl-edit .erow-new .e-name { background: #FAFAFB; border-color: var(--line); }
.row-del, .row-add {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    border: 0; border-radius: 8px; background: transparent; color: #9AA1AC; cursor: pointer;
}
.row-del:hover, .row-del.is-armed { background: #FDE8E6; color: #B42318; }
.row-add { color: #C2410C; }
.row-add:hover { background: #FFF1E8; }
.e-namecell { position: relative; }
.sugg {
    position: absolute; z-index: 30; left: 4px; right: 4px; top: calc(100% - 2px); margin: 0; padding: 4px; list-style: none;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(20, 23, 28, .14);
    max-height: 280px; overflow-y: auto;
}
.sugg li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.sugg li:hover, .sugg li.is-active { background: #FFF1E8; }
.sugg-name { font-weight: 600; overflow-wrap: anywhere; }
.sugg-meta { flex: 0 0 auto; font-size: .82rem; color: var(--ink-2); white-space: nowrap; }

@media (max-width: 767.98px) {
    .otbl-edit thead { display: none; }
    .otbl-edit, .otbl-edit tbody, .otbl-edit tr, .otbl-edit td { display: block; width: auto; }
    .otbl-edit tr.erow {
        display: grid; gap: 2px 6px; padding: 8px 0; border-bottom: 1px solid #EEF0F3; align-items: end;
        grid-template-columns: 40px 1fr 1fr 1fr 40px;
        grid-template-areas: "chk name name name del" ". price qty sum .";
    }
    .otbl-edit.is-parts tr.erow {
        grid-template-columns: 1fr 1fr 1fr 40px;
        grid-template-areas: "name name name del" "price qty sum .";
    }
    .otbl-edit.no-money tr.erow { grid-template-columns: 40px 1fr 90px 40px; grid-template-areas: "chk name name del" ". qty . ."; }
    .otbl-edit.is-parts.no-money tr.erow { grid-template-columns: 1fr 90px 40px; grid-template-areas: "name name del" "qty . ."; }
    .otbl-edit td { padding: 0; border: 0; }
    .otbl-edit .otbl-check { grid-area: chk; align-self: center; width: auto; }
    .otbl-edit .otbl-name { grid-area: name; }
    .otbl-edit .e-price { grid-area: price; width: auto; }
    .otbl-edit .e-qty { grid-area: qty; width: auto; }
    .otbl-edit .e-sum { grid-area: sum; width: auto; padding: 0 8px 8px 0; }
    .otbl-edit .e-del { grid-area: del; width: auto; align-self: center; }
    .otbl-edit td[data-label]::before { content: attr(data-label); display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; padding-left: 8px; }
    .otbl-edit .e-sum::before { text-align: right; }
    .einput { min-height: 44px; font-size: 1rem; }
    .row-del, .row-add { width: 44px; height: 44px; }
    .ohead-title-input { max-width: none; }
}

/* --- Финансы -------------------------------------------------------------- */
.monthnav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.monthnav-label { min-width: 150px; text-align: center; font-weight: 800; }
.monthnav-now { font-size: .85rem; font-weight: 700; text-decoration: none; margin-left: 4px; }
.icon-btn.is-disabled { opacity: .4; cursor: default; pointer-events: none; }
/* Выбор периода «с … по …» (11.11, partials/period_picker.php) */
.pernav { position: relative; }
.perpick { position: relative; }
.perpick-btn {
    list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; min-width: 190px; justify-content: center;
    padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 800; cursor: pointer; user-select: none;
}
.perpick-btn::-webkit-details-marker { display: none; }
.perpick-btn:hover, .perpick[open] .perpick-btn { border-color: #C2410C; }
.perpick-btn .bi-calendar3 { color: #C2410C; }
.perpick-caret { font-size: .8rem; color: var(--ink-2); transition: transform .15s; }
.perpick[open] .perpick-caret { transform: rotate(180deg); }
.perpick-panel {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 330px; max-width: calc(100vw - 32px);
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(20, 23, 28, .16); padding: 12px;
}
.perpick-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.perpick-chip {
    display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 10px;
    color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem;
}
.perpick-chip:hover { border-color: #C2410C; color: #C2410C; }
.perpick-chip.is-on { background: #FFF1EA; border-color: #C2410C; color: #9A3412; }
.perpick-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.perpick-field { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; font-weight: 700; color: var(--ink-2); min-width: 0; }
.perpick-field .form-control { min-height: 40px; }
.perpick-go { grid-column: 1 / -1; min-height: 42px; font-weight: 700; }
a.sumcard-link { text-decoration: none; color: inherit; }
a.sumcard-link:hover { border-color: #C2410C; }

.fgrid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin-bottom: 12px; }
@media (min-width: 992px) { .fgrid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.fbig { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.fbar { margin-bottom: 10px; }
.fbar-head { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; margin-bottom: 3px; }
.fbar-track { height: 10px; border-radius: 6px; background: #E8EAEE; overflow: hidden; }
.fbar-track > span { display: block; height: 100%; border-radius: 6px; }
.fbar-track .is-works { background: #1D4ED8; }
.fbar-track .is-parts { background: #D97706; }
.fbar-track .is-method { background: #14663A; }
/* «Работы» и «Запчасти» на «Финансах» — ссылки на детализацию (08.11) */
.fbar-link { display: block; color: inherit; text-decoration: none; border-radius: 10px; padding: 6px 8px; margin: 0 -8px 4px; }
.fbar-link:hover, .fbar-link:focus-visible { background: #F3F4F6; color: inherit; }
.fbar-link .fbar-head span { font-weight: 600; text-decoration: underline; text-decoration-color: #C3C8D0; text-underline-offset: 3px; }
.fbar-link .bi-chevron-right { font-size: .75rem; color: var(--ink-2); }
/* Страница «За что приняли деньги» */
.fbd-back { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-size: .9rem; font-weight: 600; text-decoration: none; }
.fbd-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.fbd-tab { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 52px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; }
.fbd-tab b { margin-left: auto; font-variant-numeric: tabular-nums; }
.fbd-tab.is-on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.fbd-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.fbd-dot.is-works { background: #1D4ED8; }
.fbd-dot.is-parts { background: #D97706; }
.fbd-search { position: relative; margin: 6px 0 8px; }
.fbd-search .bi-search { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.fbd-search .form-control { padding-left: 36px; min-height: 44px; }
.fbd-sum { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 10px; font-size: .95rem; }
.fbd-list { display: flex; flex-direction: column; gap: 14px; }
.fbd-day-head { position: sticky; top: var(--topbar-h); z-index: 2; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; padding: 8px 2px 6px; background: var(--bs-body-bg); border-bottom: 1px solid var(--line); font-size: .95rem; font-weight: 800; }
.fbd-day-sum { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.fbd-day-cards { display: flex; flex-direction: column; gap: 10px; }
.fbd-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.fbd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.fbd-num { font-weight: 800; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.fbd-amt { margin-left: auto; font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fbd-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; }
.fbd-title { color: var(--ink-2); }
.fbd-meta { margin-top: 4px; font-size: .85rem; color: var(--ink-2); }
.fbd-lines { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.fbd-line { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: baseline; border-radius: 6px; }
.fbd-line.is-hit { background: #FDEEE6; }
.fbd-line-name { min-width: 0; overflow-wrap: anywhere; }
.fbd-line-sum { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fbd-exec, .fbd-code { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: #EEF0F3; font-size: .8rem; color: var(--ink-2); }
.fbd-empty { margin-top: 8px; font-size: .9rem; }
@media (min-width: 992px) { .fbd-day-cards { display: grid; grid-template-columns: 1fr 1fr; align-items: start; } }
.fnote { font-size: .8rem; color: var(--ink-2); margin: 0 0 6px; }
.fsub { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 800; margin: 14px 0 8px; }
.fdays { display: flex; align-items: stretch; gap: 2px; height: 110px; }
.fday { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.fday-bar { flex: 1 1 auto; display: flex; align-items: flex-end; }
.fday-bar > span { display: block; width: 100%; background: #14663A; border-radius: 3px 3px 0 0; opacity: .85; }
.fday:hover .fday-bar > span { opacity: 1; }
.fdays.is-months { gap: 6px; }
.fday-n { height: 16px; font-size: .62rem; color: var(--ink-2); text-align: center; overflow: visible; white-space: nowrap; }
.frecent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.frecent-top, .frecent-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.frecent-bot a { font-size: .86rem; font-weight: 600; text-decoration: none; }

.funpaid { margin-bottom: 12px; scroll-margin-top: calc(var(--topbar-h) + 8px); }
.ufilters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ufilters .form-select { width: auto; flex: 0 1 auto; }
.ufilters-q { position: relative; flex: 1 1 240px; }
.ufilters-q .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.ufilters-q .form-control { padding-left: 36px; }
#unpaidBox { transition: opacity .12s; }
#unpaidBox.is-loading { opacity: .55; }
.usum { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; font-size: .92rem; }
.utable-wrap { border-radius: 12px; }
.age-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #E8EAEE; color: #3F4651; white-space: nowrap; }
.age-chip.is-warm { background: #FFF1D6; color: #8A4B00; }
.age-chip.is-hot { background: #FDE8E6; color: #B42318; }
.no-contact { font-size: .86rem; color: #8A4B00; }

/* --- Телефон -------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .page { padding: 12px 10px calc(12px + env(safe-area-inset-bottom)); }
    .board { height: calc(100dvh - var(--topbar-h) - 120px); gap: 10px; }
    .kcol { flex: 0 0 86vw; min-width: 0; max-width: none; }
    .stats { margin-left: 0; width: 100%; }
    .stat { flex: 1 1 0; min-width: 0; }
    .sumbar { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
    .sumcard { padding: 8px 12px; }
    .sumcard-value { font-size: 1.1rem; }
    .sumcard-note:not(a), .sumbar-progress { display: none; }
    .page-sub { display: none; }
    .ocols { grid-template-columns: 1fr; }
    .ocard { padding: 12px; }
    .ohead-num { font-size: 1.3rem; }
    .jlist { max-height: none; }
    .monthnav { margin-left: 0; width: 100%; justify-content: space-between; }
    .pernav .perpick { position: static; flex: 1 1 auto; min-width: 0; }
    .pernav .perpick-btn { width: 100%; min-width: 0; }
    .pernav .perpick-panel { left: 0; right: 0; width: auto; max-width: none; }
    .fbig { font-size: 1.5rem; }
    .ufilters .form-select { flex: 1 1 45%; }
    .sr-item { flex-wrap: wrap; padding: 10px 12px; }
    .sr-main { flex: 1 1 100%; }
    .sr-side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; text-align: left; padding-left: 66px; }
    .searchbox .form-control { padding-left: 42px; }
    .filterbar-date { width: 100%; }
    .filterbar-date .form-control { flex: 1 1 0; width: auto; min-width: 0; } /* поле даты без min-width: 0 не сжимается и на 360 px вылезало за край */
    .otable thead { display: none; }
    .otable, .otable tbody, .otable tr, .otable td { display: block; width: 100%; }
    .otable tr.orow { padding: 10px 12px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; }
    .otable tbody tr:last-child { border-bottom: 0; }
    .otable td { padding: 0; border: 0; }
    .otable td[data-label="№"] { grid-column: 1; grid-row: 1; }
    .otable td[data-label="Дата"] { grid-column: 2; grid-row: 1; align-self: center; }
    .otable td[data-label="Статус"] { grid-column: 3; grid-row: 1; text-align: right; }
    .otable td[data-label="Наряд"] { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
    .otable td[data-label="Клиент"] { grid-column: 1 / -1; grid-row: 3; }
    .otable td[data-label="Сумма"] { grid-column: 1 / 3; grid-row: 4; text-align: left !important; margin-top: 4px; }
    .otable td[data-label="Оплата"] { grid-column: 3; grid-row: 4; text-align: right; margin-top: 4px; }
}

/* --- Клиент и мотоцикл в наряде (этап 2.2) ---------------------------------- */
.kc-flag.is-link { cursor: pointer; }
.kc-flag.is-link:hover { background: #FFE3B0; }
.pbody { display: grid; gap: 6px; min-width: 0; }
.pcombo { position: relative; }
.pinput { background: #FAFAFB; border-color: var(--line); }
.pcombo .sugg { left: 0; right: 0; top: calc(100% + 2px); max-height: 340px; }
.sugg li.is-create { color: #9A3412; font-weight: 700; border-top: 1px solid #F0E4DA; border-radius: 0 0 8px 8px; margin-top: 2px; }
.sugg li.is-create .bi { margin-right: 6px; }
.sugg-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.sugg-main .plate { font-size: .74rem; }

.pcard { display: grid; gap: 6px; min-width: 0; }
.prow { display: flex; align-items: center; gap: 4px; min-width: 0; }
.prow > .einput { flex: 1 1 auto; min-width: 0; }
.pico { flex: 0 0 22px; text-align: center; color: var(--ink-2); }
.pname { font-size: 1.1rem; font-weight: 800; }
.pbtn {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 34px; height: 34px;
    border: 0; border-radius: 8px; background: transparent; color: #9AA1AC; cursor: pointer; text-decoration: none;
}
.pbtn:hover { background: #E8EAEE; color: var(--ink); }
.pbtn.is-danger:hover { background: #FDE8E6; color: #B42318; }
.pbtn.is-call { color: #14663A; }
.pfields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 8px; }
.pfield { display: flex; flex-direction: column; min-width: 0; }
.pfield > span { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; padding-left: 9px; }
.pfield-wide { grid-column: 1 / -1; }
.plate-input { font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.pextra { display: grid; gap: 4px 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pextra[hidden] { display: none; }
.pmore {
    justify-self: start; padding: 2px 9px; border: 0; background: transparent; color: var(--ink-2);
    font-size: .84rem; font-weight: 600; cursor: pointer; border-radius: 6px;
}
.pmore:hover { color: #C2410C; background: #FFF1E8; }
.pbike-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pbike-title .oblock-main { min-width: 0; }
.pbike-title .is-empty { color: var(--ink-2); font-weight: 500; font-style: italic; }
.phint {
    display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-radius: 10px;
    background: #F3F4F6; color: var(--ink); font-size: .92rem; overflow-wrap: anywhere;
}
.phint > span { flex: 1 1 auto; min-width: 0; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchips[hidden] { display: none; }
.pchip {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 12px; border: 1px solid var(--line);
    border-radius: 999px; background: #fff; color: var(--ink); font-size: .88rem; font-weight: 600; cursor: pointer; text-align: left;
}
.pchip:hover { border-color: #C2410C; color: #9A3412; }
.pchip .plate { font-size: .74rem; }
.pchips-list { display: contents; }
.pnew {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px dashed #C2410C; border-radius: 999px;
    background: #FFF8F3; color: #9A3412; font-size: .88rem; font-weight: 700; cursor: pointer;
}
.pnew:hover { background: #FFF1E8; }
.pnew .bi { font-size: .8rem; }
.pnotice { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: #FFF8E6; border: 1px solid #F5D98B; font-size: .9rem; line-height: 1.4; }
.pnotice[hidden] { display: none; }
.pnotice-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

@media (max-width: 767.98px) {
    .pcombo .sugg li { flex-direction: column; align-items: flex-start; gap: 2px; }
    .pcombo .sugg-meta { white-space: normal; }
    .pbtn { width: 44px; height: 44px; }
    .pchip, .pnew { padding: 10px 14px; }
    .pmore { padding: 8px 10px; }
    .sugg li { padding: 12px 10px; }
}
.phint[hidden], .oblock-link[hidden], .pmore[hidden] { display: none; }

/* --- История мотоцикла и копирование наряда (этап 2.3) ------------------------ */
.hist-basis {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; padding: 10px 14px;
    border-radius: 12px; font-size: .92rem; border: 1px solid var(--line); background: var(--surface);
}
.hist-basis > span { flex: 1 1 260px; min-width: 0; }
.hist-basis > .bi { font-size: 1.1rem; }
.hist-basis.is-ok { background: #EEF8F1; border-color: #BFE3CB; color: #14663A; }
.hist-basis.is-warn { background: #FFF8E6; border-color: #F5D98B; }
.hist-vin { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 12px; }
.hist-vin .form-control { flex: 1 1 260px; max-width: 360px; text-transform: uppercase; }
.hist-vin-error { flex-basis: 100%; }
.hist-vin[hidden], .hist-vin-error[hidden], #vinOpen[hidden] { display: none; }
.hist-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.hist-wide { grid-column: 1 / -1; }
.hist-chain { font-weight: 600; overflow-wrap: anywhere; }
.hist-other {
    display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; padding: 9px 14px;
    border: 1px dashed var(--line); border-radius: 12px; color: var(--ink-2); font-size: .9rem;
}
.hist-other > .bi { margin-top: 2px; }
.hist-other b { color: var(--ink); }
.hist-card { padding: 14px 16px 6px; }
.hist-list { list-style: none; margin: 0; padding: 0; }
.hrow {
    position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 12px 6px; border-top: 1px solid var(--line);
}
.hrow:first-child { border-top: 0; }
.hrow:hover { background: #FFF8F3; }
.hrow-main { min-width: 0; flex: 1 1 auto; }
.hrow-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.hrow-num { font-weight: 800; color: var(--ink); text-decoration: none; }
.hrow-date { color: var(--ink-2); font-size: .88rem; }
.hrow-title { margin-top: 2px; font-weight: 600; overflow-wrap: anywhere; }
.hrow-title.is-empty { color: var(--ink-2); font-weight: 500; font-style: italic; }
.hrow-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: .88rem; color: var(--ink-2); align-items: center; }
.hflag {
    display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px;
    background: #FFF1E8; color: #9A3412; font-size: .78rem; font-weight: 700;
}
.hrow-side { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; position: relative; z-index: 2; }
.hrow-sum { font-weight: 700; text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.hrow-copy { width: 36px; height: 36px; font-size: 1rem; }

.copy-choice { display: grid; gap: 8px; margin-bottom: 14px; }
.copy-opt {
    display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line);
    border-radius: 12px; cursor: pointer; background: var(--surface);
}
.copy-opt:hover { border-color: #C2410C; }
.copy-opt:has(input:checked) { border-color: #C2410C; background: #FFF8F3; box-shadow: 0 0 0 1px #C2410C inset; }
.copy-opt input { margin-top: 4px; accent-color: #C2410C; }
.copy-opt-body { display: flex; flex-direction: column; min-width: 0; }
.copy-opt-title { font-weight: 700; }
.copy-opt-sub { font-size: .86rem; color: var(--ink-2); overflow-wrap: anywhere; }
.copy-hint { margin-bottom: 12px; font-size: .9rem; color: var(--ink-2); }
.copy-hint[hidden], .copy-choice[hidden], #copyNote[hidden], #copyBody[hidden], #copyLoading[hidden], .copy-total[hidden] { display: none; }
.copy-what { margin: 0 0 10px; }
.copy-what dt { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); margin-top: 6px; }
.copy-what dd { margin: 0 0 4px; overflow-wrap: anywhere; }
.copy-count { font-weight: 700; color: var(--ink); }
.copy-total { padding: 8px 12px; border-radius: 10px; background: #F3F4F6; margin-bottom: 8px; }
.copy-skip { font-size: .82rem; color: var(--ink-2); }

@media (max-width: 767.98px) {
    .hist-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hrow { flex-wrap: wrap; padding: 14px 4px; }
    .hrow-side { width: 100%; justify-content: space-between; }
    .hrow-copy { width: 44px; height: 44px; }
    .hist-vin .btn { min-height: 44px; }
}

/* --- Механики и исполнители (этап 2.4) ------------------------------------ */
/* Кружок механика: первая буква имени на цветном фоне. Цвет — номер 0…7 из справочника механиков. */
.mchip {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: .72rem; font-weight: 800; line-height: 1;
    vertical-align: middle; user-select: none;
}
.mchip[hidden] { display: none; }
.mchip-lg { width: 34px; height: 34px; font-size: .95rem; }
.mc-0 { background: #2563EB; } .mc-1 { background: #047857; } .mc-2 { background: #7C3AED; } .mc-3 { background: #BE185D; }
.mc-4 { background: #0E7490; } .mc-5 { background: #A16207; } .mc-6 { background: #B91C1C; } .mc-7 { background: #475569; }
.mc-none { background: #E5E7EB; color: #6B7280; }
.mech-staff { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-2); }

/* Основной механик в шапке наряда */
.mech-pick { display: inline-block; }
.mech-btn, .mech-static {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 10px 2px 4px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
    font: inherit; font-size: .88rem; font-weight: 700; max-width: 100%;
}
.mech-btn { cursor: pointer; }
.mech-btn:hover { border-color: #C2410C; }
.mech-btn.is-empty { border-style: dashed; color: var(--ink-2); font-weight: 600; }
.mech-btn .bi-chevron-down { font-size: .7rem; color: var(--ink-2); }
.mech-btn-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.mech-static { border-color: transparent; background: transparent; padding-left: 0; }
.mech-menu { min-width: 250px; padding: 6px; border-radius: 12px; }
.mech-menu .dropdown-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.mech-menu .dropdown-item { display: flex; align-items: center; gap: 10px; border-radius: 8px; min-height: 40px; font-weight: 600; }

/* Исполнитель в строке работы: кружок слева, список справа. Нажатие открывает обычный список выбора */
.e-exec { width: 188px; }
.exec-sel { position: relative; display: block; }
.exec-sel .mchip { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.exec-sel::after { content: '▾'; position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: #9AA1AC; font-size: .8rem; pointer-events: none; }
.exec-select {
    width: 100%; min-height: 38px; padding: 6px 24px 6px 36px; border: 1px solid transparent; border-radius: 8px;
    background: transparent; font: inherit; color: var(--ink); text-overflow: ellipsis; cursor: pointer;
    -webkit-appearance: none; appearance: none;
}
.exec-sel.is-empty .exec-select { padding-left: 10px; color: var(--ink-2); }
.exec-select:hover { border-color: var(--line); }
.exec-select:focus { outline: none; border-color: #C2410C; background: #fff; box-shadow: 0 0 0 3px rgba(194, 65, 12, .15); }
.otbl-edit .erow.is-done .exec-select { text-decoration: none; }
.otbl-edit th.e-exec-h { width: 188px; padding-left: 13px; }
.otbl-exec { white-space: nowrap; }
.otbl-exec .mchip { margin-right: 4px; }

/* Живое обновление наряда: «кто сейчас в наряде» и полоска «наряд изменили» */
.live-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px;
    background: #EEF5FF; border: 1px solid #C9DCFB; color: #1D4ED8; font-size: .78rem; font-weight: 700; line-height: 1.5;
}
.live-chip[hidden] { display: none; }
.live-banner {
    display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px;
    background: #FFF8E6; border: 1px solid #F5D98B; font-size: .9rem; line-height: 1.4;
    /* прилипает под верхней панелью: видна, даже когда человек ушёл вниз страницы */
    position: sticky; top: calc(var(--topbar-h) + 6px); z-index: 1020; box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.live-banner[hidden] { display: none; }
.live-banner > .bi { flex: 0 0 auto; color: #B45309; }
.live-banner-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.live-banner-btn {
    flex: 0 0 auto; min-height: 44px; padding: 0 16px; border: 0; border-radius: 8px;
    background: #C2410C; color: #fff; font: inherit; font-weight: 800; cursor: pointer;
}
.live-banner-btn:hover { background: #A8370A; }

/* Сообщение после смены основного механика с кнопкой «Отменить» */
.exec-note {
    display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: 10px;
    background: #EEF5FF; border: 1px solid #C9DCFB; font-size: .9rem; line-height: 1.4;
}
.exec-note[hidden] { display: none; }
.exec-note > .bi { margin-top: 2px; color: #2563EB; }
.exec-note-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.exec-note-undo { flex: 0 0 auto; border: 0; background: transparent; padding: 0 2px; font: inherit; font-weight: 800; color: #C2410C; cursor: pointer; text-decoration: underline; }
.exec-note-undo:hover { color: #A8370A; }

/* Блок «Кто что делал» */
.oexec { align-self: start; }
.xlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.xhead { display: flex; align-items: center; gap: 8px; }
.xname { font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.xcount { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--ink-2); background: #F1F2F4; border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.xcount.is-done { color: #14663A; background: #DDF4E6; }
.xworks { list-style: none; margin: 4px 0 0 30px; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: .88rem; }
.xworks li { display: flex; gap: 6px; align-items: baseline; overflow-wrap: anywhere; }
.xworks li .bi { color: var(--ink-2); flex: 0 0 auto; }
.xworks li.is-done { color: #14663A; }
.xworks li.is-done .bi { color: #14663A; }

@media (min-width: 992px) {
    .opage { grid-template-areas: "main fin" "main ex" "main jr"; grid-template-rows: auto auto 1fr; }
    .oexec { grid-area: ex; }
}

@media (max-width: 767.98px) {
    .e-exec { width: auto; }
    .otbl-edit.has-exec tr.erow { grid-template-areas: "chk name name name del" ". price qty sum ." ". exec exec exec ."; }
    .otbl-edit.has-exec.no-money tr.erow { grid-template-areas: "chk name name del" ". qty . ." ". exec exec ."; }
    .otbl-edit .e-exec { grid-area: exec; }
    .otbl-edit .e-exec-new { display: none; }
    .exec-select { min-height: 44px; font-size: 1rem; }
    .mech-btn-name { max-width: 120px; }
}

/* Карточка на доске и подсказка-легенда */
/* в верхней строке карточки тесно: если всё не помещается, дата уходит на вторую строку, а не под кнопку «перенести» */
.kc-top { flex-wrap: wrap; row-gap: 0; }
.kc-mech { margin-left: auto; display: inline-flex; align-items: center; }
.kc-mech + .kc-date { margin-left: 0; }
.kc-mech .mchip { width: 18px; height: 18px; font-size: .62rem; }
/* несколько участников: кружки чуть налезают друг на друга, чтобы карточка не распухала */
.kc-mech .mchip + .mchip { margin-left: -5px; box-shadow: 0 0 0 2px var(--surface); }
.kc-mech-more { margin-left: 3px; font-size: .68rem; font-weight: 800; color: var(--ink-2); }
.mlegend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 12px; }
.mlegend-item {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 10px 2px 4px; border: 1px solid var(--line);
    border-radius: 999px; background: var(--surface); font: inherit; font-size: .84rem; font-weight: 700; color: var(--ink); cursor: pointer;
}
.mlegend-item:hover { border-color: #C2410C; }
.mlegend-n { min-width: 18px; padding: 0 5px; border-radius: 999px; background: #F1F5F9; color: var(--ink-2); font-size: .72rem; font-weight: 800; text-align: center; }
.mlegend-item.is-active .mlegend-n { background: #FFE0CC; color: #9A3412; }
.mlegend-item.is-active { border-color: #C2410C; background: #FFF1E8; box-shadow: 0 0 0 1px #C2410C inset; }
.mlegend-clear { border: 0; background: transparent; font: inherit; font-size: .84rem; font-weight: 700; color: #C2410C; cursor: pointer; padding: 4px 6px; }
.mlegend-clear[hidden] { display: none; }
.kcard.is-filtered-out { display: none; }

/* Список нарядов: кружок механика */
.hrow-mech { display: inline-flex; align-items: center; gap: 4px; }
.hrow-mech .mchip { width: 20px; height: 20px; font-size: .66rem; }

/* Окно «Работы и оплата»: исполнитель у каждой невыполненной работы */
#gateWorksList .list-group-item { flex-wrap: wrap; }
#gateWorksList .gate-name { flex: 1 1 0; min-width: 120px; }
#gateWorksList .gate-exec-sel { flex: 0 0 170px; }
#gateWorksList .gate-exec-sel .exec-select { border-color: var(--line); background: #FAFAFB; min-height: 38px; }
@media (max-width: 575.98px) {
    #gateWorksList .gate-exec-sel { flex: 1 1 100%; margin-left: 34px; }
}

/* Окно «Сотрудники» (этап 2.6) */
/* Выбор цвета кружка механика (палитра из восьми цветов) */
.mech-color { border: 0; background: transparent; padding: 0; cursor: pointer; border-radius: 50%; line-height: 0; }
.mech-color:hover .mchip { box-shadow: 0 0 0 3px rgba(194, 65, 12, .25); }
.mech-palette { padding: 8px; min-width: 0; display: none; grid-template-columns: repeat(4, 34px); gap: 6px; }
.mech-palette.show { display: grid; }
.mech-swatch { border: 0; background: transparent; padding: 0; border-radius: 50%; cursor: pointer; line-height: 0; }
.mech-swatch .mchip { width: 34px; height: 34px; font-size: 1rem; }
.mech-swatch:hover .mchip { box-shadow: 0 0 0 3px rgba(194, 65, 12, .25); }

.st-tabs { gap: 6px; margin-bottom: 12px; }
.st-tabs .nav-link { color: var(--ink-2); font-weight: 700; background: var(--surface); border: 1px solid var(--line); }
.st-tabs .nav-link.active { background: #C2410C; border-color: #C2410C; color: #fff; }

/* Люди: кружок | имя и роль | состояние | кнопки */
.st-list { display: flex; flex-direction: column; padding-top: 4px; padding-bottom: 4px; }
.st-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #EEF0F3; }
.st-row:last-child { border-bottom: 0; }
.st-row.is-closed .st-main { opacity: .7; }
.st-main { min-width: 0; }
.st-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-meta { font-size: .85rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-login { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.st-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.st-badge.is-ok { background: #E3F4EA; color: #14663A; }
.st-badge.is-wait { background: #FFF4D6; color: #8A5A00; }
.st-badge.is-bad { background: #FDE8E6; color: #B42318; }
.st-badge.is-off { background: #EDEFF2; color: #4B5563; }
.st-act { display: flex; align-items: center; gap: 6px; }
.st-btn { min-height: 36px; min-width: 36px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; white-space: nowrap; }
.st-own { margin-left: auto; padding: 0 6px; border-radius: 999px; background: #C2410C; color: #fff; font-size: .7rem; font-weight: 800; line-height: 1.5; }
.st-btn .st-own { margin-left: 6px; }
.st-own[hidden] { display: none; }
.st-closed { margin-top: 12px; }
.st-closed summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.st-closed .st-list { margin-top: 6px; }

/* Таблица прав ролей: функция | Менеджер | Механик | Студент */
.st-matrix { padding: 8px 16px 12px; }
.st-matrix-note { color: var(--ink-2); font-size: .88rem; }
.mx-head, .mx-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 84px); align-items: center; gap: 4px; }
.mx-head { position: sticky; top: var(--topbar-h); z-index: 2; padding: 6px 0; background: var(--surface); border-bottom: 1px solid var(--line); font-size: .78rem; font-weight: 800; color: var(--ink-2); }
.mx-role { text-align: center; }
.mx-group { margin-top: 10px; padding: 4px 0; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #C2410C; }
.mx-row { padding: 6px 0; border-bottom: 1px solid #EEF0F3; }
.mx-title { min-width: 0; font-weight: 600; }
.mx-hint { display: block; font-size: .8rem; font-weight: 400; color: var(--ink-2); }
.mx-cell { display: flex; align-items: center; justify-content: center; min-height: 40px; margin: 0; cursor: pointer; }
/* переключатель «да / нет» */
.mx-sw {
    appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 auto; margin: 0; cursor: pointer;
    width: 42px; height: 24px; border: 1px solid #C9CDD3; border-radius: 999px; background: #E5E7EB; transition: background .15s;
}
.mx-sw::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s;
}
.mx-sw:checked { background: #C2410C; border-color: #C2410C; }
.mx-sw:checked::after { transform: translateX(18px); }
.mx-sw:disabled { opacity: .4; cursor: not-allowed; }
.mx-sw:focus-visible { outline: 2px solid #C2410C; outline-offset: 2px; }

/* Окна: добавить, права одного сотрудника, ссылка */
.st-roles { display: flex; gap: 6px; }
.st-roles .btn { flex: 1 1 0; font-weight: 700; }
.st-roles .btn-check:checked + .btn { background: #C2410C; border-color: #C2410C; color: #fff; }
.st-roles .btn-check:disabled + .btn { opacity: .5; }
.st-linktext { font-size: .9rem; resize: none; background: #F8F9FA; }
#stAddModal .form-check-input:checked { background-color: #C2410C; border-color: #C2410C; }
#stAddModal .form-check-input:focus { border-color: #C2410C; box-shadow: 0 0 0 .2rem rgba(194, 65, 12, .25); }
.st-rolebox { margin-bottom: 12px; }
.st-ownbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 8px 12px; border-radius: 10px; background: #FFF1E8; font-size: .9rem; }
.st-ownbar[hidden] { display: none; }
.st-rg-group { margin-top: 12px; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #C2410C; }
.st-rg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 8px 0; border-bottom: 1px solid #EEF0F3; cursor: pointer; }
.st-rg-row.is-own { margin: 0 -8px; padding: 8px; border-radius: 8px; border-bottom-color: transparent; background: #FFF4EC; }
.st-rg-text { display: flex; flex-direction: column; min-width: 0; }
.st-rg-title { font-weight: 600; }
.st-rg-note { font-size: .78rem; color: #C2410C; }

@media (max-width: 767.98px) {
    .st-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
    .st-chip { grid-row: 1 / span 2; align-self: start; }
    .st-state { grid-column: 2 / 4; grid-row: 2; }
    .st-act { grid-column: 3; grid-row: 1; }
}
@media (max-width: 575.98px) {
    .st-matrix { padding: 8px 10px 12px; }
    .mx-head, .mx-row { grid-template-columns: minmax(0, 1fr) repeat(3, 58px); gap: 2px; }
    .mx-head { font-size: .7rem; }
    .mx-hint { display: none; }
    .mx-sw { width: 38px; height: 22px; }
    .mx-sw::after { width: 16px; height: 16px; }
    .mx-sw:checked::after { transform: translateX(16px); }
}

/* Первый вход по ссылке */
.invite-card { max-width: 420px; }
.invite-note { margin: 14px 0 0; text-align: center; color: var(--ink-2); font-size: .85rem; }

/* ==========================================================================
   Фото в наряде (этап 2.5): сетка миниатюр, загрузка, просмотр на весь экран.
   Разметка: app/Views/orders/_photos.php, поведение: assets/js/photos.js
   ========================================================================== */
.ph-add { position: relative; display: inline-block; text-transform: none; letter-spacing: 0; font-weight: 400; }
.ph-add-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.ph-add-btn .bi, .ph-menu .dropdown-item .bi { margin: 0; }
.ph-menu { min-width: 230px; padding: 6px; border-radius: 12px; }
.ph-menu .dropdown-item { display: flex; align-items: center; gap: 10px; min-height: 44px; border-radius: 8px; font-weight: 600; }

.ph-groups { display: flex; flex-direction: column; gap: 12px; }
.ph-groups:empty { display: none; }
.ph-group-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: .86rem; font-weight: 700; }
.ph-group-n { color: var(--ink-2); font-weight: 600; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }

/* Плитка квадратная без aspect-ratio: старые телефоны его не знают */
.ph-tile { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--col-bg); color: inherit; font: inherit; cursor: pointer; }
.ph-tile::before { content: ''; display: block; padding-top: 100%; }
.ph-tile img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-tile:hover { border-color: #C2410C; }
.ph-tile:focus-visible { outline: 3px solid rgba(194, 65, 12, .45); outline-offset: 1px; }
.ph-cap {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: .74rem; font-weight: 600; line-height: 1.2;
    color: #fff; text-align: left; background: linear-gradient(to top, rgba(0, 0, 0, .65), transparent);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Загружаемый снимок: превью, полоска хода, подпись состояния */
.ph-tile.is-upload { cursor: default; }
.ph-tile.is-upload img { opacity: .55; }
.ph-tile.is-error { cursor: pointer; border-color: #B42318; }
.ph-ph { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--ink-2); }
.ph-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(0, 0, 0, .18); }
.ph-bar > span { display: block; width: 0; height: 100%; background: #C2410C; transition: width .15s linear; }
.ph-label {
    position: absolute; left: 6px; bottom: 10px; max-width: calc(100% - 12px); padding: 1px 8px; border-radius: 999px;
    font-size: .72rem; font-weight: 700; color: #fff; background: rgba(20, 23, 28, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-tile.is-error .ph-label { background: #B42318; }
.ph-retry {
    position: absolute; top: 42%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #B42318; color: #fff; font-size: 1.2rem; pointer-events: none;
}
.ph-act {
    position: absolute; top: 4px; right: 4px; z-index: 2; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 0; border-radius: 50%; background: rgba(20, 23, 28, .72); color: #fff; font-size: .8rem; cursor: pointer;
}
.ph-act:hover { background: #14171C; }
.ph-act .bi { margin: 0; }

/* Перетаскивание файлов на блок */
#photosCard.is-drop { border-color: #C2410C; background: #FFF7F2; box-shadow: 0 0 0 2px rgba(194, 65, 12, .35); }

/* Просмотр на весь экран: выше шапки и окон (1030–1055), ниже всплывающих сообщений (1100) */
html.ph-lock, html.ph-lock body { overflow: hidden; }
.ph-viewer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1090; display: flex; flex-direction: column; background: #0A0C10; color: #fff; }
.ph-v-top {
    display: flex; align-items: center; gap: 6px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) 8px calc(12px + env(safe-area-inset-left, 0px));
}
.ph-v-info { flex: 1 1 auto; min-width: 0; }
.ph-v-count { font-weight: 800; }
.ph-v-meta { font-size: .8rem; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-v-btn {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 10px;
    border: 0; border-radius: 22px; background: rgba(255, 255, 255, .12); color: #fff; font: inherit; font-size: 1.15rem; text-decoration: none; cursor: pointer;
}
.ph-v-btn:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.ph-v-btn:focus-visible, .ph-v-nav:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ph-v-del.is-armed { background: #B42318; }
.ph-v-del-text { font-size: .9rem; font-weight: 700; }
.ph-v-del-text:empty { display: none; }

.ph-v-stage { position: relative; flex: 1 1 auto; min-height: 0; touch-action: pan-y pinch-zoom; }
.ph-v-stage img {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; max-width: 100%; max-height: 100%;
    object-fit: contain; user-select: none; -webkit-user-drag: none; transition: opacity .15s;
}
.ph-v-stage img.is-loading { opacity: .25; }
.ph-v-spin {
    position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: ph-spin .8s linear infinite; pointer-events: none;
}
@keyframes ph-spin { to { transform: rotate(360deg); } }
.ph-v-nav {
    position: absolute; top: 50%; z-index: 2; width: 48px; height: 64px; margin-top: -32px; display: flex; align-items: center; justify-content: center;
    border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.4rem; cursor: pointer;
}
.ph-v-nav:hover { background: rgba(255, 255, 255, .24); }
.ph-v-nav.is-prev { left: 0; border-radius: 0 12px 12px 0; }
.ph-v-nav.is-next { right: 0; border-radius: 12px 0 0 12px; }

.ph-v-bottom { padding: 8px calc(12px + env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px)); }
.ph-v-caption {
    display: block; width: 100%; max-width: 640px; min-height: 44px; margin: 0 auto; padding: 8px 12px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #fff; font: inherit;
}
.ph-v-caption::placeholder { color: rgba(255, 255, 255, .6); }
.ph-v-caption:focus { outline: 0; border-color: #fff; background: rgba(255, 255, 255, .16); }
.ph-v-caption-text { max-width: 640px; margin: 0 auto; text-align: center; overflow-wrap: anywhere; }

@media (max-width: 575.98px) {
    .ph-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
}
/* Палец: кнопки не меньше 44 px (в углу плитки кнопка «убрать» квадратная и упирается в край) */
@media (pointer: coarse) {
    .ph-add-btn { min-height: 44px; padding: 0 14px; }
    .ph-act { top: 0; right: 0; width: 44px; height: 44px; border-radius: 0 0 0 12px; font-size: 1rem; }
    .ph-v-nav { width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .ph-v-spin { animation-duration: 2.4s; }
    .ph-bar > span, .ph-v-stage img { transition: none; }
}

/* Окно «Дубли клиентов» */
.dup-filter { max-width: 420px; }
.dup-group[hidden] { display: none; }
.dup-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.dup-phone { font-weight: 800; font-size: 1.05rem; }
.dup-card {
    display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid var(--line); border-radius: 8px;
}
.dup-card.is-main { background: #F1F7FF; }
.dup-main-pick, .dup-donor-pick { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: 0; cursor: pointer; }
.dup-main-pick { min-width: 28px; }
.dup-main-pick .form-check-input { width: 1.25rem; height: 1.25rem; margin: 0; border-color: #94A3B8; }
.dup-donor-pick { flex: 0 0 auto; font-size: .9rem; white-space: nowrap; }
.dup-donor-pick[hidden], .dup-main-badge[hidden] { display: none; }
.dup-info { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.dup-name { font-weight: 700; }
.dup-differ { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 0; padding: 8px 10px; background: #FFF8E6; border: 1px solid #F5D98B; border-radius: 8px; }
.dup-differ .form-check-input { flex: 0 0 auto; margin-top: 2px; }
.dup-actions { margin-top: 12px; }
.dup-actions .btn { min-height: 44px; }
.dup-merge { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dup-merge-text { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.dup-merge.is-undone { opacity: .6; }

/* ---- «Установка» (/install, решение владельца 07.11): база, проекты, шаги, итоги команд ---- */
.ins-env { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 12px 14px; border-radius: 14px; border: 2px solid; }
.ins-env.is-test { background: #FFF7E0; border-color: #E8B100; }
.ins-env.is-prod { background: #FDECEC; border-color: #B42318; }
.ins-env-word { font-size: 1.5rem; font-weight: 900; letter-spacing: .06em; line-height: 1; }
.ins-env.is-test .ins-env-word { color: #8A6100; }
.ins-env.is-prod .ins-env-word { color: #B42318; }
.ins-env-text { min-width: 0; font-size: .92rem; overflow-wrap: anywhere; }
.ins-env-meta { display: block; margin-top: 2px; font-size: .78rem; color: var(--ink-2); }
.ins-summary { margin: 0 0 10px; font-size: .95rem; }
.ins-note { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: #EEF4FF; border: 1px solid #C9D8FB; font-size: .9rem; }
.ins-note > .bi { font-size: 1.2rem; color: #1D4ED8; }
.ins-proj { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
.ins-proj-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 14px; min-height: 56px; cursor: pointer; list-style: none; }
.ins-proj-head::-webkit-details-marker { display: none; }
.ins-proj-title { font-weight: 800; font-size: 1.05rem; }
.ins-proj-ver { color: var(--ink-2); font-size: .85rem; }
.ins-chev { margin-left: auto; transition: transform .15s; color: var(--ink-2); }
.ins-proj[open] > .ins-proj-head .ins-chev { transform: rotate(180deg); }
.ins-pill { display: inline-flex; align-items: center; gap: 2px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.ins-pill.is-ok { background: #E7F6EC; color: #1E7A3C; }
.ins-pill.is-wait { background: #FFF1D6; color: #8A5300; }
.ins-pill.is-bad { background: #FDECEC; color: #B42318; }
.ins-next { padding: 0 14px 8px; font-size: .9rem; }
.ins-problem { margin: 0 14px 8px; color: #B42318; font-size: .9rem; overflow-wrap: anywhere; }
.ins-steps { border-top: 1px solid var(--line); }
.ins-step { padding: 12px 14px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--topbar-h) + 8px); transition: background .3s; }
.ins-step:last-child { border-bottom: 0; }
.ins-step.is-flash { background: #FFF7E0; }
.ins-step.is-done .ins-step-title { font-weight: 600; }
.ins-step-head { display: flex; gap: 10px; align-items: flex-start; }
.ins-ico { font-size: 1.25rem; line-height: 1.2; flex: 0 0 auto; }
.ins-step-title { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.ins-step-n { display: inline-block; margin-right: 4px; color: var(--ink-2); font-weight: 800; }
.ins-tag { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 6px; background: #EEF0F3; color: var(--ink-2); font-size: .74rem; font-weight: 700; vertical-align: middle; }
.ins-tag.is-danger { background: #FDECEC; color: #B42318; }
.ins-state { margin: 4px 0 0 30px; font-size: .9rem; color: var(--ink-2); overflow-wrap: anywhere; }
.ins-step.is-pending .ins-state { color: #8A5300; font-weight: 600; }
.ins-step.is-blocked .ins-state, .ins-step.is-broken .ins-state { color: #B42318; }
.ins-warn { margin: 6px 0 0 30px; padding: 6px 10px; border-radius: 8px; background: #FFF1D6; font-size: .85rem; overflow-wrap: anywhere; }
.ins-about, .ins-after { margin: 6px 0 0 30px; font-size: .9rem; overflow-wrap: anywhere; }
.ins-step.is-done { padding-top: 10px; padding-bottom: 6px; }
.ins-more { font-size: .9rem; }
.ins-more > summary { color: var(--ink-2); cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; }
.ins-more[open] { flex-basis: 100%; order: 10; }
.ins-more .ins-about { margin: 0 0 4px; }
.ins-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0 30px; }
.ins-acts .btn { min-height: 44px; }
.ins-acts .btn-link { padding-left: 6px; padding-right: 6px; text-decoration: none; }
.ins-acts.is-compact { margin-top: 2px; gap: 0 10px; }
.ins-acts.is-compact .btn { min-height: 40px; padding-left: 0; padding-right: 0; font-size: .9rem; }
.ins-confirm { margin: 10px 0 0 30px; padding: 10px 12px; border-radius: 12px; background: #F7F7F8; border: 1px solid var(--line); }
.ins-confirm-text { margin: 0 0 8px; font-size: .9rem; }
.ins-confirm-check { margin: 0 0 8px; }
.ins-confirm-check .form-check-input { width: 1.25em; height: 1.25em; }
.ins-confirm-check .form-check-label { padding-left: 4px; }
.ins-confirm-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ins-confirm-acts .btn { min-height: 44px; }
.ins-out { margin: 0 0 0 30px; min-width: 0; }
.ins-out:empty { display: none; }
.ins-out > * { margin-top: 10px; }
.ins-wait { color: var(--ink-2); font-size: .9rem; }
.ins-res { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #FAFAFB; min-width: 0; }
.ins-res.is-ok { border-color: #BFE3CB; background: #F3FBF5; }
.ins-res.is-bad { border-color: #F2C4C0; background: #FEF5F4; }
.ins-res-head { font-weight: 700; font-size: .92rem; overflow-wrap: anywhere; }
.ins-res-err { margin-top: 4px; color: #B42318; font-size: .85rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.ins-res-acts { margin-top: 10px; }
.ins-copy { min-height: 40px; }
.ins-check-title, .ins-cmd-title { margin: 10px 0 4px; font-weight: 700; font-size: .88rem; }
.ins-log { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ins-log > li { padding: 6px 8px; border-radius: 8px; background: #fff; border: 1px solid var(--line); min-width: 0; }
.ins-log > li.is-bad { border-color: #F2C4C0; }
.ins-cmd { min-width: 0; }
.ins-cmd code { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; }
.ins-cmd code.is-open { display: block; -webkit-line-clamp: unset; }
.ins-cmd-n { display: block; color: var(--ink-2); font-size: .74rem; font-weight: 700; }
.ins-cmd-res { color: var(--ink-2); font-size: .78rem; }
.ins-cmd-msg { margin-top: 2px; font-size: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.ins-table-wrap { overflow-x: auto; max-width: 100%; margin-top: 4px; -webkit-overflow-scrolling: touch; }
.ins-table { border-collapse: collapse; font-size: .8rem; background: #fff; }
.ins-table th, .ins-table td { border: 1px solid var(--line); padding: 3px 7px; text-align: left; vertical-align: top; white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.ins-table th { background: #F3F4F6; font-weight: 700; }
.ins-empty, .ins-more-rows { color: var(--ink-2); font-size: .82rem; margin-top: 2px; }
.ins-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ins-hist > li { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: .85rem; min-width: 0; overflow-wrap: anywhere; }
.ins-hist-sum { color: var(--ink-2); margin: 2px 0; }
.ins-copy-area { position: fixed; top: -1000px; left: 0; width: 1px; height: 1px; opacity: 0; }
.ins-copy-manual { margin-top: 8px; font-family: var(--bs-font-monospace); font-size: .78rem; }
@media (min-width: 768px) {
    .ins-env-word { font-size: 1.9rem; }
    .ins-step { padding: 14px 18px; }
}

/* ---- Доска: «Сумма» и «Оплачено» с начала месяца, подсказка с раскладкой (09.11) ---- */
.stat-sub { font-weight: 600; text-transform: none; letter-spacing: 0; }
.stat-link { position: relative; color: inherit; text-decoration: none; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.stat-link:hover, .stat-link:focus-visible { border-color: #9BB7F0; box-shadow: 0 2px 8px rgba(29, 78, 216, .12); color: inherit; }
.stat-link::after { content: '\F285'; font-family: 'bootstrap-icons'; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: .7rem; color: var(--ink-2); }
.stat.stat-link { padding-right: 24px; }
.stat-pop {
    display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 260px;
    padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
    font-size: .85rem; color: var(--ink); text-transform: none; letter-spacing: 0; cursor: default;
}
.stat-link:hover .stat-pop, .stat-link:focus-visible .stat-pop { display: block; }
.stat-pop-title { display: block; margin-bottom: 4px; font-weight: 800; }
.stat-pop-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-variant-numeric: tabular-nums; }
.stat-pop-row > span { display: inline-flex; align-items: center; gap: 6px; }
.stat-pop-note { display: block; margin-top: 6px; color: var(--ink-2); font-size: .78rem; line-height: 1.35; }
@media (hover: none) { .stat-link:hover .stat-pop { display: none; } }
@media (max-width: 767.98px) { .stat-sub { display: none; } }

/* ---- «Оплачено за месяц» по механикам (/board/paid, 09.11) ---- */
.pw-sumbar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
@media (max-width: 767.98px) { .pw-sumbar .sumcard { padding: 8px 10px; } .pw-sumbar .sumcard-value { font-size: 1.02rem; } }
.pw-sumbar .fbd-dot { margin-right: 6px; }
.pw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.pw-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .9rem; color: var(--ink); }
.pw-chip b { font-variant-numeric: tabular-nums; }
.pw-chip.is-on { border-color: var(--bs-primary); background: #FFF1EA; }
.pw-group { margin-bottom: 18px; }
.pw-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 8px; padding: 8px 2px 6px; border-bottom: 1px solid var(--line); font-size: 1rem; font-weight: 800; }
.pw-name { min-width: 0; overflow-wrap: anywhere; }
.pw-sum { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pw-meta { flex-basis: 100%; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.pw-share { display: block; font-size: .78rem; color: #1E7A3C; }
.pw-group .fbd-list { gap: 10px; }
@media (min-width: 992px) { .pw-group .fbd-list { display: grid; grid-template-columns: 1fr 1fr; align-items: start; } }
