/* CRM: единая таблица стилей, версия 1 */
@font-face { font-family: 'Roboto'; src: url('../fonts/Roboto-700.ttf') format('truetype'); font-style: normal; font-weight: 700; font-display: swap; }
/* Единые стили CRM «Цветочка.бел». Все новые экраны используют этот файл.
   1. Переменные  2. Базовые элементы  3. Каркас  4. Рабочий стол  5. Вход  6. Адаптация */
:root { --font-family: 'Roboto', Arial, sans-serif; --font-size: 16px; --color-text: #19232b; --color-muted: #68747d; --color-background: #fff; --color-surface: #fff; --color-subtle: #f3f4f5; --color-border: #b9bdc1; --color-sidebar: #112f43; --color-sidebar-hover: #20475e; --color-primary: #174d6b; --color-primary-hover: #103b54; --color-focus: #7b8993; --color-error: #9f2525; --color-sale: #fbf5a0; --color-order: #c9f2c8; --color-showcase: #c5eff1; --color-rose: #e2f0ef; --color-defect: #f3dbd8; --sidebar-width: 230px; --radius: 3px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 700 var(--font-size)/1.4 var(--font-family); color: var(--color-text); background: var(--color-background); }
button,
input,
select,
textarea { font: inherit; }
button,
a,
input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
h1,
h2,
p { margin: 0; }
h1 { font-size: 20px; line-height: 1.3; }
h2 { font-size: 20px; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.text-muted { color: var(--color-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 12px; padding: 12px; background: #fff; z-index: 10; }
.skip-link:focus { top: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 20px; border: 1px solid var(--color-border); background: var(--color-surface); text-decoration: none; font-weight: 700; }
.button:hover { background: var(--color-subtle); }
.button--primary { background: var(--color-primary); }
.button--primary:hover { background: var(--color-primary-hover); }
.button--wide { width: 100%; }
.search-input,
.input { width: 100%; min-height: 40px; padding: 8px 12px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); color: var(--color-text); }
.search-input::placeholder,
.input::placeholder { color: #7b8289; opacity: 1; }
.field-label { display: block; margin: 20px 0 6px; font-weight: 700; }
.card { border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); padding: 28px; }
.alert { padding: 12px 16px; border: 1px solid var(--color-border); background: var(--color-subtle); margin: 16px 0; }
.alert--error { color: var(--color-error); background: #fff1ef; border-color: #dfb6b1; }
/* Каркас */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); gap: 15px; min-height: 100dvh; padding: 8px; }
.sidebar { display: flex; flex-direction: column; background: var(--color-sidebar); color: #fff; padding: 0 5px 16px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 6px; height: 61px; flex-shrink: 0; color: #fff; font-size: 24px; font-weight: 700; letter-spacing: -.7px; text-decoration: none; white-space: nowrap; }
.sidebar .brand { border-bottom: 1px solid #6a8090; }
.sidebar-nav { display: flex; flex-direction: column; flex: 1; padding-top: 8px; gap: 3px; }
.sidebar-link { display: flex; align-items: center; gap: 17px; width: 100%; min-height: 48px; padding: 10px 9px; border: 0; border-radius: var(--radius); background: transparent; color: #fff; text-align: left; font-size: 18px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.sidebar-link:hover,
.sidebar-link.is-active { background: var(--color-sidebar-hover); }
.workspace-main { display: flex; flex-direction: column; min-width: 0; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 0 9px; border-bottom: 1px solid var(--color-border); }
.workspace-heading { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.workspace-header h1 { font-size: 18px; }
.employee-bar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; font-size: 16px; font-weight: 700; }
.employee-bar form { margin-left: 8px; }
.menu-toggle { display: none; }
/* Рабочий стол */
.desktop { flex: 1; display: flex; flex-direction: column; min-height: 0; padding-top: 23px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.quick-action { width: 130px; min-height: 83px; padding: 12px; border: 1px solid #aab3b7; border-bottom-width: 2px; border-radius: var(--radius); color: #101719; font-size: 19px; font-weight: 700; line-height: 1.25; }
.quick-action:hover { filter: brightness(.96); }
.quick-action:active { transform: translateY(1px); }
.quick-action--sale { background: var(--color-sale); }
.quick-action--order { background: var(--color-order); }
.quick-action--showcase { background: var(--color-showcase); }
.quick-action--rose { background: var(--color-rose); }
.quick-action--defect { background: var(--color-defect); }
.workspace-tabs { display: flex; align-items: stretch; overflow-x: auto; padding-top: 3px; }
.workspace-tab { position: relative; flex-shrink: 0; min-height: 43px; padding: 9px 16px; border: 1px solid var(--color-border); border-radius: var(--radius) var(--radius) 0 0; background: #ebebeb; color: var(--color-text); font-size: 18px; white-space: nowrap; }
.workspace-tab[aria-selected='true'] { background: #fff; border-bottom-color: #fff; z-index: 1; }
.workspace-tab:hover { background: #f8f8f8; }
.workspace-tab:focus-visible { outline-offset: -4px; }
.workspace-panels { display: flex; flex: 1; margin-top: -1px; border: 1px solid var(--color-border); padding: 18px 10px 8px; }
.tab-panel { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.panel-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.search-field { display: flex; align-items: stretch; }
.search-input { border-radius: var(--radius) 0 0 var(--radius); border-right: 0; min-height: 36px; padding: 5px 8px; }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear { flex-shrink: 0; width: 28px; border: 1px solid var(--color-border); border-radius: 0 var(--radius) var(--radius) 0; background: #fff; color: var(--color-muted); }
.search-clear:hover { background: var(--color-subtle); }
.table-scroll { flex-direction: column; flex: 1; overflow-x: auto; border: 1px solid #a9aeb2; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.data-table--orders { min-width: 1120px; }
.data-table th { background: #f1f1f1; border-right: 1px solid #d0d3d5; border-bottom: 1px solid #c9cdd0; font-weight: 700; white-space: nowrap; color: #4c545c; }
.data-table th:last-child { border-right: 0; }
.data-table td { padding: 10px 15px; border-bottom: 1px solid #e3e6e8; }
.data-table .empty-row td { padding: 0; border: 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 96px 24px 70px; text-align: center; color: var(--color-muted); }
.empty-state strong { font-size: 15px; font-weight: 700; }
.empty-state p { font-size: 13px; }
.empty-state-icon { display: grid; place-items: center; height: 34px; width: 36px; border: 1px solid #d7dde1; border-radius: var(--radius); color: #9aa7b0; font-size: 25px; margin-bottom: 4px; }
.app-dialog { width: min(440px, calc(100% - 32px)); padding: 28px; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-surface); color: var(--color-text); box-shadow: 0 12px 60px #112f4333; }
.app-dialog::backdrop { background: #112f4366; }
.app-dialog p { margin: 14px 0 22px; }
.app-dialog form { display: flex; justify-content: flex-end; }
.courier-card p { margin-top: 12px; }
/* Вход */
.auth-page { background: var(--color-subtle); }
.auth-header { padding: 24px; text-align: center; border-bottom: 1px solid var(--color-border); background: var(--color-surface); }
.brand--dark { height: auto; color: var(--color-sidebar); }
.auth-header p { margin-top: 6px; font-size: 14px; color: var(--color-muted); }
.auth-main { max-width: 480px; padding: 40px 20px; margin: 0 auto; }
.login-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.login-actions > button[type="submit"] > span { inline-size: min-content; }
.login .login-actions > .button { margin: 0; min-width: 0; padding-inline: 8px; text-align: center; white-space: normal; }
@media (max-width: 420px) {
    .login:has(.login-actions) { padding-inline: 16px; }
    .login .login-actions > .button { padding-inline: 3px; gap: 4px; }
    .login-actions .crm-icon { width: 18px; height: 18px; flex-basis: 18px; }
}
.login h1 { font-size: 26px; margin-bottom: 10px; }
.login .button { margin-top: 24px; }
/* Адаптация */
@media (min-width: 1600px) {
    .sidebar-nav { padding-bottom: 55px; }
}
@media (max-width: 1199px) {
    :root { --sidebar-width: 205px; }
    .brand { font-size: 21px; }
    .sidebar-link { font-size: 16px; gap: 12px; }
    .employee-bar { font-size: 14px; gap: 8px; }
    .workspace-tab { font-size: 16px; padding-inline: 12px; }
    .header-date { font-size: 13px; }
    .quick-action { width: 122px; font-size: 18px; }
}
@media (max-width: 800px) {
    .app-shell { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 0; }
    .sidebar { display: none; }
    .sidebar.is-open { display: flex; margin-bottom: 12px; }
    .sidebar-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workspace-header { flex-wrap: wrap; align-items: flex-start; padding-bottom: 12px; }
    .menu-toggle { display: inline-flex; padding: 6px 12px; min-height: 38px; }
    .employee-bar { justify-content: flex-start; font-size: 14px; gap: 8px; }
    .header-date { font-size: 13px; }
    .employee-bar form { margin-left: 0; }
    .desktop { padding-top: 16px; }
    .quick-actions { gap: 8px; }
    .quick-action { flex: 1 0 100px; width: auto; max-width: 150px; min-height: 72px; font-size: 16px; }
    .workspace-panels { min-height: 480px; padding: 10px 7px 7px; }
    .workspace-tab { min-height: 44px; font-size: 15px; padding: 10px 12px; }
    .panel-toolbar { gap: 8px; }
    .search-field { min-width: 0; width: 70%; }
    .search-input { font-size: 16px; }
    .empty-state { padding-inline: 16px; }
    .data-table:not(.data-table--orders) { min-width: 640px; }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after { scroll-behavior: auto !important; }
}
/* Настройки: одна страница без вкладок. */
.settings-page { flex: 1; border: 1px solid var(--color-border); }
.settings-page > .alert { margin-top: 0; }
.settings-columns { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 12px; align-items: start; }
.settings-fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px 10px; }
.settings-field { min-width: 0; }
.settings-field--full { grid-column: span 12; }
.settings-field--quarter { grid-column: span 3; }
.settings-field--three-quarters { grid-column: span 9; }
.settings-field--third { grid-column: span 4; }
.settings-field--half { grid-column: span 6; }
.settings-field .field-label { margin: 0 0 3px; }
.settings-field .input { padding: 6px 8px; font-size: 18px; }
.settings-directory { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px 10px; padding-top: 18px; }
.directory-button { min-height: 59px; padding: 7px 9px; text-align: center; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; box-shadow: 0 1px 0 #aab0b5; background: #f7f7f7; }
.directory-button:hover { background: #edf2f5; border-color: #768d9b; }
.alert--success { color: #17643b; background: #eef9f1; border-color: #afd3bb; }
.input--error { border-color: var(--color-error); }
.field-error { color: var(--color-error); font-size: 12px; margin-top: 4px; }
@media(max-width: 1450px) {
    .settings-directory { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .directory-button,
    .settings-field .input { font-size: 16px; }
}
@media(max-width: 1050px) {
    .settings-columns { grid-template-columns: minmax(0,1fr); }
    .settings-directory { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media(max-width: 550px) {
    .settings-directory { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .settings-field--quarter,
    .settings-field--three-quarters,
    .settings-field--half,
    .settings-field--third { grid-column: span 12; }
    .settings-page { padding: 12px 10px; }
}
/* Единая насыщенность текста, включая стандартные жирные HTML-элементы. */
h1,
h2,
h3,
h4,
h5,
h6,
strong,
b { font-weight: 700; }
/* Фирменный логотип: исходное изображение без изменения цветов и пропорций. */
.brand-logo { display: block; width: 180px; max-width: 100%; height: auto; flex-shrink: 1; object-fit: contain; }
.sidebar .brand { padding: 10px 12px; }
.auth-header .brand--dark { width: fit-content; max-width: 100%; min-height: 54px; padding: 16px 20px; margin: 0 auto; background: var(--color-sidebar); border-radius: var(--radius); }
/* Общие элементы CRM: поля, кнопки, окна выбора. */
:root { --color-primary: #ffe52c; --color-primary-hover: #f3d918; --radius: 10px; --color-field: #e7e9eb; }
.button { border-radius: 3px; background: linear-gradient(#fff, #f1f1f1); box-shadow: 0 1px 0 #b1b1b1; color: #101719; gap: 7px; }
.button--primary { background: linear-gradient(#fff057, #ffe000); border-color: #b9a234; color: #101719; }
.button--primary:hover { background: #f5da1c; }
.button:disabled { cursor: not-allowed; opacity: .55; }
a { color: #175979; }
.form-toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--color-border); }
.directory-page { border: 0; padding: 0; flex: 1; min-width: 0; }
.directory-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-field:where(form, #directory-selection .directory-toolbar > div) { display: flex; margin-left: auto; }
.employee-table { min-width: 780px; }
.employee-table tbody tr:hover { background: #f5f8fa; }
.employee-table a { display: block; padding: 4px 0; }
.employee-columns { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 28px; max-width: 1300px; }
.employee-fields,
.stack-form { display: flex; flex-direction: column; gap: 14px; }
.stack-form { margin-top: 24px; }
.field-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.field-group { min-width: 0; }
.form-field { position: relative; min-height: 64px; border-radius: 12px; background: var(--color-field); border: 1px solid transparent; }
.form-field input { width: 100%; min-height: 64px; padding: 26px 15px 9px; border: 0; border-radius: inherit; background: transparent; color: #132e3c; font: inherit; outline-offset: 2px; }
.form-field label { position: absolute; left: 15px; right: 10px; top: 10px; color: #426076; font-size: 12px; line-height: 1.1; pointer-events: none; }
.form-field input:placeholder-shown:not(:focus):not([type="date"]) + label { top: 23px; font-size: 16px; }
.form-field:focus-within { border-color: var(--color-focus); }
.form-field input[readonly] { color: #465865; }
.form-field.is-disabled { opacity: .65; }
.required-mark { color: #b52f2f; }
.field-hint { margin-top: 5px; color: var(--color-muted); font-size: 12px; }
.choice-field { position: relative; width: 100%; min-height: 66px; text-align: left; padding: 12px 48px 10px 15px; border: 1px solid transparent; border-radius: 12px; background: var(--color-field); color: #132e3c; }
.choice-label { display: block; color: #426076; font-size: 16px; }
.has-value .choice-label { font-size: 12px; margin-bottom: 4px; }
.choice-value { display: block; }
.choice-icon { position: absolute; right: 15px; top: 20px; font-size: 24px; }
.choice-field:disabled { opacity: .55; cursor: not-allowed; }
.phone-control { display: flex; background: var(--color-field); border-radius: 12px; }
.phone-control .form-field { flex: 1; min-width: 0; }
.phone-country { display: flex; align-items: center; padding: 0 12px; border: 0; border-right: 1px solid #c9d0d5; background: transparent; }
.phone-country img { object-fit: cover; }
.permissions-panel { padding: 20px; margin: 0; border: 1px solid var(--color-border); border-radius: 10px; align-self: start; }
.permissions-panel legend { padding: 0 8px; }
.checkbox-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; cursor: pointer; }
.checkbox-row input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: #174d6b; }
.permissions-panel > .field-hint:last-child { margin-top: 24px; }
.employee-status { display: inline-block; padding: 4px 9px; border-radius: 5px; white-space: nowrap; }
.employee-status--working { background: #e0f2e6; color: #1b6038; }
.employee-status--inactive { background: #fff0ce; color: #725014; }
.employee-status--dismissed { background: #f3e1e1; color: #853838; }
.selection-dialog { width: min(520px, calc(100% - 24px)); max-height: min(680px, 85dvh); padding: 18px; border: 1px solid var(--color-border); border-radius: 12px; background: #fff; color: var(--color-text); box-shadow: 0 12px 50px #112f4333; }
.selection-dialog::backdrop { background: #112f4366; }
.selection-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.selection-list { margin-top: 10px; max-height: 440px; overflow: auto; }
.selection-option { display: flex; align-items: center; gap: 12px; padding: 12px; width: 100%; border: 0; border-bottom: 1px solid #edf0f2; background: #fff; color: var(--color-text); text-align: left; }
.selection-option:hover,
.selection-option:focus-visible { background: #e7eff4; }
.selection-option img { flex-shrink: 0; }
.selection-option:focus-visible { outline-offset: -3px; }
.switch-card { max-width: 520px; width: 100%; margin: 24px auto; }
.switch-card > p { margin-top: 12px; }
.switch-card .form-toolbar { border: 0; margin-bottom: 0; padding-bottom: 0; }
.settings-field { position: relative; }
.settings-field .input { background: var(--color-field); border-color: transparent; border-radius: 12px; min-height: 64px; padding: 26px 15px 9px; }
.settings-field .field-label { position: absolute; z-index: 1; top: 10px; left: 15px; right: 10px; color: #426076; font-size: 12px; pointer-events: none; }
.settings-field:has(.input:placeholder-shown:not(:focus)) .field-label { top: 23px; font-size: 16px; }
.settings-field .input:focus { border-color: var(--color-focus); }
@media(max-width: 1000px) {
    .employee-columns { grid-template-columns: minmax(0,1fr); }
    .permissions-panel { max-width: none; }
}
@media(max-width: 550px) {
    .field-pair { grid-template-columns: minmax(0,1fr); }
    .directory-page { padding: 0; }
    .search-field:where(form, #directory-selection .directory-toolbar > div) { margin-left: 0; }
    .form-toolbar .button { flex: 1 0 auto; }
    .phone-country { padding: 0 8px; font-size: 13px; }
    .employee-bar { gap: 6px; }
    .employee-bar .button { font-size: 12px; padding: 7px 10px; }
}
/* Общие правила списков: одна область прокрутки, без наружной рамки. */
.workspace-page:has(.desktop .data-table) { height: 100dvh; overflow: hidden; }
.workspace-page:has(.desktop .data-table) .app-shell { height: 100dvh; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.workspace-page:has(.desktop .data-table) .workspace-main { min-height: 0; overflow: hidden; }
.workspace-page:has(.desktop .data-table) .sidebar { min-height: 0; overflow: auto; }
.workspace-page:has(.desktop .data-table) .sidebar-nav { flex-shrink: 0; }
.workspace-header,
.quick-actions,
.workspace-tabs { flex-shrink: 0; }
.desktop:has(.data-table) { overflow: hidden; }
.directory-table-page { display: flex; flex-direction: column; min-height: 0; }
.directory-toolbar,
.panel-toolbar { flex-shrink: 0; border: 0; padding: 0; }
.panel-toolbar { justify-content: flex-end; }
.workspace-panels { min-height: 0; border: 0; padding: 12px 0 0; overflow: hidden; }
.tab-panel { min-height: 0; }
.table-scroll { display: block; flex: 1 1 0; min-height: 0; min-width: 0; overflow: auto; border: 0; overscroll-behavior: contain; scrollbar-gutter: stable; }
.data-table th { position: sticky; top: 0; z-index: 1; }
.data-table a { color: inherit; text-decoration: none; }
.data-table [data-row-url] { cursor: default; }
.data-table [data-row-url]:hover,
.data-table [data-row-url]:focus-visible { background: #eef4f7; }
.data-table [data-row-url]:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.search-field { position: relative; }
.search-field:where(form, #directory-selection .directory-toolbar > div) { gap: 0; }
.search-field .search-input { width: 100%; border: 1px solid var(--color-border); padding-right: 40px; }
.search-field .search-clear { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 32px; border: 0; background: transparent; font-size: 24px; }
.search-field .search-clear:hover { background: var(--color-subtle); }
.phone-number { white-space: nowrap; font-variant-numeric: tabular-nums; }
.phone-country { border-right: 0; gap: 8px; }
.phone-control .form-field input { padding-left: 8px; }
.phone-control .form-field label { left: 8px; }
.receipt-list .data-table,
form:is([data-quantity-receipt],[data-defect-form]) table.opening-lines,
#directory-selection.crm-related-rose-choice[open] .data-table,
body:has(form:is([data-opening-balances],[data-quantity-receipt],[data-price-form],[data-defect-form])) #directory-selection:is([data-choice-kind="opening-goods"],[data-choice-kind="price-products"])[open] .data-table { table-layout: fixed !important; }
.receipt-list .data-table td.crm-list-date { padding-inline: 8px; white-space: normal; }
.crm-found-count { flex: 0 0 auto; margin: auto 0 0; padding-top: 8px; color: var(--color-muted, #526674); font-size: 12px; text-align: left; font-variant-numeric: tabular-nums; }
/* Fixed widths in documents and their directory pickers. */
.document-column-list .data-table,
[data-price-form] .price-lines,
[data-rose-form] .rose-lines,
body:has(form[data-business-form][data-kind="customers"]) #directory-selection[data-choice-kind="discount-cards"][open] .data-table,
#directory-selection[data-choice-kind="rose-source"][open] .data-table { table-layout: fixed !important; width: 100%; }
.showcase-list-table :is(col,th):is([data-column="shop_name"],[data-column="status"]),
.sales-list-table :is(col,th):is([data-column="shop_name"],[data-column="paid_minor"],[data-column="due_minor"]),
.document-column-list .data-table :is(col,th):is([data-column="number"],[data-column="document_at"],[data-column="quantity_total"],[data-column="operation"],[data-column="shipment_on"],[data-column="total_minor"],[data-column="country_name"],[data-column="quantity"]),
[data-price-form] .price-lines :is(col.line-sku,col.line-country,.crm-reference-cell),
[data-rose-form] .rose-lines :is(col.line-country,col.line-number-value,.crm-reference-cell),
body:has(form[data-business-form][data-kind="customers"]) #directory-selection[data-choice-kind="discount-cards"][open] th:is([data-column="number"],[data-column="issued_on"]),
#directory-selection[data-choice-kind="rose-source"][open] :is(col.crm-reference-column,th[data-column="country_name"],th[data-column="quantity"],.crm-reference-cell) { --crm-list-column-width: 150px; box-sizing: border-box; width: 150px; min-width: 150px; max-width: 150px; }
.document-column-list .data-table td.crm-list-date { padding-inline: 8px; white-space: normal; }
.table-message { flex-shrink: 0; padding: 8px 0; color: #853838; }
.table-message .button { margin-left: 12px; }
@media(max-width: 900px) {
    .workspace-page:has(.desktop .data-table) .sidebar.is-open { position: fixed; inset: 12px; z-index: 20; padding-bottom: 50px; }
    .workspace-page:has(.desktop .data-table) .menu-toggle { position: relative; z-index: 21; }
}
/* Телефон: флаг, отдельный код страны, затем префикс и номер. */
.phone-country { flex-shrink: 0; border-radius: 12px 0 0 12px; }
.phone-country [data-country-dial] { white-space: nowrap; }
.phone-control .form-field input:placeholder-shown:not(:focus) + label { top: 10px; font-size: 12px; }
.phone-control input::placeholder { color: #788590; opacity: 1; }
.phone-control:focus-within { box-shadow: 0 0 0 2px var(--color-focus); }
.phone-control .form-field:focus-within { border-color: transparent; }
.phone-control input:focus-visible { outline: none; }
/* Единые заголовки полей, выделение строк и навигация. */
.phone-control { position: relative; min-height: 66px; padding-top: 24px; align-items: center; }
.phone-label { position: absolute; left: 15px; top: 10px; color: #426076; font-size: 12px; line-height: 1.1; }
.phone-control .phone-country { height: 40px; padding: 0 8px 0 15px; align-items: center; }
.phone-control .form-field { min-height: 40px; }
.phone-control .form-field input { height: 40px; min-height: 40px; padding: 0 15px 0 8px; }
.data-table tbody tr { cursor: default; }
.data-table tbody tr.is-selected,
.data-table tbody tr.is-selected:hover,
.data-table tbody tr.is-selected:focus-visible { background: #dcebf5; }
.search-field .search-clear { display: grid; place-items: center; padding: 0; line-height: 1; }
.breadcrumbs { min-width: 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0; margin: 0; list-style: none; }
.breadcrumbs li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.breadcrumbs li + li::before { content: '/'; color: var(--color-muted); }
.breadcrumbs a,
.breadcrumbs h1 { color: var(--color-text); font: inherit; font-weight: 700; overflow-wrap: anywhere; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
/* Меню, часы, единые размеры поиска и сортировка списков. */
.sidebar-link,
.sidebar-link:hover { text-decoration: none; }
.crm-icon { width: 22px; height: 22px; flex: 0 0 22px; display: inline-block; vertical-align: middle; }
.button.button--icon { width: 42px; height: 42px; min-height: 42px; padding: 9px; }
.search-field .search-input { height: 42px; min-height: 42px; border-radius: 3px; padding: 9px 40px 9px 12px; }
.search-field .search-clear { border-radius: 3px; }
.header-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.settings-page { border: 0; padding: 0; }
.workspace-tabs { gap: 1px; }
.workspace-tab { border-radius: 3px 3px 0 0; }
.workspace-tab + .workspace-tab { margin-left: 0; }
.table-sort { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-align: left; white-space: nowrap; }
.sort-indicator { display: inline-block; width: 12px; font-size: 12px; }
.data-table th.directory-flag-column { width: 1%; white-space: nowrap; }
.data-table th.directory-flag-column .table-sort { width: max-content; white-space: nowrap; }
[aria-sort='none'] .sort-indicator::after { content: '↕'; opacity: .5; }
[aria-sort='ascending'] .sort-indicator::after { content: '↑'; }
[aria-sort='descending'] .sort-indicator::after { content: '↓'; }
.directory-fields { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 760px; margin: 0; padding: 0; border: 0; min-width: 0; }
.directory-fields .checkbox-row { margin: 0; }
.directory-related-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.touch-open { display: none; }
@media (pointer: coarse), (max-width: 900px) {
    .touch-open { display: inline-flex; }
    .button,
    .button.button--icon,
    .search-field .search-input { min-height: 44px; }
    .button.button--icon { width: 44px; height: 44px; }
    .table-sort { min-height: 44px; }
    .search-field .search-clear { width: 44px; top: 0; bottom: 0; }
    .selection-option { min-height: 44px; }
}
@media (max-width: 550px) {
    .search-field:where(form, #directory-selection .directory-toolbar > div) { width: 100%; }
    .workspace-header { align-items: flex-start; }
    .header-date { white-space: normal; }
    .directory-fields { max-width: none; }
    .selection-dialog { max-height: 85dvh; }
    .selection-list { max-height: 50dvh; }
}
/* Общий табличный выбор справочников и заметная смена сотрудника. */
.employee-bar .button.button--icon { min-height: 54px; padding: 10px; background: #e6f0f6; border-color: #7594a8; }
.directory-selection { width: min(900px, calc(100% - 24px)); }
.directory-selection [data-selection-list-panel] { display: flex; flex-direction: column; min-height: 0; }
.directory-selection .table-scroll { flex: none; }
.directory-selection [data-position-fields] .form-field { margin-top: 14px; }
#employee-form [data-employee-pin] { min-width: 0; padding: 0; margin: 0; border: 0; }
#employee-form .field-triple:has(> [data-employee-pin]:only-child[hidden]) { display: none; }
body:has(#employee-form) #directory-selection[data-choice-kind="positions"] th[data-column="contract_signing"] {
    width: 1%;
    white-space: nowrap;
}
body:has(#employee-form) #directory-selection[data-choice-kind="positions"] th[data-column="contract_signing"] .table-sort {
    white-space: nowrap;
}
.directory-selection tbody tr:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
@media(max-width: 550px) {
    .directory-selection .search-field { width: 100%; }
    .directory-selection .selection-heading h2 { font-size: 18px; }
}
/* Размеры общего табличного выбора относительно видимой области. */
.directory-selection { width: calc(100vw - 100px); max-width: none; height: calc(100dvh - 60px); max-height: none; margin: auto; padding: 18px; }
.directory-selection[open] { display: flex; flex-direction: column; }
.directory-selection .selection-heading,
.directory-selection .directory-toolbar { flex-shrink: 0; }
.directory-selection [data-selection-list-panel] { flex: 1; overflow: hidden; }
.directory-selection .table-scroll { flex: 1 1 0; height: auto; min-height: 0; }
.directory-selection [data-selection-add-form] { overflow: auto; }
.employee-bar .button.button--icon { width: 88px; min-width: 88px; height: 54px; padding: 10px 24px; }
.employee-bar .button--icon .crm-icon { width: 28px; height: 28px; flex-basis: 28px; stroke-width: 1.7; }
.button .crm-icon { pointer-events: none; }
@media(max-width: 600px) {
    .directory-selection { width: calc(100vw - 16px); height: calc(100dvh - 16px); padding: 12px; }
    .employee-bar .button.button--icon { width: 72px; min-width: 72px; padding: 10px 18px; }
}
.shop-options { border: 0; padding: 0; margin: 0; min-width: 0; }
.shop-options legend { margin-bottom: 12px; }
.shop-option { display: flex; gap: 12px; align-items: center; padding: 14px; margin-bottom: 8px; background: var(--color-field); border-radius: 12px; cursor: pointer; }
.shop-option input { width: 22px; height: 22px; flex-shrink: 0; }
.shop-option strong,
.shop-option span span { display: block; }
.shop-option span span { font-size: 13px; color: var(--color-muted); }
.current-shop-link { color: var(--color-text); text-decoration: none; }
.current-shop-link:hover { text-decoration: underline; }
/* Поиск без синего ореола. Активное поле и выбранная строка — тонкая рамка. */
.search-input:focus,
.search-input:focus-visible,
#selection-search:focus,
#selection-search:focus-visible,
.search-field:focus-within { outline: none; box-shadow: none; border-color: var(--color-border); }
.form-field input:focus,
.form-field input:focus-visible { outline: none; box-shadow: none; }
.form-field:focus-within { border: 1px solid #7b8993; }
.phone-control:focus-within { box-shadow: inset 0 0 0 1px #7b8993; }
.data-table tbody tr.is-selected,
.data-table tbody tr.is-selected:focus-visible { outline: 1px solid #7b8993; outline-offset: -1px; }
/* Выделение строк только цветом; окно создания имеет ширину карточки. */
.data-table tbody tr.is-selected,
.data-table tbody tr.is-selected:focus-visible,
.directory-selection .data-table tbody tr:focus-visible { outline: none; box-shadow: none; }
.directory-selection.directory-create { width: min(800px, calc(100vw - 32px)); height: auto; max-height: calc(100dvh - 60px); }
.directory-selection.directory-create .directory-fields { max-width: 760px; }
.cashless-good-references { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.cashless-good-references > .field-group { min-width:0; }
#selection-dialog .selection-option.is-search-match { background:var(--color-selected, #dcebf4); }
dialog.business-frame-dialog.cashless-good-frame[open] { width:min(800px,calc(100vw - 24px)); height:auto; min-height:0; max-height:calc(100dvh - var(--crm-dialog-top,30px) - 8px); padding:0; }
dialog.business-frame-dialog.cashless-good-frame[open] > iframe { flex:none; width:100%; height:var(--cashless-good-height,320px); max-height:calc(100dvh - var(--crm-dialog-top,30px) - 12px); }
#directory-selection.cashless-good-reference[open],
dialog.business-frame-dialog.cashless-good-reference-open[open] { box-sizing:border-box; width:min(1120px,calc(100vw - 24px)); min-width:0; max-width:none; height:calc(100dvh - 2 * var(--crm-dialog-top,30px)); max-height:none; margin-inline:auto; }
dialog.business-frame-dialog.cashless-good-reference-open[open] { border:0; padding:0; }
dialog.business-frame-dialog.cashless-good-reference-open[open] > .business-frame-close { display:none; }
dialog.business-frame-dialog.cashless-good-reference-open[open] > iframe { height:100%; max-height:none; flex:1 1 auto; }
body.crm-modal-page:has([data-cashless-good-form]) #directory-selection.cashless-good-reference[open] { width:100%; height:100dvh; margin:0; top:0 !important; }
@media(max-width:480px) {
    .cashless-good-references { grid-template-columns:minmax(0,1fr); }
}
.directory-selection.directory-create .form-toolbar { margin-bottom: 20px; flex-shrink: 0; }
@media(max-width: 600px) {
    .directory-selection.directory-create { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
}
.directory-selection .data-table tbody tr:focus-visible { background: #dcebf5; }
/* Единые карточки покупателей и подчинённых справочников. */
.business-card { min-width: 0; }
.business-card-title { margin: 0 0 16px; font-size: 20px; }
.business-related { margin-top: 24px; }
.business-related h2 { font-size: 18px; margin-bottom: 12px; }
.business-related iframe { width: 100%; height: 340px; border: 0; display: block; }
.business-frame-dialog { width: min(800px, calc(100vw - 32px)); max-width: none; height: calc(100dvh - 60px); max-height: none; padding: 0; margin: auto; overflow: hidden; }
.business-frame-dialog[open] { display: flex; flex-direction: column; }
.business-frame-dialog iframe { flex: 1; min-height: 0; width: 100%; border: 0; }
#directory-selection.contract-buyer-choice[open],
dialog.business-frame-dialog.has-contract-buyer-choice[open] { box-sizing: border-box; width: min(1200px, calc(100vw - 24px)); min-width: 0; max-width: none; margin-inline: auto; }
dialog.business-frame-dialog.has-contract-buyer-choice[open] { padding: 0; border: 0; }
dialog.has-contract-buyer-choice > .business-frame-close { display: none; }
body.crm-modal-page #directory-selection.contract-buyer-choice[open] { width: 100vw; height: 100dvh; max-height: none; top: 0 !important; margin-block: 0; }
#directory-selection.contract-buyer-choice .data-table { table-layout: fixed !important; width: 100%; min-width: 510px; }
#directory-selection.contract-buyer-choice th:is([data-column="phone"], [data-column="unp"]) { box-sizing: border-box; width: 150px; }
#directory-selection.contract-buyer-choice td:first-child { overflow-wrap: anywhere; }
.shop-name-flags { display: grid; grid-template-columns: minmax(0, 1fr) max-content max-content; align-items: center; gap: 12px; }
.shop-coordinates { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: 12px; }
.legal-contact-kind-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.legal-contact-kind-row > .field-group { flex: 0 1 400px; width: 400px; max-width: 100%; }
.directory-fields :is(.shop-name-flags, .legal-contact-kind-row) > .checkbox-row { align-items: center; margin: 0; }
@media (max-width: 600px) {
    .shop-name-flags { grid-template-columns: max-content minmax(0, 1fr); }
    .shop-name-flags > .field-group { grid-column: 1 / -1; }
}
#directory-selection.card-owner-choice[open],
dialog.business-frame-dialog.has-card-owner-choice[open] { box-sizing: border-box; width: min(1200px, calc(100vw - 24px)); min-width: 0; max-width: none; margin-inline: auto; }
dialog.business-frame-dialog.has-card-owner-choice[open] { padding: 0; border: 0; }
dialog.has-card-owner-choice > .business-frame-close { display: none; }
body.crm-modal-page #directory-selection.card-owner-choice[open] { width: 100vw; height: 100dvh; max-height: none; top: 0 !important; margin-block: 0; }
#directory-selection[data-choice-kind="order-courier_id"] .directory-toolbar { flex-wrap:wrap; column-gap:12px; }
#directory-selection[data-choice-kind="order-courier_id"] .search-field { order:3; flex:1 1 180px; max-width:600px; margin-inline-start:auto; }
#directory-selection.card-owner-choice .directory-toolbar { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; }
#directory-selection.card-owner-choice [data-directory-add] { display: none; }
#directory-selection.card-owner-choice [data-directory-confirm] { flex: none; }
#directory-selection.card-owner-choice .search-field { flex: 1 1 600px; width: auto; min-width: 0; max-width: 600px; margin-inline-start: auto; }
.business-frame-close { position: absolute; right: 10px; top: 8px; width: 44px; height: 44px; padding: 0; font-size: 24px; }
.crm-modal-page { display: block; margin: 0; min-height: 0; background: #fff; }
.business-modal-content { padding: 18px; }
.crm-modal-page .business-card-title { padding-right: 44px; }
.crm-modal-page .directory-fields { max-width: 760px; }
.crm-modal-page:has(.business-list) { height: 100dvh; overflow: hidden; }
.crm-modal-page:has(.business-list) .business-modal-content { height: 100%; min-height: 0; display: flex; flex-direction: column; padding: 0; }
.crm-modal-page .business-list { height: 100%; min-height: 0; }
.crm-modal-page .business-list[data-fit-related-frame] { height: auto; flex: none; }
.business-list[data-fit-related-frame] > .table-scroll { flex: none; max-height: 340px; }
@media(max-width:600px) {
    .business-frame-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); }
    .business-modal-content { padding: 12px; }
    .business-related iframe { height: 300px; }
}
/* Меню сохраняет высоту экрана и постоянный шаг пунктов. */
.sidebar { align-self: start; position: sticky; top: 8px; height: calc(100dvh - 16px); overflow: auto; }
.sidebar .brand { flex-shrink: 0; }
.sidebar-nav { flex: 0 0 auto; justify-content: flex-start; align-content: start; padding-bottom: 0; }
.sidebar-link { flex: 0 0 auto; }
/* Телефон: одна непрерывная рамка поверх внутренних элементов. */
.phone-control,
.phone-control:focus-within { box-shadow: none; }
.phone-control .form-field,
.phone-control .form-field:focus-within { border: 0; background: transparent; box-shadow: none; }
.phone-control:focus-within::after { content: ''; position: absolute; inset: 0; border: 1px solid #7b8993; border-radius: inherit; pointer-events: none; z-index: 1; }
/* Компактные реквизиты только на странице настроек. */
.organization-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.organization-summary .field-group:has(#organization_name),
.organization-summary .field-group:has(#organization_full_name),
.organization-summary .field-group:has(#organization_legal_address),
.organization-summary .field-group:has(#organization_postal_address),
.organization-summary .field-group:has(#organization_account),
.organization-summary .field-group:has(#organization_branch) { grid-column: 1 / -1; }
.organization-summary .form-field { min-height: 48px; border-radius: 6px; }
.organization-summary .form-field input { min-height: 48px; height: 48px; padding: 21px 10px 5px; font-size: 14px; }
.organization-summary .form-field label { top: 7px; left: 10px; font-size: 11px; }
.organization-summary .form-field input:placeholder-shown:not(:focus) + label { top: 16px; font-size: 14px; }
@media(max-width:800px) {
    .sidebar { position: static; height: auto; max-height: calc(100dvh - 24px); }
    .sidebar.is-open { overflow: auto; }
    .sidebar-nav { align-content: start; }
}
@media(max-width:480px) {
    .organization-summary { grid-template-columns: minmax(0,1fr); }
}
.customer-type-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center; }
.customer-role-flags { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.customer-contact-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-items: start; }
.customer-type-row > *,
.customer-contact-row > * { min-width: 0; }
.form-field--multiline { min-height: 102px; }
.form-field--multiline textarea { display: block; width: 100%; min-height: 102px; box-sizing: border-box; padding: 27px 15px 9px; border: 0; border-radius: inherit; background: transparent; color: #132e3c; font: inherit; line-height: 22px; resize: vertical; }
.form-field--multiline textarea:focus { outline: none; box-shadow: none; }
.form-field--multiline textarea:placeholder-shown:not(:focus) + label { top: 23px; font-size: 16px; }
@media(max-width:650px) {
    .customer-type-row,
    .customer-contact-row { grid-template-columns: minmax(0,1fr); }
    .customer-role-flags { gap: 16px; }
}
/* Правый отступ равен промежутку слева от рабочей области. */
@media(min-width:801px) {
    .app-shell { padding-right: 15px; }
}
.directory-toolbar .search-field:where(form, #directory-selection .directory-toolbar > div),
.panel-toolbar .search-field { max-width: 100%; min-width: 0; }
/* Шапка и содержимое используют одну правую вертикаль. */
.workspace-main > .workspace-header { padding-right: 0; }
/* Карточка покупателя: две независимые колонки, общий стиль полей. */
.directory-fields.customer-card-fields { max-width: none; }
.customer-card-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; width: 100%; align-items: start; }
.customer-card-column { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.customer-card-column .business-related { margin-top: 0; min-width: 0; }
@media(max-width:1000px) {
    .customer-card-columns { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
/* Единые заголовки и пустое состояние таблиц, в том числе внутри карточек. */
.data-table th,
.related-disabled-table th { height: 36px; padding: 8px 15px; line-height: 20px; }
.data-table th .table-sort { min-height: 20px; line-height: 20px; }
.data-table .empty-row td { padding: 16px 15px; color: var(--color-muted); line-height: 1.5; }
.related-disabled-scroll { overflow-x: auto; }
.related-disabled-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.related-disabled-table th { background: #f1f1f1; color: #4c545c; border-right: 1px solid #d0d3d5; border-bottom: 1px solid #c9cdd0; white-space: nowrap; }
.related-disabled-table th:last-child { border-right: 0; }
.related-disabled-table td { padding: 16px 15px; color: var(--color-muted); line-height: 1.5; }
.customer-discount-block { display: flex; flex-direction: column; gap: 14px; }
.customer-discount-block[hidden] { display: none; }
/* Кнопки закрытия без голубого кольца; фокус обозначается фоном. */
.business-frame-close:focus-visible,
.selection-dialog [data-selection-close]:focus-visible,
.selection-dialog [data-directory-close]:focus-visible,
.selection-dialog [data-create-close]:focus-visible,
.selection-dialog [data-business-close]:focus-visible { outline: none; box-shadow: none; background: #e7e9eb; }
.login .stack-form > .button[type="submit"],
.login .login-actions > .button { width: 100%; min-height: 66px; border-radius: 12px; margin-top: 0; }
.shop-manual[hidden] { display: none; }
.product-folder-name { display: flex; align-items: center; gap: 10px; }
.product-folder-name .button { margin-left: auto; min-width: 36px; }
.product-rose-fields { display: flex; flex-direction: column; gap: 14px; }
.product-rose-fields[hidden] { display: none; }
.product-rose-fields h2 { font-size: 18px; }
.product-photo { display: flex; flex-direction: column; gap: 12px; }
.product-photo img { width: min(100%, 360px); max-height: 360px; object-fit: contain; }
.product-photo input { max-width: 100%; }
/* Правый край шапки, поиска и области таблицы совпадает с линией шапки. */
.table-scroll { scrollbar-gutter: auto; }
[data-live-table] > .directory-toolbar,
[role="tabpanel"] > .panel-toolbar,
.directory-selection .directory-toolbar { padding-right: 0; }
.product-photo input[hidden] { display: none; }
.product-field-row { display: grid; gap: 14px; min-width: 0; }
.product-field-row--two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.product-field-row--three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.product-field-row--three.is-service { grid-template-columns: minmax(0,1fr); }
.product-photo-image { position: relative; width: fit-content; max-width: 100%; }
.product-photo-image[hidden] { display: none; }
.product-photo-image img { display: block; }
.product-photo-remove { position: absolute; top: 8px; right: 8px; min-width: 40px; min-height: 40px; padding: 8px; }
@media(max-width:600px) {
    .product-field-row { grid-template-columns: minmax(0,1fr); }
}
/* Документы: общие поля и таблицы, без внешней рамки. */
.opening-active-tab { background:var(--primary,#476e61); color:#fff; }
.workspace-tabs a.workspace-tab { text-decoration:none; display:inline-flex; align-items:center; }
.opening-document { min-height:0; flex:1; display:flex; overflow:hidden; }
.opening-document form { display:flex; flex:1; min-width:0; min-height:0; flex-direction:column; gap:12px; }
.opening-document .form-toolbar { flex-shrink:0; margin:0; }
.opening-header { grid-template-columns:repeat(3,minmax(0,1fr)); flex-shrink:0; }
.opening-pane:not([hidden]) { display:flex; flex:1; min-height:0; flex-direction:column; gap:10px; }
.opening-pane .directory-toolbar { flex-shrink:0; margin:0; }
.opening-pane .table-scroll { flex:1; min-height:150px; }
.opening-lines td { vertical-align:middle; }
.opening-lines .input { padding:8px; box-sizing:border-box; }
.opening-lines .choice-field { width:100%; padding:8px 32px 8px 10px; text-align:left; }
.opening-lines tfoot td { position:sticky; bottom:0; background:#f3f5f4; border-top:1px solid #dbe1de; font-weight:700; }
.opening-remove { min-width:36px; width:36px; height:36px; padding:0; }
.opening-document .alert { max-height:140px; overflow:auto; flex-shrink:0; }
@media(max-width:1000px) {
    .opening-header { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:640px) {
    .opening-header { grid-template-columns:1fr; }
    .opening-document { overflow:auto; }
    .opening-document form { flex:none; width:100%; min-height:100%; height:auto; }
    .opening-pane .table-scroll { height:45dvh; min-height:220px; flex:none; }
    .opening-document .form-toolbar { flex-wrap:wrap; }
}
.opening-lines .choice-icon { top:50%; transform:translateY(-50%); font-size:20px; }
.opening-lines .choice-value { padding-right:6px; }
/* Табличные части: компактные ячейки, действия над выделенной строкой. */
.opening-lines td { padding:5px 8px; }
.opening-lines .input,
.opening-lines .choice-field { border-radius:3px; background:transparent; border:1px solid transparent; min-height:36px; height:36px; }
.opening-lines .input { text-align:right; font-variant-numeric:tabular-nums; }
.opening-lines .input:focus { background:var(--color-field); border-color:var(--color-border); outline:none; }
.opening-lines .choice-field:focus-visible { outline:1px solid var(--color-border); outline-offset:-1px; }
.opening-lines td[data-line-total],
.opening-lines tfoot td { text-align:right; font-variant-numeric:tabular-nums; }
.opening-lines tfoot td:first-child { text-align:left; }
.opening-pane .directory-toolbar { gap:6px; }
.opening-pane .directory-toolbar .button--icon { min-width:42px; width:42px; height:42px; padding:9px; }
.opening-lines tr.is-selected td { background:#fff1ad; }
.opening-lines tr.is-selected:focus { outline:none; }
/* Шапка документа и фиксированные числовые колонки. */
.opening-header { grid-template-columns:minmax(85px,.5fr) minmax(200px,1.15fr) minmax(170px,1fr) minmax(160px,1fr) minmax(180px,1.1fr); }
.opening-lines { table-layout:fixed; width:100%; min-width:1000px; }
.opening-lines .line-number { width:56px; }
.opening-lines .line-number-value { width:145px; }
.opening-lines .line-sku,
.opening-lines .line-country { width:120px; }
.opening-lines .input { min-width:0; max-width:100%; width:100%; }
.opening-lines .choice-field { min-width:0; height:auto; min-height:36px; }
.opening-lines .choice-value { white-space:normal; overflow-wrap:anywhere; line-height:1.35; }
.opening-lines td:first-child,
.opening-lines th:first-child { width:56px; text-align:right; }
.opening-lines td[data-line-total] { white-space:nowrap; }
@media(max-width:550px) {
    .opening-header { grid-template-columns:1fr; }
}
/* Выбор в строке только отдельной кнопкой справа. */
.opening-list { margin-top:16px; }
.opening-choice { display:flex; align-items:center; gap:8px; min-height:36px; width:100%; min-width:0; }
.opening-choice-text { flex:1; min-width:0; white-space:normal; overflow-wrap:anywhere; line-height:1.35; cursor:default; }
.opening-choice-button { display:inline-flex; align-items:center; justify-content:center; flex:0 0 36px; width:36px; height:36px; padding:0; border:0; border-radius:3px; background:transparent; color:inherit; cursor:pointer; }
.opening-choice-button:hover { background:var(--color-field); }
.opening-choice-button:focus-visible { outline:1px solid var(--color-border); }
.opening-choice-button:disabled { opacity:.45; cursor:default; }
.opening-choice-icon { font-size:22px; line-height:1; }
/* Заголовок вложенной карточки товара, рядом с крестиком. */
.business-frame-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 18px 0; flex-shrink:0; }
.business-frame-heading h2 { margin:0; min-width:0; font-size:20px; line-height:1.3; overflow-wrap:anywhere; }
.business-frame-dialog--titled .business-frame-close { position:static; flex:0 0 44px; }
.opening-active-tab { background:#fff; color:var(--color-text,#132e3c); border-bottom-color:#fff; }
:root { --crm-amount-width:145px; }
col.crm-amount-column,
.accounting-waybills .accounting-lines col:nth-child(3) { width:var(--crm-amount-width); }
.data-table th.crm-amount-column,
.data-table td.crm-amount-column,
.data-table [data-column-type="amount"] { width:var(--crm-amount-width); min-width:var(--crm-amount-width); white-space:nowrap; font-variant-numeric:tabular-nums; }
.opening-list .data-table { table-layout:fixed; min-width:1000px; width:100%; }
.opening-list .data-table tbody td:nth-last-child(-n+2) { white-space:nowrap; font-variant-numeric:tabular-nums; }
.opening-lines .line-number-value { width:var(--crm-amount-width); }
.checkbox-row.shop-scope-filter { align-self: center; align-items: center; margin-block: 0; white-space: nowrap; }
.data-table > tfoot > tr > .crm-aligned-total { /* Keep totals aligned even in document tables with their own cell padding. */
    padding: var(--crm-total-padding) !important; }
:is(.opening-balances-list,.receipt-list) .data-table col:is([data-column="number"], [data-column="document_at"], [data-column="quantity_total"], [data-column="money_total_minor"]),
form:is([data-opening-balances],[data-quantity-receipt],[data-defect-form]) .opening-lines :is(col.line-sku, col.line-country, col.line-number-value, .crm-reference-cell),
#directory-selection.crm-related-rose-choice[open] :is(col.crm-reference-column, .crm-reference-cell, th[data-column="sku"], th[data-column="country_name"]),
body:has(form:is([data-opening-balances],[data-quantity-receipt],[data-price-form],[data-defect-form])) #directory-selection:is([data-choice-kind="opening-goods"],[data-choice-kind="price-products"])[open] :is(col.crm-reference-column, .crm-reference-cell, th[data-column="sku"], th[data-column="country_name"]) { --crm-list-column-width: 150px; box-sizing: border-box; width: 150px; min-width: 150px; max-width: 150px; }
.opening-list:is(.contract-list,.accounting-list--waybills,.accounting-list--acts) .data-table :is([data-column="document_on"], [data-column="amount_minor"], col.crm-amount-column, td.crm-amount-cell),
.opening-list:is(.accounting-list--waybills,.accounting-list--acts) .data-table [data-column="number"],
.opening-list.contract-list[data-contract-kind="customer"] .contract-list-table th[data-column="number"],
.opening-list.invoice-list .data-table :is([data-column="document_on"], [data-column="delivery_on"], [data-column="order_number"]) { --crm-list-column-width: 150px; box-sizing: border-box; width: 150px; min-width: 150px; max-width: 150px; }
.data-table.crm-amount-table { table-layout:fixed; width:100%; }
/* Общие правила вкладок, сумм и аннулированных документов. */
:root { --crm-control-font-size:var(--font-size,16px); }
.workspace-tab,
[role="tab"] { font-size:var(--crm-control-font-size); font-weight:700; }
.button[data-opening-add],
.directory-toolbar>.button { font-size:var(--crm-control-font-size); }
.data-table .crm-amount-cell { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.data-table .crm-amount-cell .table-sort { justify-content:flex-end; text-align:right; }
.data-table tbody tr.is-cancelled>td { background:#fbe9e7; color:#853b34; }
body #directory-selection[data-choice-kind="invoice-customers"][open] th[data-column="unp"] { box-sizing:border-box; width:200px; min-width:200px; max-width:200px; }
#directory-selection[open]:is([data-choice-kind="invoice-delivery-terms"], [data-choice-kind="invoice-payment-terms"],
    [data-choice-kind="invoice-purposes"], [data-choice-kind="invoice-funding-sources"]) { box-sizing:border-box; width:min(1120px, calc(100vw - 24px)); max-width:none; }
.crm-modal-page .contract-document:has([data-act-new-contract]),
.crm-modal-page .contract-document > form[data-act-new-contract] { height:auto; min-height:0; flex:none; }
.crm-modal-page .business-modal-content:has([data-act-new-contract]) { height:auto; min-height:0; }
.crm-modal-page .contract-document .act-contract-title { font-size:1.25rem; margin:0 48px 12px 0; }
.data-table tbody tr.is-cancelled:hover>td { background:#f7dedb; }
.data-table tbody tr.is-cancelled.is-selected>td,
.data-table tbody tr.is-cancelled:focus-visible>td { background:#efc5be; color:#692c27; }
.sidebar[inert] { opacity:.65; cursor:default; }
.sidebar[inert] a,
.sidebar[inert] button { pointer-events:none; }
/* Отпускные цены — общий стиль документов и адаптивные таблицы. */
.price-header .checkbox-row { align-self:center; }
.price-lines { min-width:1200px; }
.price-lines th .table-sort,
.price-lines th,
.price-lines th.crm-amount-cell { white-space:normal; }
.price-lines [data-price-new] { text-align:right; }
.price-lines td[data-price-markup],
.price-lines td[data-price-cost] { text-align:right; white-space:nowrap; }
/* Единая ширина реквизитов документов, по пропорциям Начальных остатков. */
.opening-header { --document-number-width:max(85px,calc((100% - 40px) * .105263158)); --document-date-width:max(200px,calc((100% - 40px) * .242105263)); --document-employee-width:max(180px,calc((100% - 40px) * .231578947)); grid-template-columns:var(--document-number-width) var(--document-date-width) minmax(170px,1fr) minmax(160px,1fr) var(--document-employee-width); }
.price-header { grid-template-columns:var(--document-number-width) var(--document-date-width) var(--document-employee-width) max-content minmax(0,1fr); }
.price-header [data-price-group] { grid-column:auto; min-width:0; width:100%; }
.price-header .checkbox-row { white-space:nowrap; }
@media(max-width:1200px) {
    .opening-header,
    .price-header { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .price-header [data-price-group] { grid-column:span 2; }
}
@media(max-width:800px) {
    .opening-header,
    .price-header { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .price-header [data-price-group] { grid-column:1 / -1; }
}
@media(max-width:550px) {
    .opening-header,
    .price-header { grid-template-columns:minmax(0,1fr); }
    .price-header [data-price-group] { grid-column:auto; }
}
/* Приход: общие размеры номера, даты и сотрудника; поставщик в шапке. */
.receipt-header { grid-template-columns:var(--document-number-width) var(--document-date-width) minmax(140px,.8fr) minmax(140px,.8fr) minmax(180px,1fr) var(--document-employee-width); }
@media(max-width:1450px) {
    .receipt-header { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:800px) {
    .receipt-header { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:550px) {
    .receipt-header { grid-template-columns:minmax(0,1fr); }
}
/* Общий стандарт шапок всех документов. Фиксированные поля переносятся на узких экранах. */
.opening-header,
.price-header,
.receipt-header { --document-number-width:120px; --document-date-width:200px; --document-shop-width:200px; --document-employee-width:200px; display:flex; flex-wrap:wrap; gap:10px; align-items:flex-start; }
.opening-header>.field-group { flex:0 0 200px; width:200px; min-width:0; max-width:100%; }
.opening-header>.field-group:has(#display_number) { flex-basis:var(--document-number-width); width:var(--document-number-width); }
.opening-header>.field-group:has(#supplier_id) { flex:1 1 200px; width:auto; min-width:min(200px,100%); }
.price-header>[data-price-group] { flex:1 1 200px; width:auto; min-width:min(200px,100%); }
.price-header>.checkbox-row { flex:0 0 auto; align-self:center; align-items:center; margin:0; }
.price-header>.checkbox-row input { margin-block:0; }
.crm-product-photo-preview { position:fixed; z-index:10000; width:300px; height:300px; background:#fff; border-radius:4px; box-shadow:0 2px 12px #0003; pointer-events:none; overflow:hidden; }
.crm-product-photo-preview img { display:block; width:300px; height:300px; object-fit:contain; }
.crm-confirm-dialog { position:fixed; inset:0; margin:auto; width:min(440px,calc(100vw - 32px)); max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px); overflow:auto; box-sizing:border-box; padding:28px; border:1px solid var(--color-border,#b8c2cc); border-radius:6px; background:var(--color-surface,#fff); color:var(--color-text,#132e3c); font:inherit; box-shadow:0 16px 48px #112f4333; }
.crm-confirm-dialog::backdrop { background:#0005; }
.crm-confirm-dialog h2 { margin:0 0 16px; font-size:20px; }
.crm-confirm-dialog p { margin:0 0 24px; white-space:pre-line; overflow-wrap:anywhere; }
.crm-confirm-dialog .directory-toolbar { justify-content:flex-end; margin:0; gap:10px; }
[data-order-parts-dialog] .directory-toolbar { margin-top:14px; }
[data-order-parts-dialog] .directory-toolbar > .button { flex:0 1 120px; min-width:0; }
.crm-confirm-dialog .button { min-width:80px; }
/* Брак: общие размеры денежных колонок и компактный выбор вида списания. */
[data-defect-form] .line-kind { width:170px; }
.crm-amount { text-align:right!important; font-variant-numeric:tabular-nums; }
.workspace-tab[aria-current="page"] { background:#fff; }
[data-defect-form] .opening-lines { min-width:1350px; }
[data-defect-form] td[data-line-cost] { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
/* Изготовление французских роз: общие элементы и прокрутка таблицы. */
.rose-lines { min-width:900px; }
.rose-lines [data-result-name] { white-space:normal; overflow-wrap:anywhere; }
/* Витрина использует общие поля, таблицы и кнопки CRM. */
.showcase-price { margin-left:auto; white-space:nowrap; font-size:20px; }
.showcase-lines { min-width:1530px; }
.showcase-lines [data-line-amount],
.showcase-lines [data-line-discount],
.showcase-lines [data-line-net] { text-align:right; white-space:nowrap; }
#panel-showcase>.directory-table-page { height:100%; min-height:0; }
.quick-actions a.quick-action { text-decoration:none; }
[data-showcase-form] .opening-header .field-group:has([name="assembly"]) { flex:1 1 270px; }
@media(max-width:640px) {
    .showcase-price { width:100%; text-align:right; }
}
/* Витрина: последовательные таблицы, отбор статуса, счётчик рабочего стола. */
.showcase-sections { display:flex; flex-direction:column; gap:18px; flex:1; min-height:0; overflow:auto; }
.showcase-sections>.opening-pane:not([hidden]) { flex:0 0 auto; min-height:0; }
.showcase-sections>.opening-pane[hidden] { display:none!important; }
.showcase-sections .table-scroll { flex:none; height:auto; min-height:0; max-height:clamp(180px,30dvh,380px); }
.showcase-section-heading { margin:0; flex-shrink:0; }
.showcase-section-heading h2.workspace-tab { margin:0; background:#fff; font-size:var(--crm-control-font-size); cursor:default; }
.showcase-status-filter { min-width:180px; max-width:100%; height:42px; padding-right:30px; }
.showcase-status { display:inline-block; padding:5px 10px; border-radius:4px; white-space:nowrap; }
.showcase-status--assembled { background:#dff2e4; color:#205c34; }
.showcase-status--sold { background:#dfebfa; color:#234e81; }
.showcase-status--ordered { background:#fff0bd; color:#6b4f00; }
.showcase-status--moved { background:#ebdef7; color:#643b83; }
.showcase-status--dismantled { background:#f7dddd; color:#8a3030; }
/* A document counter follows the tab title and never overlays another tab. */
.workspace-tabs .workspace-tab { display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.workspace-count { position:static; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; min-width:21px; height:21px; padding:0 5px; border-radius:999px; background:#e52323; color:#fff; font-size:12px; line-height:1; box-sizing:border-box; }
@media(max-width:640px) {
    .showcase-sections { overflow:visible; flex:none; }
    .showcase-status-filter { min-width:140px; }
    .showcase-sections .table-scroll { max-height:260px; }
}
/* Продажа — общие контролы, неизменяемая строка витрины и область чека. */
:where([data-sale-form], [data-showcase-form]) > .form-toolbar { align-items:center; flex-wrap:wrap; }
.sale-total { margin-left:auto; padding:9px 14px; background:#fff0ad; color:#292400; border-radius:4px; white-space:nowrap; font-size:20px; }
.sale-customer-row { flex-shrink:0; }
.sale-customer-row>.choice-field { width:100%; text-align:left; }
.sale-customer-information { margin:0; white-space:pre-wrap; max-height:90px; overflow:auto; flex-shrink:0; }
.sale-showcase-line td { background:#e7f2fb!important; }
.sale-showcase-line.is-selected td { background:#c5e0f4!important; }
.sale-status[hidden] { display:none!important; }
.sale-status>.field-group { width:100%; }
@media(max-width:800px) {
    .sale-total { font-size:17px; width:100%; text-align:right; }
}
/* Товары: остатки текущего магазина. Рабочий стол: общий шрифт контролов. */
.data-table .crm-stock-quantity-cell { width:150px; min-width:150px; text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.data-table .crm-stock-quantity-cell .table-sort { justify-content:flex-end; text-align:right; }
.quick-actions .quick-action { display:inline-flex; align-items:center; justify-content:center; width:118px; min-height:70px; padding:10px; text-align:center; font-family:var(--font-family); font-size:var(--crm-control-font-size); font-weight:700; line-height:1.25; }
@media(max-width:640px) {
    .quick-actions .quick-action { flex:1 1 104px; width:auto; max-width:none; min-height:66px; }
}
/* Payment drawer, uses the shared controls and font. */
.check-panel { position:fixed; inset:0 0 0 auto; margin:0; width:30vw; min-width:400px; max-width:100vw; height:100dvh; max-height:100dvh; box-sizing:border-box; padding:20px; border:0; border-radius:12px 0 0 12px; overflow:hidden; background:#fff; color:var(--text,#263238); }
.check-panel::backdrop { background:rgba(20,25,30,.35); }
.check-panel form { display:flex; flex-direction:column; gap:10px; height:100%; min-height:0; }
.check-panel .form-toolbar { display:flex; justify-content:space-between; flex-shrink:0; margin:0; gap:8px; }
.check-panel h2 { font-size:18px; margin:0; }
.check-meta { display:grid; grid-template-columns:120px minmax(0,1fr); gap:8px; }
.check-panel .field-group { min-width:0; margin:0; }
.check-panel .choice-field { width:100%; flex-shrink:0; text-align:left; min-height:54px; }
.check-panel .field-hint { font-size:12px; margin:0; }
.check-due { font-size:28px; font-weight:700; line-height:1.25; padding:5px 0; color:#28744e; overflow-wrap:anywhere; }
.check-modes { display:flex; gap:5px; }
.check-modes .button { flex:1; white-space:normal; height:auto; min-height:40px; font-size:12px; padding:8px; }
.check-amounts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.check-amounts > :is([data-check-amount-wrap="online"],[data-check-amount-wrap="bank"]) { grid-column:1 / -1; }
.check-panel [data-check-amount] { font-size:22px; text-align:right; }
.check-received { font-size:22px; font-weight:700; margin:4px 0; line-height:1.35; overflow-wrap:anywhere; }
.check-bottom { margin-top:auto; padding-top:10px; }
.check-accept { width:100%; min-height:54px; white-space:normal; }
.check-bottom p { margin:0; padding:12px 0; text-align:center; }
.check-panel .alert { margin:0; max-height:110px; overflow:auto; }
.check-confirm { width:min(480px,calc(100vw - 24px)); border:0; border-radius:10px; padding:22px; }
.check-confirm::backdrop { background:rgba(20,25,30,.35); }
.check-confirm h2 { font-size:18px; }
.check-confirm .form-toolbar { justify-content:flex-end; }
.check-refund { background:#fff4e8; }
.check-refund.is-selected { background:#e4eaf4; }
.check-panel [hidden] { display:none!important; }
@media(max-width:700px) {
    .check-panel { width:100vw; min-width:0; border-radius:0; padding:12px; }
    .check-panel form { gap:8px; }
}
@media(max-height:740px) {
    .check-panel { overflow-y:auto; }
    .check-panel form { height:auto; min-height:100%; }
    .check-panel .choice-field { min-height:48px; }
    .check-panel .check-bottom { margin-top:10px; }
}
/* Чек: магазин и касса — равные колонки, включая телефон. */
.check-shop-cash { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; align-items:stretch; flex-shrink:0; }
.check-shop-cash>.field-group,
.check-shop-cash .check-cash-field { width:100%; min-width:0; }
.check-shop-cash .form-field,
.check-shop-cash .choice-field { height:100%; min-height:60px; box-sizing:border-box; }
.check-shop-cash .choice-value { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media(max-width:700px) {
    .check-panel .check-due { font-size:26px; }
    .check-panel .check-received { font-size:21px; }
}
/* Адреса доставки: общие поля, таблицы и мобильная компоновка. */
.delivery-address-flags { display: flex; flex-wrap: wrap; gap: 14px 24px; }
.delivery-address-standard { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; border: 0; margin: 0; padding: 0; min-width: 0; }
.delivery-address-standard > * { min-width: 0; }
.delivery-address-standard[hidden],
.delivery-address-flags [hidden] { display: none; }
.data-table .delivery-address-cell { white-space: normal; overflow-wrap: anywhere; min-width: 110px; max-width: 560px; }
@media(max-width:600px) {
    .delivery-address-standard { grid-template-columns: minmax(0,1fr); }
}
/* Инкассация: шапка и суммы в общем стиле документов. */
.collection-header { display:flex; flex-wrap:wrap; gap:12px; }
.collection-header > .field-group { flex:0 0 200px; width:200px; min-width:0; }
.collection-header > .field-group:first-child { flex-basis:120px; width:120px; }
.collection-header > .field-group:nth-child(5) { flex:1 1 200px; }
.collection-lines td,
.collection-lines th { vertical-align:middle; }
.collection-lines input { width:100%; min-width:0; text-align:right; }
.collection-lines { --crm-amount-width:150px; }
@media(max-width:600px) {
    .collection-header > .field-group,
    .collection-header > .field-group:first-child,
    .collection-header > .field-group:nth-child(5) { flex:1 1 100%; width:100%; }
}
.collection-lines input { border:1px solid transparent; border-radius:0; padding:8px 4px; font:inherit; color:inherit; background:transparent; }
.collection-lines input:focus { outline:none; box-shadow:none; border:1px solid #888; }
.collection-lines input[readonly] { border-color:transparent; background:transparent; }
.collection-lines input[aria-invalid="true"] { border-color:#b34343; }
.history-detail td { white-space:pre-wrap; overflow-wrap:anywhere; vertical-align:top; }
.history-detail th:first-child { width:24%; }
.history-detail th:not(:first-child) { width:38%; }
@media(max-width:700px) {
    .history-detail table { min-width:660px; }
    .collection-lines { min-width:620px; }
}
/* Общее правило: без синих обводок. Фокус клавиатуры — тонкий нейтральный. */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible { outline-color:#7b8993; outline-width:1px; }
.choice-field:focus,
.choice-field:focus-visible { outline:none; box-shadow:none; border-color:#7b8993; }
.search-field:focus-within,
.search-input:focus,
.search-input:focus-visible { outline:none; box-shadow:none; border-color:var(--color-border); }
.data-table tbody tr:focus,
.data-table tbody tr:focus-visible { outline:none; box-shadow:none; }
/* Перемещение: общие размеры реквизитов, внутренняя прокрутка, планшет и телефон. */
.transfer-details>.field-group { flex:0 0 var(--document-shop-width); width:var(--document-shop-width); min-width:0; }
.transfer-details>.checkbox-row { align-self:center; flex:0 0 auto; }
.transfer-flags { display:flex; align-items:center; flex-wrap:wrap; gap:10px 24px; flex-shrink:0; }
.transfer-flags>span { font-size:13px; color:var(--color-muted,#52616b); }
.transfer-lines { min-width:800px; }
.transfer-lines .line-number { width:56px; }
.transfer-lines th { white-space:normal; }
.transfer-lines .line-number-value { width:145px; }
.transfer-list { min-width:1450px!important; }
.transfer-list th:first-child { width:90px; }
.transfer-list th:nth-child(2) { width:200px; }
.transfer-list th:last-child { width:145px; }
.transfer-list td { white-space:normal!important; overflow-wrap:anywhere; }
.transfer-filters { display:flex; align-items:center; flex:1 1 540px; max-width:none; gap:8px; }
.transfer-filters>.input { flex:0 1 240px; width:240px; min-width:140px; height:42px; }
.transfer-filters>.search-field { position:relative; flex:1 1 180px; min-width:160px; }
.transfer-filters .search-input { width:100%; height:42px; }
.transfer-state { display:inline-block; padding:4px 7px; border-radius:3px; }
.transfer-state--assembly { background:#f0f1f2; color:#43505a; }
.transfer-state--transit { background:#fff0bd; color:#6b4f00; }
.transfer-state--received { background:#dff2e4; color:#205c34; }
@media(max-width:1000px) {
    .transfer-filters { flex-wrap:wrap; flex-basis:100%; }
    .transfer-filters>.search-field { flex-basis:100%; }
}
@media(max-width:600px) {
    .transfer-header>.field-group,
    .transfer-details>.field-group,
    .transfer-filters>.input { flex:1 1 100%; width:100%; }
    .transfer-document .table-scroll { min-height:240px; }
}
/* Orders: shared fields, amounts, responsive composition and the A5 order blank. */
/* Order form: reference layout, shared CRM controls and internal scrolling. */
.order-document { container-type:inline-size; container-name:crm-order; }
.order-document [hidden] { display:none!important; }
.order-header { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.order-header>.field-group { flex:0 0 200px; width:200px; }
.order-header>.field-group:first-child { flex-basis:120px; width:120px; }
.order-header>.checkbox-row { flex:0 0 auto; align-self:center; margin:0 8px 0 0; }
.order-flags { display:flex; align-items:center; flex-wrap:wrap; gap:10px 20px; margin:0; flex-shrink:0; }
.order-flags:not(:has(>:not([hidden]))) { display:none; }
.order-flags>.field-group { width:200px; min-width:0; }
.order-balance { margin-left:auto; font-size:20px; color:var(--primary,#2f7145); }
.order-document form>[role="tabpanel"]:not([hidden]) { flex:1 1 0; overscroll-behavior:contain; }
.order-document #order-panel-data:not([hidden]) { display:flex; flex-direction:column; }
.order-data-grid { display:grid; flex:1; grid-template-columns:max-content minmax(0,1fr); gap:12px; min-height:620px; padding:0 0 2px; }
.order-fields { display:flex; flex-direction:column; gap:10px; min-width:0; }
.order-fields>* { min-width:0; flex-shrink:0; }
.order-channel-row { display:grid; grid-template-columns:200px minmax(0,1fr); gap:10px; }
.order-channel-row>* { min-width:0; }
.order-fields :is([data-order-wrap="internet_number"],[data-order-wrap="delivery_kind"],.order-delivery-date,[data-order-wrap="interval_id"],[data-order-wrap="delivery_time"]) { width:min(200px,100%); }
.order-delivery-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.order-delivery-row>* { min-width:0; }
.order-delivery-row .checkbox-row { gap:6px; max-width:95px; line-height:1.2; margin:0; }
[data-order-wrap="channel"]>.choice-field,
.order-party-field>.choice-field,
.order-address-field>.choice-field { height:66px; }
.order-party-field .choice-value,
.order-address-field .choice-value { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.order-fields .choice-icon { top:50%; transform:translateY(-50%); }
.order-summary { display:flex; flex-direction:column; gap:12px; min-width:0; min-height:0; }
.order-text-label { display:block; margin-bottom:5px; }
.order-textarea { resize:vertical; min-height:80px; width:100%; box-sizing:border-box; }
.order-postcard { display:flex; flex-direction:column; flex:1 0 160px; min-height:160px; }
.order-postcard>.order-textarea { flex:1; min-height:130px; resize:none; }
.order-comment { flex-shrink:0; }
.order-comment>.order-textarea { min-height:150px; }
.order-table-block { min-width:0; }
.order-table-block>.table-scroll { max-height:60vh; overflow:auto; }
.order-requested { display:flex; flex-direction:column; flex:none; min-height:0; gap:8px; }
.order-requested>.directory-toolbar { margin:0; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-start; }
.order-requested>.table-scroll { flex:none; height:auto; min-height:0; max-height:none; overflow:visible; }
.order-requested .order-lines { width:100%; min-width:0; table-layout:fixed; }
.order-requested .order-lines tbody tr { height:48px; }
/* Let the fixed-layout table share its remaining width across the four numeric columns. */
.order-requested col.order-requested-number { --crm-list-column-width:auto; width:auto; }
.order-requested .order-lines .crm-amount-cell { padding-left:8px; padding-right:8px; }
.order-requested .order-lines th:first-child,
.order-requested .order-lines td:first-child { width:auto; text-align:left; white-space:normal; overflow-wrap:anywhere; }
.order-requested .order-lines .order-line-name { display:block; box-sizing:border-box; width:100%; min-width:0; min-height:36px; margin:0; padding:8px; border:0; border-radius:3px; background:transparent; font:inherit; line-height:1.35; color:inherit; text-align:left; white-space:pre-wrap; overflow-wrap:anywhere; resize:none; outline:none; box-shadow:none; }
.order-requested .order-line-name:focus { background:var(--color-field); }
.order-postcard>.order-textarea:focus,
.order-postcard>.order-textarea:focus-visible,
.order-comment>.order-textarea:focus,
.order-comment>.order-textarea:focus-visible { border:1px solid #7b8993; outline:none; box-shadow:none; }
.order-document .order-numeric-table { --crm-amount-width:110px; table-layout:fixed; width:100%; }
.order-document .order-numeric-table .crm-amount-cell { width:110px; min-width:110px; max-width:110px; padding-left:8px; padding-right:8px; }
.order-document .order-numeric-table th.crm-amount-cell { white-space:normal; }
.order-document [data-order-section="goods"] .order-numeric-table,
.order-document .order-projection-lines { min-width:1120px; }
.order-document .order-projection-lines .line-number { width:56px; }
.order-document .order-projection-lines td { white-space:normal; overflow-wrap:anywhere; }
@container crm-order (width > 760px) {
    .order-requested .order-lines { table-layout:fixed !important; }
    .order-requested col:first-child { width:450px; }
    .order-requested th.crm-amount-cell { white-space:normal !important; }
}
@container crm-order (max-width:760px) {
    .order-requested .order-lines,
    .order-requested .order-lines tbody,
    .order-requested .order-lines tfoot { display:block; min-width:0; width:100%; }
    .order-requested .order-lines thead,
    .order-requested .order-lines colgroup { display:none; }
    .order-requested .order-lines tbody tr,
    .order-requested .order-lines tfoot tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 12px; height:auto; padding:8px 0; border-bottom:1px solid var(--color-border); }
    .order-requested .order-lines th,
    .order-requested .order-lines td { display:block; border:0; min-width:0; }
    .order-requested .order-lines td:first-child { grid-column:1 / -1; }
    .order-requested .order-lines td[data-label]::before { content:attr(data-label); display:block; font-size:12px; color:var(--color-muted); white-space:normal; text-align:left; }
    .order-requested .order-lines tfoot td { position:static; }
    .order-requested .order-lines tfoot td:empty { display:none; }
}
@container crm-order (max-width:680px) {
    .order-delivery-row { display:grid; grid-template-columns:200px minmax(0,1fr); }
    .order-delivery-row .checkbox-row { max-width:none; min-height:42px; }
    .order-delivery-row>[data-order-wrap="interval_id"],
    .order-delivery-row>[data-order-wrap="delivery_time"] { grid-column:2; }
}
@container crm-order (max-width:1440px) {
    .order-data-grid { grid-template-columns:minmax(0,1fr); min-height:0; flex:none; }
    .order-postcard { flex:none; min-height:160px; }
    .order-balance { font-size:18px; }
}
@container crm-order (max-width:600px) {
    .order-header>.field-group,
    .order-header>.field-group:first-child { flex:1 1 140px; width:auto; }
    .order-header>.checkbox-row { min-height:44px; }
    .order-channel-row,
    .order-delivery-row { grid-template-columns:minmax(0,1fr); }
    .order-delivery-row>[data-order-wrap="interval_id"],
    .order-delivery-row>[data-order-wrap="delivery_time"] { grid-column:auto; }
    .order-balance { width:100%; margin-left:0; }
}
@media(max-width:640px) {
    .order-document { overflow:auto; }
    .order-document form>[role="tabpanel"]:not([hidden]) { flex:none; overflow:visible; }
}
.order-lines { min-width:700px; }
.order-lines th,
.order-lines td { vertical-align:middle; }
.order-lines input { font:inherit; color:inherit; }
.order-lines .crm-amount-cell input { text-align:right; }
.order-source { background:#e9f3e5; }
.order-catalog { background:#e7f2fb; }
.order-enum { max-width:400px; }
.order-enum [data-order-enum-list] { display:grid; gap:6px; margin:12px 0; }
.order-enum [data-order-enum-list]>.button { justify-content:flex-start; }
.order-row--cancelled,
.order-row--declined { background:#fae8e8; color:#7d3434; }
.order-status { border-radius:4px; padding:3px 6px; white-space:nowrap; }
.order-status--new { background:#edf2ff; }
.order-status--completed { background:#e0f1dd; }
.order-status--cancelled,
.order-status--declined { background:#f8dddd; }
.order-print-page { background:#eee; color:#000; font-family:Roboto,Arial,sans-serif; }
.order-print-toolbar { display:flex; gap:12px; margin:12px auto; max-width:148mm; }
.order-print-sheet { page:crm-order; background:#fff; width:138mm; margin:12px auto; padding:5mm; font-size:9pt; line-height:1.3; }
.order-print-sheet table { width:100%; border-collapse:collapse; table-layout:fixed; }
.order-print-sheet td,
.order-print-sheet th { border:1px solid #000; padding:1.4mm; overflow-wrap:anywhere; white-space:pre-wrap; vertical-align:top; }
.order-print-sheet .print-top td { height:9mm; }
.order-print-sheet .print-lines td { height:6mm; }
.order-print-sheet .print-lines th { font-size:8pt; }
.order-print-sheet .print-comment { min-height:23mm; white-space:pre-wrap; }
.order-print-sheet .print-postcard { min-height:26mm; white-space:pre-wrap; }
.order-print-sheet .print-number { text-align:right; }
.order-print-sheet .print-line { border:1px solid #000; border-top:0; padding:2mm; }
.order-print-sheet .print-inline { display:flex; gap:5mm; justify-content:space-between; }
.order-print-sheet h1 { font-size:12pt; margin:0; }
.order-print-sheet tr { break-inside:avoid; }
@media print {
    body.order-print-page { background:#fff; margin:0; }
    .order-print-toolbar { display:none!important; }
    .order-print-sheet { width:100%; margin:0; padding:0; }
    .order-print-sheet thead { display:table-header-group; }
    .order-print-sheet .print-comment,
    .order-print-sheet .print-postcard { break-inside:auto; }
    @page crm-order { size:A5 portrait;margin:5mm }
}
/* Общие поля выбора: заполненное значение изменяется кнопкой справа. */
.choice-field.has-value { cursor:default; }
.choice-field .choice-icon { display:flex; align-items:center; justify-content:center; right:0; top:0; bottom:0; width:44px; height:auto; min-height:44px; transform:none; cursor:pointer; border-radius:0 12px 12px 0; }
.choice-field .choice-icon:hover { background:rgba(0,0,0,.045); }
.choice-field:disabled .choice-icon { cursor:not-allowed; }
.opening-lines .choice-field .choice-icon,
.order-fields .choice-field .choice-icon { top:0; transform:none; }
.opening-lines .choice-field .choice-icon { width:36px; min-height:36px; }
.document-tab-total { display:inline-block; margin-left:4px; white-space:nowrap; font-variant-numeric:tabular-nums; color:inherit; }
.workspace-tab:has(.document-tab-total) { flex-wrap:wrap; justify-content:flex-start; row-gap:2px; }
.data-table.crm-reference-columns { table-layout:fixed; }
.data-table col.crm-reference-column,
.data-table .crm-reference-cell { width:120px; min-width:120px; max-width:120px; box-sizing:border-box; }
.data-table .crm-reference-cell { white-space:normal; overflow-wrap:anywhere; }
.order-temporal { width:min(360px,calc(100vw - 32px)); box-sizing:border-box; }
.order-temporal>.input { width:100%; min-height:48px; margin:12px 0; }
[data-order-temporal-dialog] > [data-order-temporal-value][type="time"]:focus { outline:none; border-color:var(--color-focus); }
.order-temporal>.form-toolbar { margin-top:12px; flex-wrap:wrap; }
/* Goods returns reuse the document controls and table geometry. */
.return-document .opening-header > .field-group:has([name="basis_id"]) { flex:1 1 280px; }
.return-options { display:flex; flex-wrap:wrap; gap:16px; align-items:flex-start; }
.return-options > .field-group { flex:1 1 280px; min-width:0; }
.return-lines .checkbox-field { justify-content:flex-end; }
.return-modes { min-width:0; border:0; padding:0; margin:0; display:flex; gap:16px; flex-wrap:wrap; align-items:center; }
.return-modes legend { margin-bottom:8px; }
.return-modes label { display:inline-flex; gap:8px; align-items:center; }
.return-document .return-lines td:nth-child(2) { white-space:normal; overflow-wrap:anywhere; }
.return-lines .line-number-value { width:110px; }
.return-lines .line-sku,
.return-lines .line-country { width:120px; }
.return-document .field-group textarea { min-height:78px; }
@media(max-width:700px) {
    .return-options > .field-group { flex-basis:100%; }
    .return-modes { gap:12px; }
    .return-lines { min-width:1280px; }
    .return-document .form-toolbar { flex-wrap:wrap; }
}
.return-document [hidden] { display:none!important; }
/* Household needs reuse the document header, controls, pickers and number masks. */
.household-header { display:grid; grid-template-columns:240px 200px minmax(200px,1fr); gap:12px; margin-bottom:12px; align-items:start; }
.household-basis { display:grid; grid-template-columns:200px minmax(0,1fr); gap:12px; margin-bottom:12px; }
.household-document [data-household-comment] { margin-bottom:12px; }
.household-lines { min-width:1000px; table-layout:fixed; }
.household-lines .line-number-value { width:145px; }
.household-lines td,
.household-lines th { vertical-align:middle; }
.household-lines td:nth-last-child(-n+3),
.household-lines th:nth-last-child(-n+3) { text-align:right; }
.household-line-name { display:block; width:100%; min-height:48px; resize:vertical; background:transparent; color:inherit; font:inherit; border:1px solid transparent; border-radius:4px; padding:8px; white-space:pre-wrap; overflow-wrap:anywhere; }
.household-line-name:focus { outline:none; border-color:#868e95; box-shadow:none; }
.household-lines [hidden] { display:none!important; }
@media(max-width:900px) {
    .household-header { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .household-header>[data-household-cash] { grid-column:1/-1; }
}
@media(max-width:600px) {
    .household-header,
    .household-basis { grid-template-columns:minmax(0,1fr); }
    .household-document .form-toolbar { flex-wrap:wrap; }
    .household-lines { min-width:1000px; }
}
.household-lines .input { min-width:0; }
.household-money-lines { min-width:600px; }
/* Подтверждение: общий стиль для компьютера, планшета и телефона. */
.crm-confirm-dialog .button:focus-visible { outline:1px solid currentColor; outline-offset:2px; box-shadow:none; }
@media(max-width:480px) {
    .crm-confirm-dialog { padding:20px; }
    .crm-confirm-dialog .button { min-height:44px; }
}
/* Inventory shares the CRM controls, typography, numeric cells and table scrolling. */
.opening-header > [data-inventory-cash] { flex:0 1 260px; min-width:0; }
.inventory-group { flex:1 1 300px; min-width:0; }
.inventory-by-group { align-self:center; display:flex; align-items:center; gap:8px; }
.inventory-actions { display:contents; }
.inventory-lines td:nth-child(2) { white-space:normal; overflow-wrap:anywhere; }
.inventory-lines input { text-align:right; font:inherit; width:100%; min-width:0; box-sizing:border-box; }
.inventory-shortage { color:#9f293c; }
.inventory-surplus { color:#247341; }
.inventory-basis { color:inherit; text-decoration:none; }
.inventory-basis:hover { text-decoration:underline; }
.inventory-document [data-inventory-children] { padding-top:12px; }
.inventory-lines .line-number-value { width:140px; min-width:140px; }
.inventory-document [data-inventory-notice] { margin:12px 0; }
@media(max-width:767px) {
    .opening-header > [data-inventory-cash],
    .inventory-group { flex:1 1 100%; width:100%; }
    .inventory-document .table-scroll { overflow:auto; max-width:100%; }
    .inventory-document .form-toolbar { flex-wrap:wrap; }
    .inventory-lines { min-width:700px; }
}
/* Reports use the shared CRM typeface, buttons and table rules. */
.reports-page { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; gap:14px; }
.reports-heading,
.report-title-row { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-shrink:0; }
.reports-heading p { font-size:13px; margin-top:3px; }
.reports-heading h1 { font-size:22px; }
.reports-catalog { overflow:auto; min-height:0; padding:0 1px 20px; }
.report-catalog-search { margin-bottom:14px; }
.reports-page .search-field { height:42px; min-height:42px; border:1px solid var(--color-border); border-radius:var(--radius); overflow:hidden; background:#fff; }
.reports-page .search-field input { flex:1; min-width:0; border:0; outline:0; box-shadow:none; padding:9px 12px; background:none; }
.reports-page .search-clear { border:0; align-self:stretch; display:grid; place-items:center; width:40px; }
.reports-page input:focus,
.reports-page select:focus { outline:0; box-shadow:none; }
.reports-page button:focus-visible { outline:1px solid #7b8993; outline-offset:2px; }
#report-groups { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:18px; }
.report-group { padding:7px 11px; border:0; border-radius:3px; background:#f0f3f4; color:#4c5960; font-size:13px; }
.report-group.is-active { background:var(--color-sidebar); color:#fff; }
#report-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(245px,1fr)); gap:10px; }
.report-card { display:flex; flex-direction:column; text-align:left; min-height:120px; border:0; border-radius:3px; background:#f3f6f6; padding:16px; gap:8px; transition:background .12s; }
.report-card:hover { background:#e9f0ef; }
.report-card strong { font-size:15px; line-height:1.35; }
.report-card-group { font-size:11px; color:#4b746f; }
.report-card-meta { font-size:11px; color:#748087; margin-top:auto; }
.report-workspace { display:flex; flex:1; min-height:0; flex-direction:column; gap:10px; overflow:auto; }
.report-title-row h2 { font-size:19px; }
.report-actions { display:flex; gap:7px; }
.report-filters { display:flex; gap:8px; align-items:stretch; flex-shrink:0; }
.report-field { display:flex; flex-direction:column; position:relative; min-width:140px; border:1px solid var(--color-border); border-radius:var(--radius); padding:3px 10px; background:#fff; height:48px; }
.report-field span { font-size:10px; color:#657178; }
.report-field input,
.report-field select { border:0; outline:0; background:transparent; height:27px; padding:0; min-width:0; width:100%; font-size:13px; }
.report-field select { padding-right:10px; }
.report-shop-field { flex:1; min-width:160px; max-width:320px; }
.report-search { margin-left:auto; flex:1; align-self:center; }
.report-filters>.button { align-self:center; height:42px; }
.report-field:focus-within { border-color:#77868b; }
.report-field input:disabled,
.report-field select:disabled { color:#788085; opacity:1; }
.report-period { font-size:12px; color:#5d6a73; }
.report-progress { font-size:14px; padding:12px; background:#f3f6f6; }
.report-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; flex-shrink:0; }
.report-kpi { background:#edf5f2; padding:12px 14px; border-radius:3px; display:flex; flex-direction:column; gap:6px; }
.report-kpi span { font-size:11px; color:#47625e; }
.report-kpi strong { font-size:23px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.report-kpi.is-negative { background:#fbefed; color:#8e3830; }
.report-chart { background:#fafbfb; padding:10px 14px; max-height:220px; overflow:auto; flex-shrink:0; }
.report-chart svg { display:block; width:100%; height:auto; max-height:none; }
.report-chart-label { font-size:12px; margin-bottom:5px; }
.report-chart-note { font-size:11px; color:#6a747b; }
.report-table-wrap.table-scroll { min-height:220px; flex:1; border:0; overflow:auto; display:block; }
.report-table { width:100%; min-width:600px; table-layout:fixed; }
.report-table th { height:42px; position:sticky; top:0; z-index:2; background:#f1f3f4; white-space:normal; }
.report-table .table-sort { white-space:normal; line-height:1.25; }
.report-table td { font-size:13px; white-space:normal; min-width:115px; max-width:420px; overflow-wrap:anywhere; }
.report-table td.report-numeric,
.report-table th.report-numeric { width:145px; min-width:145px; max-width:none; white-space:nowrap; text-align:right; font-variant-numeric:tabular-nums; }
.report-table th.report-numeric .table-sort { justify-content:flex-end; text-align:right; }
.report-table tfoot { position:sticky; bottom:0; background:#edf2f2; z-index:2; }
.report-table tfoot td { border-top:1px solid #bcc6ca; }
.report-table tbody tr { cursor:default; }
.report-table tbody tr.is-selected { outline:0; background:#e1edee; }
.report-cancelled { color:#95554e; background:#fbefee; }
.report-negative { color:#a0473c; }
.report-method { font-size:12px; color:#69777f; flex-shrink:0; padding-bottom:6px; }
.report-method summary { cursor:pointer; }
.report-method ul { padding-left:20px; line-height:1.6; margin:8px 0; }
.report-permissions { margin:14px 0; }
.report-permissions summary { cursor:pointer; margin-bottom:10px; }
.report-permissions .field-hint { margin-bottom:12px; }
@media(max-width:1100px) {
    .report-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .report-chart { max-height:175px; }
    .report-title-row h2 { font-size:17px; }
    .report-search { max-width:none; flex-basis:200px; }
    .report-field { flex:1; }
}
@media(max-width:640px) {
    .reports-heading p { display:none; }
    .reports-heading h1 { font-size:20px; }
    .report-title-row { align-items:flex-start; }
    .report-title-row h2 { font-size:16px; }
    .report-actions .button { padding:8px 10px; min-height:40px; }
    .report-field { min-width:calc(50% - 8px); height:48px; }
    .report-shop-field { max-width:none; }
    .report-filters>.button { flex:1; }
    .report-search { max-width:none; }
    .report-kpi { padding:10px; }
    .report-kpi strong { font-size:18px; }
    .report-chart { max-height:160px; }
    .report-table-wrap.table-scroll { min-height:280px; }
    .report-workspace { overflow:auto; }
    .report-method { max-width:100%; }
    #report-cards { grid-template-columns:1fr; }
    .report-card { min-height:94px; }
    .reports-heading .button { padding:8px 11px; font-size:13px; }
}
/* Условия поставки и оплаты: длинная преамбула, общий стиль справочников. */
.contract-terms-table { table-layout:fixed; min-width:420px; }
.contract-terms-table th:first-child { width:35%; }
.contract-terms-table td { white-space:pre-wrap; overflow-wrap:anywhere; }
.contract-terms-fields { grid-template-columns:minmax(0,1fr); }
.workspace-page:has(.contract-terms-fields) .workspace-heading,
.workspace-page:has(.contract-terms-table) .workspace-heading { flex-shrink:1; }
/* Informational goods receipts share the document layout and numeric editor. */
.goods-receipt-header { display:flex; flex-wrap:wrap; gap:10px; }
.goods-receipt-header>.field-group { flex:0 0 200px; min-width:0; }
.goods-receipt-header>.field-group:first-child { flex-basis:120px; }
.goods-receipt-lines { min-width:980px; table-layout:fixed; }
.goods-receipt-lines .line-number { width:45px; }
.goods-receipt-lines .crm-amount-column { width:110px; }
.goods-receipt-lines td:not(:nth-child(2)),
.goods-receipt-lines tfoot td { text-align:right; }
.goods-receipt-lines td:nth-child(2) { overflow-wrap:anywhere; white-space:normal; }
.goods-receipt-lines input { width:100%; min-width:0; text-align:right; border:1px solid transparent; background:transparent; color:inherit; font:inherit; padding:8px 4px; }
.goods-receipt-lines input:focus { outline:none; border:1px solid #888; }
.goods-receipt-lines .choice-field { width:100%; min-width:0; white-space:normal; }
.goods-receipt-lines .choice-value { white-space:normal; overflow-wrap:anywhere; }
.goods-receipt-document .opening-pane { min-height:0; }
.goods-receipt-document .table-scroll { overflow:auto; }
.workspace-heading:has(+ .goods-receipt-document) { min-width:0; }
@media(max-width:600px) {
    .goods-receipt-header>.field-group,
    .goods-receipt-header>.field-group:first-child { flex:1 1 140px; }
    .goods-receipt-document .form-toolbar { flex-wrap:wrap; }
}
.data-table.goods-receipt-lines { min-width:1100px; }
.goods-receipt-lines th { white-space:normal; }
.goods-receipt-lines .choice-field .choice-icon { height:100%; }
/* Cards lock application navigation, including read-only cards. */
.crm-navigation-locked .sidebar { opacity:.55; }
.crm-navigation-locked .breadcrumbs a { color:inherit; text-decoration:none; }
.crm-navigation-locked .employee-bar a,
.crm-navigation-locked .menu-toggle { opacity:.5; }
.crm-navigation-hint { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); max-width:calc(100vw - 32px); padding:14px 20px; border:1px solid #b8bdc2; background:#fff; color:#26333b; box-shadow:0 4px 18px #0002; z-index:10000; font-size:14px; }
.crm-navigation-hint[hidden] { display:none; }
/* Global list rules, October 2026. Search stays within small screens. */
.search-field,
.search-field:where(form, #directory-selection .directory-toolbar > div),
.directory-selection .search-field,
.report-catalog-search,
.report-search { width:600px; max-width:100%; min-width:0; flex:0 1 600px; }
.search-field .search-input { min-width:0; }
.directory-toolbar,
.selection-heading,
.report-filters { flex-wrap:wrap; }
.sidebar-exit { display:flex; justify-content:center; flex:0 0 auto; margin:16px 0 0; padding:12px 0 0; border-top:1px solid #6a8090; }
.sidebar-logout { display:inline-flex; align-items:center; justify-content:center; gap:8px; color:inherit; background:transparent; border:0; padding:10px 5px; font:inherit; font-size:14px; }
.sidebar-logout:hover { background:var(--color-sidebar-hover); }
.employee-bar .button.employee-switch { width:104px; min-width:104px; height:46px; min-height:46px; padding:8px; }
.employee-bar .button.store-switch { width:50px; min-width:50px; height:46px; min-height:46px; padding:8px; }
.employee-switch .crm-icon { width:27px; height:27px; flex-basis:27px; }
.workspace-header { min-height:61px; padding-bottom:7px; }
.workspace-heading { flex-shrink:1; min-width:0; }
.employee-bar { min-width:0; }
.data-table .crm-list-number { width:100px; min-width:100px; white-space:nowrap; }
.data-table .crm-list-date { white-space:nowrap; }
.data-table th.order-flag-column { width:44px; min-width:44px; text-align:center; }
.order-flag-column .table-sort { justify-content:center; }
.data-table.customer-list-table { table-layout:fixed; width:100%; }
.customer-list-table [data-column="name"] { width:50%; white-space:normal; overflow-wrap:anywhere; }
.customer-list-table [data-column="information"] { white-space:normal; overflow-wrap:anywhere; }
.customer-list-table [data-column="phone"] { width:180px; white-space:nowrap; }
.customer-list-table [data-column="card_number"] { white-space:nowrap; }
.customer-list-table [data-column="unp"] { width:116px; white-space:nowrap; }
.customer-list-table [data-column="party_flags"] { width:90px; white-space:nowrap; }
.data-table tbody tr.customer-blacklisted>td,
.data-table tbody tr.customer-blacklisted.is-selected>td { color:#b32624; }
.product-list-table [data-column="name"] { white-space:normal; overflow-wrap:anywhere; min-width:220px; }
.product-list-table .product-folder-name { white-space:normal; overflow-wrap:anywhere; }
@media(max-width:640px) {
    .search-field,
    .search-field:where(form, #directory-selection .directory-toolbar > div),
    .directory-selection .search-field,
    .report-catalog-search,
    .report-search { width:100%; flex-basis:100%; }
    .employee-bar .button.employee-switch { width:88px; min-width:88px; }
    .workspace-header { align-items:flex-start; }
}
.data-table.customer-list-table { min-width:1150px; }
.customer-list-table [data-column="card_number"] { width:86px; }
.directory-table-page .data-table th .table-sort { white-space:normal; }
/* Order payment balance and aligned postcard/comment, orders-ui-v2. */
.order-balance[data-balance-state="due"] { color:#b42318; }
.order-balance[data-balance-state="overpaid"] { color:#175cd3; }
.order-balance[data-balance-state="paid"] { color:#237a3b; }
@container crm-order (width > 700px) {
    .order-fields { justify-self:start; width:max-content; max-width:100%; }
    .order-fields > :not(.order-delivery-row) { contain:inline-size; }
    .order-delivery-row { flex-wrap:nowrap; }
    .order-delivery-row > :not(.checkbox-row) { flex:0 0 auto; width:200px; }
    /* Reserve the delivery layout until the new order has a supply method. */
    [data-order-form][data-new-record="true"] .order-delivery-row:has([data-order-choice="delivery_kind"]:not(.has-value))
        > :is([data-order-wrap="exact_time"], [data-order-wrap="delivery_time"])[hidden] {
        display:flex !important;
        visibility:hidden;
    }
}
@container crm-order (width > 1440px) {
    .order-summary>.order-comment { display:flex; flex-direction:column; flex:1; }
    .order-summary>.order-comment>.order-textarea { flex:1; resize:none; }
    .order-fields>.order-postcard,
    .order-summary>.order-comment { margin-bottom:0; }
}
/* Product input and transfers toolbar */
.sale-customer-row { max-width:100%; }
.transfer-toolbar>select.input { width:auto; max-width:100%; flex:0 1 230px; height:42px; }
.transfer-toolbar .search-field:where(form, #directory-selection .directory-toolbar > div) { width:600px; max-width:100%; flex:0 1 600px; }
.transfer-toolbar .search-field:where(form, #directory-selection .directory-toolbar > div)>.search-field { width:100%; }
@media(max-width:600px) {
    .transfer-toolbar>select.input { flex:1 1 100%; width:100%; }
}
/* Заказ: единое полотно без вложенной вертикальной прокрутки. */
.workspace-page:has(.desktop .order-document) { height:auto; min-height:100dvh; overflow:auto; }
.workspace-page:has(.desktop .order-document) .app-shell { height:auto; min-height:100dvh; grid-template-rows:auto; }
.workspace-page:has(.desktop .order-document) .workspace-main,
.workspace-page:has(.desktop .order-document) .desktop { overflow:visible; height:auto; min-height:0; }
.workspace-page:has(.desktop .order-document) .sidebar { position:sticky; top:0; height:100dvh; align-self:start; }
.order-document,
.order-document form { height:auto; min-height:0; overflow:visible; flex:none; width:100%; }
.order-document form>[role="tabpanel"]:not([hidden]) { flex:none; min-height:0; overflow:visible; }
.order-document .table-scroll { flex:none; height:auto; max-height:none; overflow-x:auto; overflow-y:hidden; }
@container crm-order (max-width:760px) {
    .order-document .order-requested>.table-scroll { overflow:visible; }
}
.order-document .order-data-grid { flex:none; }
.order-header .order-flags { display:contents; }
.order-header [data-order-wrap="courier_id"] { flex:0 1 200px; }
#order-information { color:#ba2020; }
.order-requested input[readonly],
.order-requested textarea[readonly] { cursor:default; background:transparent; }
.order-temporal.is-calendar { width:min(460px,calc(100vw - 24px)); padding:20px; }
.order-calendar-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:14px 0; }
.order-calendar-heading strong { text-transform:capitalize; font-size:19px; }
.order-calendar-week,
.order-calendar-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; text-align:center; }
.order-calendar-week { margin-bottom:8px; color:#536570; }
.order-calendar-days button { min-height:44px; border:1px solid transparent; border-radius:6px; background:#edf1f3; color:inherit; font:inherit; cursor:pointer; }
.order-calendar-days button.other-month { background:transparent; color:#78858d; }
.order-calendar-days button:disabled { opacity:.35; cursor:default; }
.order-calendar-days button.is-today { border-color:#667c87; }
.order-calendar-days button[aria-selected="true"] { background:#ffec67; color:#172b35; }
.order-calendar-days button:not(:disabled):hover { background:#dbe7eb; }
.order-calendar-days button:focus-visible { outline:2px solid #555; outline-offset:-2px; }
.order-calendar>[data-calendar-today] { margin-top:12px; }
@media(max-width:600px) {
    .order-temporal.is-calendar { padding:12px; }
    .order-calendar-days { gap:2px; }
    .order-header [data-order-wrap="courier_id"] { flex:1 1 160px; }
    .workspace-page:has(.desktop .order-document) .sidebar { height:auto; }
}
.order-header .order-flags>.checkbox-row { margin:0; align-self:center; align-items:center; }
.cash-shift-document { overflow:auto; min-height:0; }
.cash-shift-document form { display:flex; flex-direction:column; gap:14px; }
.cash-shift-header { display:flex; flex-wrap:wrap; gap:12px; }
.cash-shift-header>.field-group { flex:1 1 200px; max-width:300px; }
.cash-shift-header>.field-group:first-child { flex:0 0 120px; }
.cash-shift-header > .field-group:not(:first-child):not(:has([name="closed"], [name="closed_by"])) { flex: 0 1 200px; width: 200px; max-width: 100%; min-width: 0; }

.cash-shift-document #selection-dialog .selection-option:disabled { color: var(--color-muted); cursor: default; }
.cash-shift-document .table-scroll { flex:none; max-height:55vh; min-height:0; }
.cash-shift-table { min-width:650px; }
.cash-shift-table td:not(:first-child),
.cash-shift-table th:not(:first-child) { text-align:right; width:160px; white-space:nowrap; }
.cash-shift-table input { text-align:right; width:100%; min-width:0; }
.cash-shift-document .shift-difference { color:#b32a27; }
.cash-shift-operations { min-width:850px; }
.cash-shift-document [data-shift-pane=closing]>.field-group { margin:16px 0; }
.shift-open { color:#24643e; }
.shift-closed { color:#6b7377; }
@media(max-width:600px) {
    .cash-shift-header>.field-group { max-width:none; flex:1 1 150px; }
    .cash-shift-document .workspace-tabs { flex-wrap:wrap; }
}
.shift-status-filter { width:180px; min-height:42px; }
@media(max-width:600px) {
    .cash-shift-document [data-shift-pane=closing] .cash-shift-table { min-width:0; width:100%; }
    .cash-shift-document [data-shift-pane=closing] thead { display:none; }
    .cash-shift-document [data-shift-pane=closing] tbody,
    .cash-shift-document [data-shift-pane=closing] tr { display:block; }
    .cash-shift-document [data-shift-pane=closing] tr { border:1px solid var(--border,#d7dce0); border-radius:8px; margin-bottom:12px; padding:10px; }
    .cash-shift-document [data-shift-pane=closing] td { display:flex; align-items:center; justify-content:space-between; width:100%; white-space:normal; border:0; gap:10px; padding:8px 0; }
    .cash-shift-document [data-shift-pane=closing] td:first-child { font-weight:600; }
    .cash-shift-document [data-shift-pane=closing] td:nth-child(2)::before { content:"По учёту, руб"; }
    .cash-shift-document [data-shift-pane=closing] td:nth-child(3)::before { content:"По факту, руб"; }
    .cash-shift-document [data-shift-pane=closing] td:nth-child(4)::before { content:"Расхождение, руб"; }
    .cash-shift-document [data-shift-pane=closing] input { width:150px; }
    .cash-shift-document [data-shift-pane=closing] .table-scroll { max-height:none; overflow:visible; }
}
@media(max-width:600px) {
    .cash-shift-document [data-shift-pane=closing] table,
    .cash-shift-document [data-shift-pane=closing] tbody { display:block; width:100%; }
    .cash-shift-document [data-shift-pane=closing] td { min-width:0; max-width:none; box-sizing:border-box; }
}
/* Contracts use shared fields, buttons and directory selection. */
.contract-document { overflow:auto; }
.contract-document form { display:grid; gap:16px; min-width:0; }
.contract-document .form-toolbar { margin:0; flex-wrap:wrap; }
.contract-header { display:flex; align-items:center; gap:14px; }
.contract-fields,
.contract-flags,
.contract-body-fields,
.contract-details { border:0; margin:0; padding:0; min-width:0; }
.contract-fields { display:flex; gap:14px; }
.contract-fields>.field-group { width:200px; min-width:0; }
.contract-fields>.field-group:first-child { width:120px; }
.contract-flags { display:flex; flex-wrap:wrap; gap:16px; align-items:center; }
.contract-flags .checkbox-row { white-space:nowrap; margin:0; }
.contract-body-fields,
.contract-details { display:grid; gap:14px; }
.contract-body-fields [data-contract-amount] { max-width:200px; }
.contract-details textarea { min-height:100px; resize:vertical; }
.contract-document [hidden] { display:none!important; }
.contract-list th[data-column=original],
.contract-list th[data-column=unsigned] { width:60px; white-space:nowrap; }
.customer-list-table [data-column=party_flags] { white-space:nowrap; }
@media(max-width:700px) {
    .contract-header,
    .contract-fields { width:100%; }
    .contract-fields>.field-group,
    .contract-fields>.field-group:first-child { width:auto; flex:1 1 140px; }
    .contract-flags { width:100%; }
    .contract-body-fields [data-contract-amount] { max-width:none; }
}
.contract-fields .form-field #number+label { top:10px; font-size:12px; }
/* Align dashboard panels and cash shift actions with the shared layout. */
.dashboard-document-table { display:flex; flex-direction:column; min-height:0; flex:1; }
.dashboard-document-table .panel-toolbar { margin-top:0; margin-bottom:4px; }
.cash-shift-document .form-toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.current-shop-name { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
/* List controls: wider employee switch on the desktop, compact shop scope. */
.employee-bar .button.employee-switch--desktop { width:144px; min-width:144px; }
.contract-list .contract-list-table { table-layout:auto; width:100%; min-width:1100px; }
.contract-list-table th[data-column=number] { width:100px; }
.contract-list-table th[data-column=document_on] { width:110px; }
.contract-list .contract-list-table :is([data-column="kind"],[data-column="period"]) { box-sizing:border-box; width:150px; min-width:150px; max-width:150px; white-space:nowrap; }
.contract-list-table th[data-column=amount_minor] { width:144px; }
.contract-list-table [data-column=customer_name] { white-space:normal; overflow-wrap:anywhere; }
.contract-list-table th[data-column=customer_name] { width:auto; }
@media(max-width:640px) {
    .employee-bar .button.employee-switch--desktop { width:112px; min-width:112px; }
}
.claim-document { overflow:auto; min-width:0; }
.claim-document form { display:grid; gap:16px; min-width:0; }
.claim-document .form-toolbar { margin:0; flex-wrap:wrap; }
.claim-fields { display:grid; grid-template-columns:minmax(0,1fr) 240px; gap:14px; border:0; padding:0; margin:0; min-width:0; }
.claim-fields>[data-claim-document-fields] { display:grid; grid-template-columns:240px minmax(0,1fr); gap:14px; grid-column:1/-1; }
.claim-fields>.field-group:has(textarea) { grid-column:1/-1; }
.claim-document [hidden] { display:none!important; }
.claim-list { min-width:1150px; width:100%; }
.claim-list td { white-space:normal; overflow-wrap:anywhere; }
.claim-status-completed td { color:#287447; }
.claim-header .field-hint { display:none; }
@media(max-width:700px) {
    .claim-fields,
    .claim-fields>[data-claim-document-fields] { grid-template-columns:minmax(0,1fr); }
    .claim-header>.field-group { flex:1 1 150px; }
}
.crm-global-calendar { width:460px; max-width:calc(100vw - 24px); }
.cash-shift-table input.input { width:100%; min-width:0; border:0; border-radius:0; background:transparent; box-shadow:none; text-align:right; padding:8px; font:inherit; color:inherit; }
.cash-shift-table input.input:focus { outline:1px solid #667c87; outline-offset:-1px; box-shadow:none; }
.cash-shift-document [hidden] { display:none!important; }
/* Directory cards: employee identity rows and grouped network discounts. */
.employee-fields { container-type: inline-size; }
.employee-contact-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container (min-width: 620px) {
    .employee-contact-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, .9fr); }
}
.discount-settings-row { align-items: start; }
.discount-settings-flag { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 66px; min-width: 0; }
.discount-settings-flag .field-hint { margin: 0; }
/* Workspace and stock tables: shared numeric alignment and compact product photos. */
table .empty-row td,
table .crm-empty-cell,
table td.empty-state { text-align:right!important; }
.data-table td.crm-number-cell,
.data-table tfoot td.crm-number-cell { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.data-table .crm-number-cell input[data-crm-number] { text-align:right; }
.crm-choice-separator { border:0; border-top:1px solid var(--color-border,#dbe1de); margin:12px 0; }
.crm-product-thumbnail { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; padding:1px; border:0; background:transparent; border-radius:3px; vertical-align:middle; cursor:pointer; flex:none; }
.crm-product-thumbnail img { display:block; width:30px; height:30px; object-fit:cover; border-radius:2px; }
.crm-product-thumbnail:focus-visible { outline:1px solid #666; outline-offset:2px; }
.data-table .crm-thumbnail-cell,
.product-list-table [data-column="photo"] { width:48px; min-width:48px; max-width:48px; padding:3px 8px; text-align:center; }
.crm-product-photo-preview[popover] { margin:0; padding:0; border:1px solid #dbe1de; inset:auto; width:300px; height:300px; box-sizing:content-box; overflow:hidden; }
.product-stock-panel { flex:none; margin-top:16px; min-width:0; }
.product-stock-panel h2 { margin:0 0 7px; font-size:16px; line-height:1.4; overflow-wrap:anywhere; }
.product-stock-panel .field-hint:empty { display:none; }
.product-stock-scroll.table-scroll { height:auto; min-height:0; max-height:240px; overflow:auto; flex:none; }
.product-stock-table { min-width:650px; table-layout:fixed; }
.product-stock-table th:first-child,
.product-stock-table td:first-child { width:24%; white-space:normal; overflow-wrap:anywhere; }
.product-stock-table th:not(:first-child) { text-align:right; }
.product-stock-table th,
.product-stock-table td { padding:8px 12px; height:36px; }
.product-list-table .crm-stock-quantity-cell { white-space:nowrap; text-align:right; }
@media(max-width:700px) {
    .product-stock-panel { margin-top:12px; }
    .product-stock-panel h2 { font-size:14px; }
    .product-stock-scroll.table-scroll { max-height:230px; }
    .product-stock-table { min-width:620px; }
}
/* Keep the name readable when numeric columns occupy a narrow screen. */
.data-table.product-list-table { min-width:1120px; }
.data-table.crm-product-picker-table { min-width:900px; }
#panel-transfers .transfer-list { min-width:1100px!important; }
/* Empty tables: one alignment for all document and directory styles. */
body table tbody td.empty-state,
body table tbody td.crm-empty-cell,
body table tbody tr.empty-row>td { text-align:right!important; }
/* Empty table cells keep colspan instead of the standalone empty-state flex layout. */
.data-table td.empty-state { display:table-cell; width:auto; min-width:0; max-width:none; padding:16px 15px; }
/* Cashless lists: flags take only the necessary space; buyer takes the remaining width. */
/* Общая рамка вкладок. Новые вкладки: .workspace-tabs + .crm-tab-content.
   Визуальное оформление едино для списков, документов и рабочего стола. */
:root { --crm-tab-frame-color: #aeb5b9; --crm-tab-frame-background: #fff; --crm-tab-frame-padding: 12px; }
.opening-document > form { --crm-tabs-gap: 12px; }
.cash-shift-document > form { --crm-tabs-gap: 14px; }
.invoice-goods-column,
.accounting-lines-area,
.opening-pane:has(> .workspace-tabs) { --crm-tabs-gap: 0px; }
.opening-pane:has(> .workspace-tabs) { gap: 0; }
body .workspace-tabs { flex-wrap: nowrap; gap: 0; min-width: 0; max-width: 100%; margin-bottom: 0; padding-top: 3px; overflow-x: auto; scrollbar-width: none; }
.workspace-tabs::-webkit-scrollbar { display: none; }
body .workspace-tabs > .workspace-tab { border-color: var(--crm-tab-frame-color); border-radius: 3px 3px 0 0; }
body .workspace-tabs > .workspace-tab + .workspace-tab { margin-left: -1px; }
body .workspace-tabs > .workspace-tab:is([aria-selected="true"], [aria-current="page"], .opening-active-tab, .is-active),
body .workspace-tabs > h2.workspace-tab { z-index: 1; background: var(--crm-tab-frame-background); border-bottom-color: var(--crm-tab-frame-background); color: var(--color-text); }
/* General siblings also cover a visible panel after hidden panels. */
body .workspace-tabs ~ :is(.workspace-panels, .directory-table-page, .opening-pane, [role="tabpanel"], [data-shift-pane], .crm-tab-content) { box-sizing: border-box; min-width: 0; margin-top: calc(-1px - var(--crm-tabs-gap, 0px)); border: 1px solid var(--crm-tab-frame-color); border-radius: 0 0 3px 3px; padding: var(--crm-tab-frame-padding); background: var(--crm-tab-frame-background); }
.crm-tab-content { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 0; }
body .crm-tab-content > .directory-toolbar { margin: 0; }
.crm-tab-content > .table-scroll { flex-basis: auto; }
@media (max-width: 640px) {
    :root { --crm-tab-frame-padding: 8px; }
}
/* Карточка сотрудника: общие поля, кнопки и рамка вкладок. */
.employee-document { display:flex; flex:1; flex-direction:column; min-height:0; overflow:hidden; }
.employee-document > form { display:flex; flex:1; flex-direction:column; min-height:0; --crm-tabs-gap:0px; }
.employee-document .form-toolbar { flex-shrink:0; flex-wrap:wrap; }
.employee-document [data-employee-pane][hidden] { display:none!important; }
.employee-document .employee-tab-panel { flex:1; min-height:0; }
.employee-document [data-employee-pane="main"] { overflow:visible; }
.employee-document .employee-columns { flex:none; min-width:0; }
.employee-document .report-permission-group { min-width:0; margin:20px 0 0; padding:10px 0 0; border:0; border-top:1px solid var(--color-border); }
.employee-document .report-permission-group legend { padding:0 8px 0 0; font-size:15px; }
.employee-document .report-permission-group .checkbox-row { margin-top:12px; }
.employee-personnel-table { table-layout:fixed; min-width:940px; }
.employee-personnel-table td { vertical-align:middle; }
.employee-personnel-table .input { text-align:left; min-width:0; }
.employee-personnel-table .choice-field { min-width:0; }
.employee-personnel-table input[type="checkbox"] { width:20px; height:20px; min-width:0; accent-color:#174d6b; }
.employee-personnel-table td:last-child { text-align:center; }
.employee-personnel-table input[type="checkbox"] { display:block; margin:0 auto; }
@media(max-width:640px) {
    .employee-document .directory-toolbar { gap:8px; flex-wrap:wrap; }
    .employee-document .employee-columns { display:flex; flex-direction:column; gap:20px; }
    .employee-document .employee-fields,
    .employee-document .permissions-panel { width:100%; min-width:0; }
}
/* Общие модификаторы форм. Оформление не задаётся в JavaScript и шаблонах. */
.field-triple { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; align-items:start; }
.workspace-page:has(.desktop .crm-page-flow) { height:auto; min-height:100dvh; overflow:auto; }
.workspace-page:has(.desktop .crm-page-flow) .app-shell { height:auto; min-height:100dvh; grid-template-rows:auto; }
.workspace-page:has(.desktop .crm-page-flow) .workspace-main,
.workspace-page:has(.desktop .crm-page-flow) .desktop { height:auto; min-height:0; overflow:visible; }
.workspace-page:has(.desktop .crm-page-flow) .sidebar { position:sticky; top:0; height:100dvh; align-self:start; }
.crm-page-flow,
.crm-page-flow > form,
.crm-page-flow .crm-tab-content { flex:none; width:100%; height:auto; min-height:0; overflow:visible; }
/* Дата с ручным вводом: тот же календарь, открываемый отдельной кнопкой. */
.crm-date-input { display:flex; align-items:center; min-width:0; width:100%; }
.crm-date-input > input:not([type="hidden"]) { flex:1; min-width:0; width:0; }
.crm-date-button { display:inline-flex; align-items:center; justify-content:center; flex:0 0 36px; width:36px; height:36px; padding:7px; border:1px solid transparent; border-radius:3px; background:transparent; color:inherit; }
.crm-date-button:hover { background:var(--color-subtle); }
.crm-date-button:focus-visible { outline:1px solid var(--color-focus); outline-offset:-1px; }
.crm-date-button:disabled { opacity:.55; cursor:not-allowed; }
@media(max-width:640px) {
    .field-triple { grid-template-columns:minmax(0,1fr); }
    .workspace-page:has(.desktop .crm-page-flow) .sidebar { height:auto; }
}
/* Общие размеры выбора кассы и вида денег. */
.selection-dialog.crm-cash-choice { width:min(700px,calc(100vw - 24px)); max-width:calc(100vw - 24px); }
.crm-cash-choice .data-table { min-width:0; width:100%; }
.crm-cash-choice .data-table td,
.crm-cash-choice .data-table th { white-space:normal; overflow-wrap:anywhere; }
@media(max-width:600px) {
    .selection-dialog.crm-cash-choice { width:calc(100vw - 16px); max-width:calc(100vw - 16px); }
}
/* Касса и курьер: кнопка выбора и поиск в одной строке, включая узкие экраны. */
.selection-dialog.crm-compact-choice { width:min(800px,calc(100vw - 24px)); }
.crm-compact-choice .directory-toolbar { flex-wrap:nowrap; gap:10px; }
.crm-compact-choice .directory-toolbar > .button { flex-shrink:0; }
.crm-compact-choice .search-field { order:1; flex:0 1 600px; width:600px; min-width:0; margin-inline:0; }
.crm-compact-choice [data-directory-add] { order:2; }
@media(max-width:600px) {
    .selection-dialog.crm-compact-choice { width:calc(100vw - 16px); }
}
/* Заголовки таблиц: одна строка; ширина колонки учитывает полный заголовок. */
body .data-table,
body .related-disabled-table { table-layout:auto!important; }
body .data-table th,
body .data-table th .table-sort,
body .related-disabled-table th { white-space:nowrap!important; overflow-wrap:normal; word-break:normal; }
/* Таблица продаж: краткие поля по содержимому, покупателю — оставшаяся ширина. */
.document-column-list .sales-list-table { table-layout:auto !important; }
.sales-list-table td[data-column="shop_name"] { white-space:normal; overflow-wrap:anywhere; }
.sales-list-table [data-column="customer_name"] { min-width:260px; white-space:normal; overflow-wrap:anywhere; }
.sales-list-table [data-column="employee_name"] { width:1%; min-width:160px; white-space:normal; }
/* Общая кнопка добавления оплаты. */
.button.button--payment { background:#28744e; border-color:#28744e; color:#fff; }
.button.button--payment:hover { background:#205f40; border-color:#205f40; color:#fff; }
.button.button--payment:disabled { opacity:.55; }
/* Нижняя строка шапки заканчивает поле курьера под отправившим сотрудником. */
@media(min-width:1500px) {
    .transfer-details { display:grid; width:calc(var(--document-number-width) + 5 * var(--document-shop-width) + 50px); max-width:100%; grid-template-columns:200px 200px max-content minmax(200px,1fr) 200px; align-items:center; }
    .transfer-details>.field-group { width:auto; }
    .transfer-details>.field-group:has(#courier_id) { width:100%; }
}
@media(min-width:601px) and (max-width:1499px) {
    .transfer-details>.field-group:has(#courier_id) { flex:1 1 300px; max-width:410px; width:auto; }
}
/* Чек: больше воздуха между основанием, суммой, способом и вводом денег. */
.check-panel { --check-space:14px; }
.check-panel .check-due { margin-top:var(--check-space); margin-bottom:0; }
.check-panel .check-due + .check-modes,
.check-panel .check-amounts { margin-top:var(--check-space); }
.check-panel .check-received { margin-top:calc(var(--check-space) + 4px); }
.check-complete { display:flex; align-items:center; gap:10px; margin:0; color:#28744e; font-size:16px; line-height:1.35; }
.check-complete-icon { display:inline-grid; place-items:center; flex:0 0 30px; width:30px; height:30px; border-radius:50%; background:#e4f3e9; color:#28744e; font-size:21px; }
.check-panel form>* { flex-shrink:0; }
@media(max-height:850px) {
    .check-panel { --check-space:8px; overflow-y:auto; }
    .check-panel form { height:auto; min-height:100%; }
}
/* Причина расхождения использует общий компонент многострочного поля. */
.cash-shift-document .shift-reason { margin:28px 0 20px; }
/* References in cashless document lists use the shared table layout. */
.accounting-list--waybills [data-column="basis_label"],
.accounting-list--acts [data-column="basis_label"] { min-width:240px; white-space:normal; overflow-wrap:anywhere; }
/* Order and address selectors follow the shared CRM toolbar. */
.selection-dialog.crm-address-choice { width:min(1100px,calc(100vw - 24px)); }
.crm-address-choice .directory-toolbar { flex-wrap:nowrap; gap:10px; }
.crm-address-choice .directory-toolbar > .button { flex-shrink:0; }
.crm-address-choice .search-field { flex:0 1 600px; width:600px; min-width:0; margin-left:auto; }
.order-document .order-balance { font-size:28px; line-height:1.3; }
@media(max-width:600px) {
    .selection-dialog.crm-address-choice { width:calc(100vw - 16px); }
    .order-document .order-balance { font-size:24px; }
}
/* Shared list filters and desktop notifications. */
.directory-toolbar>select.crm-list-filter { width:auto; max-width:100%; flex:0 1 230px; height:42px; }
.dashboard-order-filters { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.dashboard-order-filters .checkbox-row { margin:0; white-space:nowrap; }
#panel-orders .panel-toolbar { flex-wrap:wrap; gap:12px; }
#panel-orders .search-field { margin-left:0; flex:0 1 600px; min-width:180px; }
.workspace-count.workspace-count--incoming { background:#1765b3; color:#fff; }
.data-table tbody tr.order-row--incoming>td { background:#e4f0ff; color:#173b60; }
.data-table tbody tr.order-row--incoming:hover>td { background:#d6e7ff; }
.data-table tbody tr.order-row--incoming.is-selected>td { background:#bed9fb; }
.data-table tbody tr.sale-row--cancelled>td { background:#fbe9e7; color:#853b34; }
.data-table tbody tr.sale-row--cancelled.is-selected>td { background:#efc5be; }
.french-rose-list th[data-column="quantity_total"] { width:130px; min-width:130px; }
.data-table.goods-receipt-lines input.input { height:36px; min-height:36px; border-radius:3px; padding:8px; box-sizing:border-box; border:1px solid transparent; }
.data-table.goods-receipt-lines input.input:focus { background:var(--color-field); border-color:var(--color-border); outline:none; }
.opening-list.accounting-list--acts .data-table { table-layout:auto; }
.accounting-list--acts [data-column="customer_name"] { width:auto; min-width:0; white-space:normal; overflow-wrap:anywhere; }
.opening-list.accounting-list--acts [data-column="basis_label"] { width:1%; min-width:0; white-space:nowrap; overflow-wrap:normal; }
.crm-form-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; min-width:0; }
@media(max-width:600px) {
    .directory-toolbar>select.crm-list-filter { flex:1 1 100%; width:100%; }
    .crm-form-pair { grid-template-columns:minmax(0,1fr); }
    #panel-orders .search-field { flex:1 1 100%; }
}
/* A cash shift belongs to a single Minsk calendar day. */
.cash-shift-day-warning { flex:none; margin:0 0 14px; padding:12px 16px; max-height:24vh; overflow:auto; }
.cash-shift-day-warning[hidden] { display:none!important; }
.cash-shift-day-warning ul { list-style:none; padding:0; margin:8px 0 0; display:grid; gap:8px; }
.cash-shift-day-warning li { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.cash-shift-day-warning li>span { flex:1; min-width:0; }
.cash-shift-day-warning .button { flex:none; }
.cash-shift-day-warning p { margin:8px 0 0; }
.data-table tr.shift-overdue>td { color:#9f2b25; background:#fff0ed; }
.data-table tr.shift-overdue.is-selected>td { background:#f9ddd5; }
@media(max-width:700px) {
    .cash-shift-day-warning { max-height:32vh; }
    .cash-shift-day-warning li { align-items:stretch; flex-direction:column; gap:8px; }
}
/* Рабочий стол, выбор и ограничения просмотра — единые стили. */
.order-overdue-mark { display:block; margin-top:3px; color:#a32424; font-size:12px; white-space:nowrap; }
.data-table tr.order-row--overdue { background:#fff1e7; color:#752d16; }
.data-table tr.order-row--overdue:hover { background:#ffe5d3; }
.data-table tr.order-row--overdue.is-selected { background:#ffd9c0; }
.order-row--incoming.order-row--overdue .order-overdue-mark { font-weight:700; text-decoration:underline; }
.dashboard-document-table .panel-toolbar>.dashboard-order-filters { order:-1; margin-right:auto; }
.dashboard-document-table .panel-toolbar>.search-field { margin-left:auto; }
.order-choice-dialog .selection-heading { flex-wrap:nowrap; }
.order-choice-dialog .selection-heading>button { flex-shrink:0; }
.order-choice-dialog .selection-list { display:block; margin-top:10px; }
.contract-kind-tabs { flex-shrink:0; }
@media(max-width:700px) {
    .dashboard-document-table .panel-toolbar>.dashboard-order-filters { flex-basis:100%; gap:12px; }
    .dashboard-document-table .panel-toolbar>.search-field { width:100%; flex-basis:100%; }
}
.selection-dialog.crm-shop-choice { height:min(520px,calc(100dvh - 48px)); max-height:calc(100dvh - 48px); }
/* Shared compact controls and print preview (2026-10). */
.button.button--compact-icon { width:26px; min-width:26px; height:26px; min-height:26px; padding:2px; line-height:1; align-self:center; justify-content:center; font-size:17px; }
.employee-bar { column-gap:0; row-gap:6px; }
.employee-bar .header-separator { white-space:pre; }
.employee-bar .employee-switch { margin-left:12px; }
.collection-header>.field-group:nth-child(5) { flex:0 0 200px; width:200px; }
.settings-directory .button--danger { background:#a93232; border-color:#a93232; color:#fff; }
.settings-directory .button--danger:hover { background:#862525; border-color:#862525; }
.directory-page.accounting-waybills .accounting-header:first-child { display:grid; grid-template-columns:minmax(145px,1fr) 140px auto auto; gap:10px; }
.directory-page.accounting-waybills .accounting-header:first-child>.field-group { min-width:0; width:auto; max-width:none; }
.directory-page.accounting-waybills .accounting-header:first-child>.checkbox-row { white-space:nowrap; gap:5px; }
.directory-page.accounting-waybills .accounting-shipment-row { grid-template-columns:140px minmax(0,1fr); }
.directory-page.accounting-acts .field-group:has(#amount) { width:170px; }
.accounting-statement-header { display:flex; flex-wrap:wrap; gap:12px; align-items:start; }
.accounting-statement-header>.field-group { flex:0 0 200px; width:200px; min-width:0; }
.directory-page.accounting-statements .accounting-lines .number-col { width:130px; }
.directory-page.accounting-reconciliations .accounting-header:first-child>.field-group { flex:0 0 200px; min-width:0; }
.directory-page.accounting-reconciliations .accounting-header:first-child>.field-group:has(#number) { flex-basis:120px; }
.reconciliation-parties { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
.crm-pdf-preview { width:min(1200px,calc(100vw - 32px)); height:calc(100dvh - 32px); max-width:none; max-height:none; padding:0; border:1px solid #6d7780; border-radius:8px; color:var(--text-color,#192a35); background:#f3f5f6; box-shadow:0 12px 48px #0005; }
.crm-pdf-preview[open] { display:flex; flex-direction:column; }
.crm-pdf-preview::backdrop { background:#14263199; }
.crm-pdf-preview__bar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:12px; border-bottom:1px solid #bdc6cb; }
.crm-pdf-preview__bar strong { margin-right:auto; }
.crm-pdf-preview iframe { display:block; flex:1; width:100%; min-height:0; border:0; background:#d8dce0; }
.crm-pdf-preview__message { padding:8px 12px; margin:0; }
.crm-pdf-preview [hidden] { display:none!important; }
@media(pointer:coarse) {
    .button.button--compact-icon { width:36px; min-width:36px; height:36px; min-height:36px; }
}
@media(max-width:600px) {
    .collection-header>.field-group:nth-child(5) { flex:1 1 100%; width:100%; }
    .accounting-statement-header>.field-group { flex:1 1 calc(50% - 12px); width:auto; }
    .reconciliation-parties { grid-template-columns:minmax(0,1fr); }
    .crm-pdf-preview { width:100vw; height:100dvh; border-radius:0; }
    .crm-pdf-preview__bar { gap:6px; padding:8px; }
    .crm-pdf-preview__bar strong { width:100%; }
    .crm-pdf-preview__bar .button { padding:8px; font-size:13px; }
}
.directory-page.accounting-waybills .accounting-columns.is-waybill { grid-template-columns:minmax(600px,52%) minmax(0,1fr); }
.directory-page.accounting-waybills .accounting-header:first-child { grid-template-columns:minmax(190px,1fr) 180px auto auto; align-items:center; }
.directory-page.accounting-waybills .accounting-header:first-child>.field-group:has(#number) { min-width:0; }
.directory-page.accounting-waybills .accounting-header:first-child>.checkbox-row { margin:0; }
.directory-page.accounting-waybills .field-group:has([data-picker="status"]),
.directory-page.accounting-waybills .field-group:has([data-picker="delivery"]) { width:180px; }
.directory-page.accounting-waybills .accounting-shipment-row { grid-template-columns:180px minmax(0,1fr); }
@media(max-width:1399px) {
    .directory-page.accounting-waybills .accounting-columns.is-waybill { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:600px) {
    .directory-page.accounting-waybills .accounting-shipment-row { grid-template-columns:minmax(0,1fr); }
}
.crm-pdf-preview__pages { overflow:auto; flex:1; min-height:0; padding:16px; background:#d8dce0; text-align:center; overscroll-behavior:contain; }
.crm-pdf-preview__page { min-height:350px; margin:0 auto 16px; max-width:1000px; }
.crm-pdf-preview__page canvas { background:white; box-shadow:0 2px 8px #0003; }
.crm-pdf-preview__page p { margin:8px 0; font-size:13px; }
.crm-pdf-print-frame { position:fixed; left:-10000px; top:0; width:800px; height:1000px; border:0; }
.directory-page.accounting-waybills .accounting-lines { min-width:500px; }
/* Scrap disposal uses the same table controls, without retail-price columns. */
[data-defect-form][data-source-mode="scrap"] .opening-lines { min-width:900px; }
/* Messages and common form refinements, 07.10.2026. */
.contract-content { display:grid; gap:16px; width:fit-content; max-width:100%; }
.contract-header,
.contract-fields { flex-wrap:nowrap; }
.contract-fields>.field-group:has([name=document_on]) { width:158px; }
.contract-body-fields,
.contract-details { width:100%; }
.customer-discount-block,
.customer-card-column>.field-group:has([name=unp]) { width:calc((100% - 14px)/2); }
#directory-selection:is(.cashless-party-choice,[data-choice-kind="sale-customers"],[data-choice-kind="order-customer_id"],[data-choice-kind="return-basis"])[open] { width: min(1200px, calc(100vw - 24px)); max-width: none; min-width: 0; box-sizing: border-box; margin-inline: auto; }
#directory-selection:is(.cashless-party-choice,[data-choice-kind="sale-customers"],[data-choice-kind="order-customer_id"])[open] .data-table { table-layout: fixed !important; width: 100%; min-width: 550px; }
#directory-selection:is(.cashless-party-choice,[data-choice-kind="sale-customers"])[open] th[data-column="phone"] { width: 200px; box-sizing: border-box; }
#directory-selection[data-choice-kind="sale-customers"][open] th[data-column="card_number"],
#directory-selection.cashless-party-choice[open] th[data-column="unp"] { width: 150px; box-sizing: border-box; }
#directory-selection:is(.cashless-party-choice,[data-choice-kind="sale-customers"]) td:first-child { overflow-wrap: anywhere; }
#directory-selection.crm-card-choice { width:min(1120px,calc(100vw - 32px)); }
#directory-selection.crm-card-choice .directory-toolbar { flex-wrap:nowrap; gap:10px; }
#directory-selection.crm-card-choice .search-field { flex:1 1 420px; min-width:140px; max-width:600px; margin-left:auto; }
#directory-selection.crm-card-choice .button { flex-shrink:0; }
#directory-selection.crm-message-employee-choice { width:min(760px,calc(100vw - 24px)); }
#directory-selection.crm-payment-basis-choice table { table-layout:fixed; width:100%; min-width:880px; }
#directory-selection.crm-payment-basis-choice th[data-column=number] { width:100px; }
#directory-selection.crm-payment-basis-choice th[data-column=document_at] { width:170px; }
#directory-selection.crm-payment-basis-choice th[data-column=shop_name] { width:140px; }
#directory-selection.crm-payment-basis-choice th[data-column=customer_name] { width:auto; }
#directory-selection.crm-payment-basis-choice th[data-column=total_minor],
#directory-selection.crm-payment-basis-choice th[data-column=paid_minor] { width:140px; }
#directory-selection.crm-payment-basis-choice td { white-space:normal; overflow-wrap:anywhere; }
.accounting-list--acts [data-column=original] { width:1%; white-space:nowrap; text-align:center; }
.order-requested .order-lines .order-line-name { max-height:58px; overflow:hidden; }
#order-panel-extras .opening-lines { table-layout:fixed; min-width:1200px; }
#order-panel-extras th:nth-child(1) { width:45px; }
#order-panel-extras th:nth-child(2) { width:185px; }
#order-panel-extras th:nth-child(3) { width:auto; min-width:280px; }
#order-panel-extras td:nth-child(3) { white-space:normal; overflow-wrap:anywhere; }
#order-panel-extras th:nth-child(n+4):nth-child(-n+5) { width:120px; }
#order-panel-extras th:nth-child(n+6) { width:110px; }
@media(max-width:1000px) {
    .contract-content { width:100%; }
    .contract-header,
    .contract-fields { flex-wrap:wrap; }
    .contract-header { align-items:flex-start; }
}
@media(max-width:600px) {
    .customer-discount-block,
    .customer-card-column>.field-group:has([name=unp]) { width:100%; }
    #directory-selection.crm-card-choice .directory-toolbar { flex-wrap:wrap; }
    #directory-selection.crm-card-choice .search-field { flex-basis:100%; min-width:0; }
    .contract-fields>.field-group:has([name=document_on]) { width:auto; }
}
/* Message lists keep their toolbar inside the viewport; only the table scrolls. */
/* Supplier contract numbers may include a series and additional identifiers. */
.contract-list[data-contract-kind="supplier"] .contract-list-table th[data-column="number"] { width:220px; min-width:220px; }
.contract-list[data-contract-kind="supplier"] .contract-list-table td:first-child { min-width:220px; white-space:normal; overflow-wrap:anywhere; }
/* Customer sublists, bank selectors and waybill fields share common controls. */
.business-list[data-embedded-list="true"][data-business-kind="legal-contacts"] .directory-toolbar,
.business-list[data-embedded-list="true"][data-business-kind="accounts"] .directory-toolbar { flex-wrap:nowrap; }
.business-list[data-embedded-list="true"] .directory-toolbar>.button { flex-shrink:0; }
.business-list[data-embedded-list="true"] .search-field { width:420px; max-width:70%; flex:0 1 420px; min-width:0; }
.crm-field-with-flag { display:flex; align-items:center; gap:14px; min-width:0; }
.crm-field-with-flag>.field-group { flex:1; min-width:0; }
.crm-field-with-flag>.checkbox-row { margin:0; white-space:nowrap; }
#directory-selection.crm-bank-choice,
#directory-selection.crm-waybill-goods-choice { width:min(1100px,calc(100vw - 24px)); height:min(650px,calc(100dvh - 32px)); }
#directory-selection.crm-bank-choice .directory-toolbar,
#directory-selection.crm-waybill-goods-choice .directory-toolbar { flex-wrap:nowrap; gap:10px; }
#directory-selection.crm-bank-choice .button,
#directory-selection.crm-waybill-goods-choice .button { flex-shrink:0; }
#directory-selection.crm-bank-choice .search-field,
#directory-selection.crm-waybill-goods-choice .search-field { flex:1 1 420px; width:420px; min-width:100px; max-width:600px; }
.directory-page.accounting-waybills .accounting-header:first-child { grid-template-columns:130px 180px max-content max-content; justify-content:start; }
.directory-page.accounting-waybills .accounting-details>.field-group:has([data-picker="official_id"]),
.directory-page.accounting-waybills .accounting-details fieldset>.field-group:has([data-picker="official_id"]),
.directory-page.accounting-waybills [data-for-delivery] { width:calc((100% - 12px)/2); }
@media(max-width:600px) {
    #directory-selection.crm-bank-choice .directory-toolbar,
    #directory-selection.crm-waybill-goods-choice .directory-toolbar { flex-wrap:wrap; }
    #directory-selection.crm-bank-choice .search-field,
    #directory-selection.crm-waybill-goods-choice .search-field { flex-basis:100%; width:100%; }
    .directory-page.accounting-waybills .accounting-header:first-child { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
    .directory-page.accounting-waybills .accounting-details fieldset>.field-group:has([data-picker="official_id"]),
    .directory-page.accounting-waybills [data-for-delivery] { width:100%; }
}
@media(max-width:400px) {
    .business-list[data-embedded-list="true"] .directory-toolbar { flex-wrap:wrap; }
    .business-list[data-embedded-list="true"] .search-field { max-width:100%; width:100%; flex-basis:100%; }
}
/* Equal waybill columns; narrow screens stack the same form. */
@media(min-width:1400px) {
    .directory-page.accounting-waybills .accounting-columns.is-waybill { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
}
.directory-page.accounting-waybills .accounting-header:first-child { grid-template-columns:120px minmax(120px,180px) max-content max-content; }
@media(max-width:600px) {
    .directory-page.accounting-waybills .accounting-header:first-child { grid-template-columns:120px minmax(0,1fr); }
}
/* Накладная: серия и номер бланка — 240 px. */
.directory-page.accounting-waybills .accounting-header:first-child { grid-template-columns:240px minmax(120px,180px) max-content max-content; }
.directory-page.accounting-waybills .accounting-header:first-child>.field-group:has(#number) { width:240px; max-width:240px; }
@media(max-width:600px) {
    .directory-page.accounting-waybills .accounting-header:first-child { grid-template-columns:minmax(0,1fr); }
    .directory-page.accounting-waybills .accounting-header:first-child>.field-group:has(#number) { max-width:100%; }
}
/* Contract comment fills the remaining card height. */
.contract-document>form { display:flex; flex-direction:column; min-height:100%; min-width:0; }
.contract-document .contract-content { display:flex; flex-direction:column; flex:1; min-height:0; }
.contract-document .contract-details { display:flex; flex-direction:column; flex:1; }
.contract-document .contract-details>.field-group:has(#comment) { display:flex; flex-direction:column; flex:1; min-height:160px; }
.contract-document .contract-details .form-field:has(#comment) { display:flex; flex:1; min-height:160px; }
.contract-document #comment { height:100%; flex:1; min-height:160px; resize:vertical; }
.cashless-original-filter { flex:none; white-space:nowrap; margin:0 8px; }
.product-card-columns { display:grid; grid-template-columns:minmax(280px,40%) minmax(0,1fr); gap:24px; min-height:0; }
.product-card-columns>.directory-fields { min-width:0; width:100%; max-width:none; }
.product-movements { min-width:0; display:flex; flex-direction:column; max-height:calc(100dvh - 210px); }
.product-movements h2 { font-size:18px; margin:0 0 12px; }
.product-movements .table-scroll { overflow:auto; min-height:100px; }
.product-movements table { min-width:560px; }
.product-movements td:nth-child(2) { white-space:normal; overflow-wrap:anywhere; }
@media(max-width:1100px) {
    .product-card-columns { grid-template-columns:minmax(0,1fr); }
    .product-movements { max-height:480px; }
}
.contract-document { display:flex; flex-direction:column; }
.contract-document>form { flex:1; }
/* Contract number: 120px -> 180px, retaining mobile wrapping. */
@media(min-width:701px) {
    .contract-document .contract-fields>.field-group:first-child { width:180px; }
}
/* Embedded contract: four requisites on one row at desktop modal width. */
@media(min-width:760px) {
    .crm-modal-page .contract-document .contract-content { width:100%; }
    .crm-modal-page .contract-document .contract-header { flex-wrap:wrap; }
    .crm-modal-page .contract-document .contract-fields { display:grid; grid-template-columns:180px 158px minmax(160px,1fr) minmax(140px,1fr); gap:14px; width:100%; flex:0 0 100%; }
    .crm-modal-page .contract-document .contract-fields>.field-group { width:100%; min-width:0; }
    .crm-modal-page .contract-document .contract-flags { width:100%; }
}
/* Waybill list: compact requisites; customer uses remaining width. */
.accounting-list--waybills .data-table { table-layout:auto; min-width:900px; width:100%; }
.accounting-list--waybills [data-column] { width:1%; white-space:nowrap; }
.accounting-list--waybills [data-column="basis_label"] { width:1%; min-width:0; white-space:nowrap; overflow-wrap:normal; }
.accounting-list--waybills [data-column="released"],
.accounting-list--waybills [data-column="original"] { width:1%; min-width:0; padding-left:6px; padding-right:6px; white-space:nowrap; text-align:center; }
.accounting-list--waybills [data-column="customer_name"] { width:100%; min-width:260px; white-space:normal; overflow-wrap:anywhere; }
/* Goods choices share one full-width table in invoice and waybill dialogs. */
#directory-selection.crm-waybill-goods-choice [data-selection-list-panel],
#directory-selection.crm-waybill-goods-choice [data-directory-scroll] { width:100%; max-width:100%; min-width:0; align-self:stretch; box-sizing:border-box; }
#directory-selection.crm-waybill-goods-choice .data-table { width:100%!important; max-width:none; min-width:0; table-layout:fixed; }
#directory-selection.crm-waybill-goods-choice th,
#directory-selection.crm-waybill-goods-choice td { width:auto; white-space:normal; overflow-wrap:anywhere; }
body:has([data-accounting-form][data-kind="waybills"])
#directory-selection[data-choice-kind="accounting-customers"][open] th:is([data-column="phone"], [data-column="unp"]),
body:has([data-accounting-form][data-kind="waybills"])
#directory-selection[data-choice-kind="accounting-goods"][open] :is(th[data-column="unit"], th[data-column="country"], col:nth-child(2), col:nth-child(3), td:nth-child(2), td:nth-child(3)) { box-sizing:border-box; width:200px; min-width:200px; max-width:200px; }
body:has([data-accounting-form][data-kind="waybills"])
#directory-selection:is([data-choice-kind="accounting-customers"],[data-choice-kind="accounting-goods"])[open] .data-table { width:100%; min-width:570px; table-layout:fixed; }
body:has(form[data-opening-balances]) #directory-selection[data-choice-kind="opening-cash"] .data-table { table-layout:auto; width:100%; }
body:has(form[data-opening-balances]) #directory-selection[data-choice-kind="opening-cash"] :is(th,td):is(:nth-child(2),:nth-child(3)) { width:1%; min-width:0; white-space:nowrap; text-align:center; }
#directory-selection.crm-cashless-contract-choice { width:min(1000px,calc(100vw - 24px)); height:min(650px,calc(100dvh - 32px)); }
#directory-selection.crm-cashless-contract-choice [data-selection-list-panel],
#directory-selection.crm-cashless-contract-choice [data-directory-scroll] { width:100%; min-width:0; }
#directory-selection.crm-cashless-contract-choice .data-table { width:100%; min-width:0; table-layout:fixed; }
#directory-selection.crm-cashless-contract-choice th:last-child { width:140px; }
#directory-selection.crm-cashless-contract-choice td { white-space:normal; overflow-wrap:anywhere; }
#directory-selection.crm-cashless-contract-choice .search-field { min-width:0; flex:1; }
@media(max-width:600px) {
    #directory-selection.crm-cashless-contract-choice .directory-toolbar { flex-wrap:wrap; }
    #directory-selection.crm-cashless-contract-choice .search-field { flex-basis:100%; }
    #directory-selection.crm-cashless-contract-choice th:last-child { width:105px; }
}
/* Compact product references and a single-row recipient toolbar. */
#directory-selection.crm-product-reference-choice { width:min(760px,calc(100vw - 24px)); }
#directory-selection.crm-message-employee-choice .directory-toolbar { flex-wrap:nowrap; gap:10px; }
#directory-selection.crm-message-employee-choice .directory-toolbar>.button { flex-shrink:0; }
#directory-selection.crm-message-employee-choice .search-field { flex:1 1 0; width:auto; min-width:0; max-width:none; margin-inline:0; }
#directory-selection.crm-product-reference-choice .search-field { flex:1 1 240px; width:auto; min-width:0; max-width:100%; }
/* employee-reference-dialog-width */
body:has(#employee-form) #directory-selection[data-choice-kind="positions"],
body:has(#employee-form) #directory-selection[data-choice-kind="work-bases"] { width: min(1200px, calc(100vw - 32px)) !important; max-width: calc(100vw - 32px) !important; min-width: 0 !important; box-sizing: border-box; margin: auto; }
body:has(#employee-form) #directory-selection:is([data-choice-kind="positions"], [data-choice-kind="work-bases"]) .directory-toolbar { flex-wrap: wrap; }
body:has(#employee-form) #directory-selection:is([data-choice-kind="positions"], [data-choice-kind="work-bases"]) .search-field { flex: 1 1 220px; min-width: 0; max-width: 100%; }
/* orders-update-20261019 */
.order-list-information { display:block; }
#directory-selection[data-choice-kind="order-customer_id"] [data-directory-confirm] { order:1; }
#directory-selection[data-choice-kind="order-customer_id"] [data-directory-add] { order:2; }
#directory-selection[data-choice-kind="order-customer_id"] .search-field { order:3; }
#directory-selection[data-choice-kind="order-customer_id"][open] .data-table { min-width:650px; }
#directory-selection[data-choice-kind="order-customer_id"][open] th[data-column="phone"] { box-sizing:border-box; width:200px; }
#directory-selection[data-choice-kind="order-customer_id"][open] th:is([data-column="card_number"],[data-column="unp"]) { box-sizing:border-box; width:150px; }
#directory-selection[data-choice-kind="order-recipient_id"][open] .data-table { table-layout:auto; }
#directory-selection[data-choice-kind="order-recipient_id"][open] th[data-column="phone"] { box-sizing:border-box; width:200px; min-width:200px; }
#directory-selection[data-choice-kind="order-recipient_id"][open] th[data-column="no_phone"] { width:1%; white-space:nowrap; }
#directory-selection[data-choice-kind="order-recipient_id"][open] th[data-column="no_phone"] button { white-space:nowrap; }
.recipient-phone-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:14px; }
.recipient-phone-row .checkbox-row { margin:0; }
/* order-party-add-button */
#directory-selection:is([data-choice-kind="order-customer_id"],[data-choice-kind="order-contact_id"]) [data-directory-confirm] { order:1; }
#directory-selection:is([data-choice-kind="order-customer_id"],[data-choice-kind="order-contact_id"]) [data-directory-add] { order:2; }
#directory-selection:is([data-choice-kind="order-customer_id"],[data-choice-kind="order-contact_id"]) .search-field { order:3; }
/* crm-20261019-evening-v1 */
#directory-selection:is([data-choice-kind="order-contact_id"],[data-choice-kind="order-recipient_id"],[data-choice-kind="order-address_id"]) { width:min(820px,calc(100vw - 24px)); }
#directory-selection:is([data-choice-kind="order-contact_id"],[data-choice-kind="order-recipient_id"],[data-choice-kind="order-address_id"]) .data-table,
body:has([data-goods-receipt-form]) #directory-selection[data-choice-kind="cashless-goods"] .data-table { width:100%; min-width:0; table-layout:fixed; }
#directory-selection:is([data-choice-kind="order-contact_id"],[data-choice-kind="order-recipient_id"],[data-choice-kind="order-address_id"]) :is(td,th),
body:has([data-goods-receipt-form]) #directory-selection[data-choice-kind="cashless-goods"] :is(td,th) { white-space:normal; overflow-wrap:anywhere; }
#directory-selection:is([data-choice-kind="order-contact_id"],[data-choice-kind="order-recipient_id"],[data-choice-kind="order-address_id"]) .directory-toolbar { flex-wrap:wrap; gap:8px; }
#directory-selection:is([data-choice-kind="order-contact_id"],[data-choice-kind="order-recipient_id"],[data-choice-kind="order-address_id"]) .search-field { flex:1 1 220px; min-width:150px; width:auto; }
/* crm-20261019-orders-sale-v1 */
.order-header [data-order-wrap="courier_id"] { flex:0 1 300px; width:300px; max-width:100%; }
@media(max-width:600px) {
    .order-header [data-order-wrap="courier_id"] { flex:1 1 260px; width:100%; }
}
.order-list-information { min-width:100px; max-width:220px; white-space:pre-wrap; overflow-wrap:anywhere; }
.data-table th:has([data-sort-key="information"]) { width:180px; min-width:100px; max-width:220px; }
.data-table td[data-order-information] { width:180px; max-width:220px; white-space:normal; }
.data-table td[data-order-information="filled"] { background-color:#fff0b3!important; color:#342400; }
.data-table tr.is-selected td[data-order-information="filled"] { background-color:#f6df86!important; }
:where([data-sale-form]) > .form-toolbar .sale-total { margin-left:auto; }
.sale-total[data-payment-state="paid"] { background:#dcefdc; color:#20552b; }
.sale-total[data-payment-state="due"] { background:#fff0b3; color:#342400; }
.sale-total[data-payment-state="overpaid"] { background:#dcebf8; color:#244964; }
.sale-total [hidden] { display:none!important; }
/* crm-20261019-message-read-v1 */

/* stock-pickers-20261020 */
#directory-selection[data-choice-kind="price-groups"] { width:min(700px,calc(100vw - 24px)); }
body:has([data-opening-form][action*="/receipts"])
#directory-selection[data-choice-kind="opening-goods"] { width:min(1000px,calc(100vw - 24px)); }
body:has([data-opening-form][action*="/receipts"])
#directory-selection[data-choice-kind="suppliers"] { width:min(900px,calc(100vw - 24px)); }
#directory-selection[data-choice-kind="price-groups"] .search-field,
body:has([data-opening-form][action*="/receipts"])
#directory-selection:is([data-choice-kind="opening-goods"],[data-choice-kind="suppliers"]) .search-field { flex:1 1 220px; min-width:120px; width:auto; }
#directory-selection[data-choice-kind="price-groups"] .data-table,
body:has([data-opening-form][action*="/receipts"])
#directory-selection:is([data-choice-kind="opening-goods"],[data-choice-kind="suppliers"]) .data-table { width:100%; min-width:0; table-layout:fixed; }
body:has([data-opening-form][action*="/receipts"])
#directory-selection:is([data-choice-kind="opening-goods"],[data-choice-kind="suppliers"]) td { white-space:normal; overflow-wrap:anywhere; }
[data-stock-product-card="1"]>.form-toolbar { display:flex; flex-wrap:nowrap; gap:8px; overflow-x:auto; }
[data-stock-product-card="1"]>.form-toolbar>.button { flex:0 0 auto; white-space:nowrap; padding-inline:12px; }
/* compact-product-pickers-20261020 */
#directory-selection[data-choice-kind="sale-products"] .directory-toolbar,
#directory-selection[data-choice-kind="order-product"] .directory-toolbar,
#directory-selection[data-choice-kind="showcase-goods"] .directory-toolbar,
#directory-selection[data-choice-kind="showcase-scrap"] .directory-toolbar,
#directory-selection[data-choice-kind="rose-source"] .directory-toolbar,
#directory-selection[data-choice-kind="transfer-product"] .directory-toolbar,
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] .directory-toolbar { display:flex; flex-wrap:wrap; gap:10px; }
#directory-selection[data-choice-kind="sale-products"] .search-field,
#directory-selection[data-choice-kind="order-product"] .search-field,
#directory-selection[data-choice-kind="showcase-goods"] .search-field,
#directory-selection[data-choice-kind="showcase-scrap"] .search-field,
#directory-selection[data-choice-kind="rose-source"] .search-field,
#directory-selection[data-choice-kind="transfer-product"] .search-field,
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] .search-field { flex:1 1 260px; width:auto; min-width:120px; max-width:600px; margin-left:auto; }
#directory-selection[data-choice-kind="sale-products"] [data-selection-list-panel],
#directory-selection[data-choice-kind="order-product"] [data-selection-list-panel],
#directory-selection[data-choice-kind="showcase-goods"] [data-selection-list-panel],
#directory-selection[data-choice-kind="showcase-scrap"] [data-selection-list-panel],
#directory-selection[data-choice-kind="rose-source"] [data-selection-list-panel],
#directory-selection[data-choice-kind="transfer-product"] [data-selection-list-panel],
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] [data-selection-list-panel] { width:100%; min-width:0; }
#directory-selection[data-choice-kind="sale-products"] [data-directory-scroll],
#directory-selection[data-choice-kind="order-product"] [data-directory-scroll],
#directory-selection[data-choice-kind="showcase-goods"] [data-directory-scroll],
#directory-selection[data-choice-kind="showcase-scrap"] [data-directory-scroll],
#directory-selection[data-choice-kind="rose-source"] [data-directory-scroll],
#directory-selection[data-choice-kind="transfer-product"] [data-directory-scroll],
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] [data-directory-scroll] { width:100%; min-width:0; }
#directory-selection[data-choice-kind="sale-products"] .data-table,
#directory-selection[data-choice-kind="order-product"] .data-table,
#directory-selection[data-choice-kind="showcase-goods"] .data-table,
#directory-selection[data-choice-kind="showcase-scrap"] .data-table,
#directory-selection[data-choice-kind="rose-source"] .data-table,
#directory-selection[data-choice-kind="transfer-product"] .data-table,
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] .data-table { width:100%; min-width:0; table-layout:fixed; }
#directory-selection[data-choice-kind="sale-products"] .data-table th,
#directory-selection[data-choice-kind="order-product"] .data-table th,
#directory-selection[data-choice-kind="showcase-goods"] .data-table th,
#directory-selection[data-choice-kind="showcase-scrap"] .data-table th,
#directory-selection[data-choice-kind="rose-source"] .data-table th,
#directory-selection[data-choice-kind="transfer-product"] .data-table th,
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] .data-table th { white-space:normal; overflow-wrap:anywhere; }
#directory-selection[data-choice-kind="sale-products"] .data-table td,
#directory-selection[data-choice-kind="order-product"] .data-table td,
#directory-selection[data-choice-kind="showcase-goods"] .data-table td,
#directory-selection[data-choice-kind="showcase-scrap"] .data-table td,
#directory-selection[data-choice-kind="rose-source"] .data-table td,
#directory-selection[data-choice-kind="transfer-product"] .data-table td,
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] .data-table td { white-space:normal; overflow-wrap:anywhere; }
#directory-selection[data-choice-kind="sale-products"] th[data-column="name"],
#directory-selection[data-choice-kind="order-product"] th[data-column="name"],
#directory-selection[data-choice-kind="showcase-goods"] th[data-column="name"],
#directory-selection[data-choice-kind="showcase-scrap"] th[data-column="name"],
#directory-selection[data-choice-kind="rose-source"] th[data-column="name"],
#directory-selection[data-choice-kind="transfer-product"] th[data-column="name"],
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] th[data-column="name"] { width:auto; }
#directory-selection[data-choice-kind="sale-products"] .crm-thumbnail-cell,
#directory-selection[data-choice-kind="order-product"] .crm-thumbnail-cell,
#directory-selection[data-choice-kind="showcase-goods"] .crm-thumbnail-cell,
#directory-selection[data-choice-kind="showcase-scrap"] .crm-thumbnail-cell,
#directory-selection[data-choice-kind="rose-source"] .crm-thumbnail-cell,
#directory-selection[data-choice-kind="transfer-product"] .crm-thumbnail-cell,
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] .crm-thumbnail-cell { width:48px; }
#directory-selection[data-choice-kind="sale-products"] th[data-column="sku"],
#directory-selection[data-choice-kind="order-product"] th[data-column="sku"],
#directory-selection[data-choice-kind="showcase-goods"] th[data-column="sku"],
#directory-selection[data-choice-kind="showcase-scrap"] th[data-column="sku"],
#directory-selection[data-choice-kind="rose-source"] th[data-column="sku"],
#directory-selection[data-choice-kind="transfer-product"] th[data-column="sku"],
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] th[data-column="sku"] { width:90px; }
#directory-selection[data-choice-kind="sale-products"] th[data-column="country"],
#directory-selection[data-choice-kind="order-product"] th[data-column="country"],
#directory-selection[data-choice-kind="showcase-goods"] th[data-column="country"],
#directory-selection[data-choice-kind="showcase-scrap"] th[data-column="country"],
#directory-selection[data-choice-kind="rose-source"] th[data-column="country"],
#directory-selection[data-choice-kind="transfer-product"] th[data-column="country"],
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] th[data-column="country"] { width:110px; }
#directory-selection[data-choice-kind="sale-products"] th[data-column="price_minor"],
#directory-selection[data-choice-kind="order-product"] th[data-column="price_minor"],
#directory-selection[data-choice-kind="showcase-goods"] th[data-column="price_minor"],
#directory-selection[data-choice-kind="showcase-scrap"] th[data-column="price_minor"],
#directory-selection[data-choice-kind="rose-source"] th[data-column="price_minor"],
#directory-selection[data-choice-kind="transfer-product"] th[data-column="price_minor"],
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] th[data-column="price_minor"] { width:110px; }
#directory-selection[data-choice-kind="sale-products"] th[data-column="available"],
#directory-selection[data-choice-kind="order-product"] th[data-column="available"],
#directory-selection[data-choice-kind="showcase-goods"] th[data-column="available"],
#directory-selection[data-choice-kind="showcase-scrap"] th[data-column="available"],
#directory-selection[data-choice-kind="rose-source"] th[data-column="available"],
#directory-selection[data-choice-kind="transfer-product"] th[data-column="available"],
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] th[data-column="available"] { width:110px; }
/* CRM UI block 7: compact desktop orders, one row per document. */
.crm-current-orders-compact .crm-order-shop,
.crm-current-orders-compact .order-number-with-web { white-space:nowrap; }
.crm-current-orders-compact td { vertical-align:middle; }
.crm-current-orders-compact .crm-order-flags-cell { padding:0; min-width:150px; }
.crm-order-flags { display:grid; grid-template-columns:repeat(3,1fr); min-height:24px; border-bottom:1px solid #ddd; }
.crm-order-flags>span { padding:2px 6px; text-align:left; }
.crm-order-flags>span+span { border-left:1px solid #ddd; }
.crm-order-courier { padding:4px 8px; white-space:normal; min-height:24px; }
.crm-current-orders-compact .order-flag-column { width:50px; min-width:50px; }
.crm-current-orders-compact .crm-amount { white-space:nowrap; }
.crm-ui7-action { margin:12px 0; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
/* CV_CURRENT_ORDERS_WIDTHS_V2 */
.crm-current-orders-compact .crm-order-flags,
.crm-current-orders-compact .crm-order-flags > span,
.crm-current-orders-compact .crm-order-courier { border: 0 !important; }
.crm-current-orders-compact col.crm-amount-column,
.crm-current-orders-compact thead th:nth-child(n+10),
.crm-current-orders-compact tbody td.crm-amount { width: 1% !important; min-width: 0 !important; max-width: none !important; white-space: nowrap !important; }
.crm-current-orders-compact thead th:nth-child(n+10) .table-sort { white-space: nowrap !important; }
/* CV_ORDER_UI_REFINEMENTS_V3 */
.crm-current-orders-compact col:nth-child(5) { width: 32% !important; }
.crm-current-orders-compact th:nth-child(5),
.crm-current-orders-compact tbody tr[data-row-url] > td:nth-child(5) { min-width: 280px; white-space: normal; overflow-wrap: anywhere; }
/* CV_ORDER_COLUMNS_V4 */
table.data-table.crm-current-orders-compact { table-layout: auto !important; }
table.data-table.crm-current-orders-compact col:nth-child(4),
table.data-table.crm-current-orders-compact thead th:nth-child(4),
table.data-table.crm-current-orders-compact tbody tr[data-row-url] > td:nth-child(4) { width: 1% !important; min-width: 0 !important; max-width: none !important; white-space: nowrap !important; overflow-wrap: normal !important; word-break: normal !important; }
table.data-table.crm-current-orders-compact col:nth-child(5) { width: 32% !important; }
table.data-table.crm-current-orders-compact thead th:nth-child(5),
table.data-table.crm-current-orders-compact tbody tr[data-row-url] > td:nth-child(5) { min-width: 280px !important; max-width: none !important; white-space: normal !important; overflow-wrap: anywhere; }
table.data-table.crm-current-orders-compact .order-customer-phone { white-space: nowrap !important; }
/* Transfer form: contain the editor and keep group controls on one row. */
.transfer-document,
.transfer-document form,
.transfer-document .opening-pane { min-width:0; max-width:100%; width:100%; box-sizing:border-box; }
.transfer-document .transfer-details { display:flex; flex-wrap:wrap; width:100%; max-width:100%; gap:12px; align-items:center; }
.transfer-document .transfer-selection-row>.field-group { flex:0 1 240px; width:240px; min-width:180px; }
.transfer-document .transfer-selection-row>.checkbox-row { flex:0 0 auto; white-space:nowrap; }
.transfer-document + #selection-dialog:focus,
#collection-register-dialog:focus { outline: 0; }
.transfer-header > .opening-header {
    max-width: 100%;
}
.transfer-operation-row:not(:has([data-transfer-sent]:checked)) > .field-group:has(#courier_id),
.transfer-operation-row:not(:has([data-transfer-sent]:checked)) > .transfer-received,
.transfer-operation-row:not(:has(#courier_id-picker.has-value)) > .transfer-received {
    display: none;
}
body:has([data-defect-form]) #directory-selection[data-choice-kind="opening-goods"] th[data-column="available_quantity"] {
    --crm-list-column-width: 150px;
    box-sizing: border-box;
    width: var(--crm-list-column-width);
}
.transfer-document .transfer-operation-row>.field-group { flex:0 1 220px; width:220px; min-width:0; }
.transfer-document .transfer-operation-row>.field-group:has(#courier_id) { flex:0 1 320px; max-width:320px; width:320px; }
.transfer-document .table-scroll { width:100%; max-width:100%; min-width:0; overflow:auto; }
.transfer-document table.transfer-lines { table-layout:fixed; width:100%; min-width:650px; max-width:100%; }
.transfer-document table.transfer-lines .line-number { width:48px!important; min-width:48px!important; }
#directory-selection[data-choice-kind="transfer-product"][open] .data-table { min-width: 840px; }
.transfer-document table.transfer-lines :is(.line-sku, .line-country, .line-number-value, .crm-reference-cell),
#directory-selection[data-choice-kind="transfer-product"][open] :is(col.crm-reference-column, .crm-reference-cell, th[data-column="sku"], th[data-column="country"], th[data-column="ours"], th[data-column="theirs"]) {
    --crm-list-column-width: 150px;
    box-sizing: border-box;
    width: var(--crm-list-column-width);
    min-width: var(--crm-list-column-width);
    max-width: var(--crm-list-column-width);
}
.transfer-document table.transfer-lines td:nth-child(2) { white-space:normal; overflow-wrap:anywhere; }
.transfer-document .opening-choice,
.transfer-document .opening-choice-text { min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.transfer-document .opening-choice-button:disabled { display:none; }
@media(max-width:700px) {
    .transfer-document .transfer-selection-row>.field-group { flex-basis:100%!important; max-width:none; }
    .transfer-document .transfer-operation-row>.field-group { flex:1 1 180px; }
}
/* Order shop and number columns fit their contents. */
table.data-table.crm-current-orders-compact col:nth-child(2),
table.data-table.crm-current-orders-compact col:nth-child(3),
table.data-table.crm-current-orders-compact th:nth-child(2),
table.data-table.crm-current-orders-compact th:nth-child(3),
table.data-table.crm-current-orders-compact tbody tr[data-row-url]>td:nth-child(2),
table.data-table.crm-current-orders-compact tbody tr[data-row-url]>td:nth-child(3) { width:1%!important; min-width:0!important; max-width:none!important; white-space:nowrap!important; overflow-wrap:normal!important; }
#directory-selection[data-choice-kind="personnel-documents"] { box-sizing: border-box; width: min(1200px, calc(100vw - 24px)) !important; min-width: 0; max-width: calc(100vw - 24px); }
#directory-selection:is([data-choice-kind="positions"],[data-choice-kind="work-bases"]) { width: min(1200px, calc(100vw - 24px)) !important; box-sizing: border-box; max-width: none; }
#directory-create:is([data-create-kind="positions"],[data-create-kind="work-bases"]) { box-sizing: border-box; width: min(800px, calc(100vw - 24px)) !important; height: auto !important; min-height: 0 !important; max-height: calc(100dvh - 48px); inset: 24px 0 auto; margin: 0 auto; }
#directory-create:is([data-create-kind="positions"],[data-create-kind="work-bases"]) form { height: auto; min-height: 0; flex: 0 1 auto; }
/* crm-shops-organizations-20261122 */

/* Organization details and the organization's account list share the left column. */
.business-card:has(> form[data-kind="organizations"]) { display: block; width: min(760px, 100%); min-width: 0; align-self: flex-start; margin-inline: 0 auto; box-sizing: border-box; }
.business-card:has(> form[data-kind="organizations"]) > .business-related { width: 100%; box-sizing: border-box; }
dialog.business-frame-dialog.organization-account-create { inset: 24px 0 auto; margin: 0 auto; padding: 0; width: min(800px, calc(100vw - 24px)); max-width: none; height: auto; max-height: calc(100dvh - 48px); box-sizing: border-box; }
dialog.business-frame-dialog.organization-account-create > iframe { display: block; width: 100%; flex: none; height: var(--account-form-height, 180px); max-height: calc(100dvh - 50px); }
.customer-card-flags { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: start; }
.customer-card-flags > .customer-discount-block { width: auto; min-width: 0; }
.customer-card-flags > .checkbox-row { min-height: 66px; white-space: nowrap; }
.customer-card-flags:has([data-customer-discount][hidden]) { grid-template-columns: auto minmax(0, 1fr); }
.business-card:has(> form[data-kind="discount-cards"][data-new-record="true"]) { box-sizing: border-box; width: min(800px, 100%); align-self: flex-start; }
.discount-card-issue-fields { display: grid; grid-template-columns: minmax(148px, 0.8fr) repeat(2, minmax(0, 1fr)); gap: 12px; }
.discount-card-issue-fields > * { min-width: 0; }
.business-list[data-business-kind="discount-cards"] td[data-column="owner_name"] { white-space: nowrap; }
@media (max-width: 580px) {
    .discount-card-issue-fields { grid-template-columns: minmax(0, 1fr); }
    .customer-card-flags { grid-template-columns: minmax(0, 1fr) auto; }
    .customer-card-flags > [data-blacklist-reason] { grid-column: 1 / -1; }
}
/* crm-customer-cards-layout-v1 */
:root { --crm-dialog-top: 30px; }
:root { --crm-product-picker-width: 1200px; }
#directory-selection.crm-product-choice[open],
dialog.business-frame-dialog.has-product-picker[open] { box-sizing: border-box; width: min(var(--crm-product-picker-width), calc(100vw - 24px)); min-width: 0; max-width: none; margin-inline: auto; }
html.crm-dialog-frame #directory-selection.crm-product-choice[open] { width: 100%; }
dialog.business-frame-dialog.has-product-picker[open] { padding: 0; border: 0; }
dialog.business-frame-dialog.has-product-picker[open] > :is(.business-frame-close, .business-frame-heading) { display: none; }
@media (max-width: 600px) {
    :root { --crm-dialog-top: 8px; }
}
/* A dialog in a modal iframe already starts at the outer dialog's offset. */
html.crm-dialog-frame { --crm-dialog-top: 0px; }
dialog[open]:is(.selection-dialog:not(.crm-order-history-wide), .order-temporal, .check-panel,
               .courier-payment, [data-order-parts-dialog], :has(input:not([type="hidden"]), select, textarea)) { top: var(--crm-dialog-top) !important; bottom: auto !important; margin-top: 0 !important; margin-bottom: 0 !important; }
dialog[open]:is(.directory-selection, .business-frame-dialog, .courier-payment) { max-height: calc(100dvh - var(--crm-dialog-top) - 8px); }
dialog.check-panel[open] { height:calc(100dvh - 2 * var(--crm-dialog-top)); max-height:none; overflow-y:auto; }
dialog.business-frame-dialog.compact-business-form { box-sizing: border-box; width: min(800px, calc(100vw - 24px)); max-width: none; height: auto; min-height: 0; padding: 0; margin-inline: auto; }
dialog.business-frame-dialog.compact-business-form > iframe { flex: none; width: 100%; height: var(--business-content-height, 320px); max-height: calc(100dvh - var(--crm-dialog-top) - 10px); }
dialog.business-frame-dialog.compact-business-form.has-inner-dialog > iframe { height: calc(100dvh - var(--crm-dialog-top) - 10px); }
.business-card:has(> form:is([data-kind="discount-cards"], [data-kind="accounts"])) { box-sizing: border-box; width: min(800px, 100%); align-self: flex-start; }
.customer-card-flags { grid-template-columns: calc((100% - 14px) / 2) auto minmax(0, 1fr); column-gap: 14px; }
.customer-card-flags > .checkbox-row { align-items: center; }
.discount-card-issue-fields > .field-group:has([data-discount-card-number]),
.discount-card-issue-fields > .field-group:has([name="issued_on"]) { grid-column: 1; }
.discount-card-issue-fields > [data-discount-card-number-error] { grid-column: 1 / -1; margin: 0; }
@media (max-width: 650px) {
    .customer-card-flags,
    .customer-card-flags:has([data-customer-discount][hidden]) { grid-template-columns: auto minmax(0, 1fr); }
    .customer-card-flags > .customer-discount-block { grid-column: 1 / -1; }
    .customer-card-flags > [data-blacklist-reason] { grid-column: 2; }
}
/* crm-customer-dialogs-v2 */
.customer-card-column .customer-type-row { display: flex; flex-wrap: wrap; align-items: center; }
.customer-type-row > .field-group { flex: 0 1 400px; width: 400px; max-width: 100%; }
.business-card:has(> form[data-kind="legal-contacts"]) { width: min(800px, 100%); box-sizing: border-box; align-self: flex-start; }
.customer-card-flags:has([data-customer-discount][hidden]):has([data-blacklist-flag][hidden]) { display: none; }
#directory-selection.crm-bank-choice[open],
dialog.business-frame-dialog.has-bank-picker[open] { --bank-gap: var(--crm-dialog-top, 30px); box-sizing: border-box; width: min(1200px, calc(100vw - 24px)); min-width: 0; max-width: none; height: calc(100dvh - var(--bank-gap) - var(--bank-gap)); min-height: 0; max-height: none; top: var(--bank-gap) !important; bottom: auto !important; margin: 0 auto; }
dialog.business-frame-dialog.has-bank-picker[open] { padding: 0; border: 0; }
dialog.business-frame-dialog.has-bank-picker[open] > :is(.business-frame-close, .business-frame-heading) { display: none; }
dialog.business-frame-dialog.has-bank-picker[open] > iframe { display: block; flex: 1 1 auto; width: 100%; height: 100%; max-height: none; }
html.crm-dialog-frame #directory-selection.crm-bank-choice[open] { width: 100%; height: 100dvh; top: 0 !important; }
.business-list[data-business-kind="recipients"] td:is([data-column="owner_name"], [data-column="name"]) [data-phone-number] { white-space: nowrap; }
@media (max-width: 600px) {
    #directory-selection.crm-bank-choice[open],
    dialog.business-frame-dialog.has-bank-picker[open] { --bank-gap: var(--crm-dialog-top, 8px); }
}
/* crm-contacts-recipients-v1 */

/* crm-customer-entry-v1 */

/* crm-directory-lists-v1 */

/* crm-directory-forms-nov23-v1 */

/* crm-card-transfer-contracts-v1 */

/* crm-cashless-entry-retail-v1 */

/* crm-waybill-goods-picker-v1 */

/* crm-cashless-lists-opening-v1 */

/* crm-opening-quantity-invoice-v1 */

/* crm-tables-150-shops-v1 */

/* crm-list-alignment-v1 */

/* crm-receipt-pickers-count-v1 */

/* crm-prices-roses-transfers-v1 */

/* crm-goods-receipts-defects-forms-v1 */

/* crm-cash-shift-fields-v1 */

/* crm-shift-shared-picker-v2 */
:where([data-crm-screen~="business-form"]) .organization-contacts { display:grid; grid-template-columns:minmax(0,1fr) 200px 200px; gap:12px; align-items:start; }
@media(max-width:950px) {
    :where([data-crm-screen~="business-form"]) .organization-contacts { grid-template-columns:minmax(0,1fr); }
    :where([data-crm-screen~="business-form"]) .organization-contacts .field-group:has(:is(#email,#website)) { width:min(200px,100%); }
}
/* Проверка рабочей вкладки */
html.crm-tab-checking body { visibility: hidden; }
html.crm-tab-blocked body > :not(#crm-tab-panel) { visibility: hidden !important; }
#crm-tab-panel { visibility: visible; position: fixed; inset: 0; margin: auto; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 28px; border: 0; border-radius: 14px; color: #16394e; background: #fff; box-shadow: 0 12px 50px #122e4633; }
#crm-tab-panel::backdrop { background: #e8ecef; }
#crm-tab-panel h2 { margin: 0 0 14px; font-size: 22px; line-height: 1.3; }
#crm-tab-panel p { margin: 0 0 20px; font-size: 16px; line-height: 1.5; }
#crm-tab-panel .crm-tab-actions { display: flex; flex-wrap: wrap; gap: 10px; }
#crm-tab-panel .button { white-space: normal; }
#crm-tab-notice { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 2147483000; max-width: min(600px, calc(100vw - 24px)); padding: 12px 18px; background: #fff5d8; color: #593f00; border-radius: 10px; box-shadow: 0 4px 18px #0002; }
@media(max-width:550px) {
    #crm-tab-panel { padding: 22px 18px; }
    #crm-tab-panel .button { width: 100%; min-height: 46px; }
}
/* Безналичные документы */
:where([data-crm-screen~="accounting"]) .accounting-document { overflow:auto!important; }
:where([data-crm-screen~="accounting"]) .accounting-document form { min-width:0; }
:where([data-crm-screen~="accounting"]) .accounting-columns { display:grid; gap:22px; }
:where([data-crm-screen~="accounting"]) .accounting-columns.is-waybill { grid-template-columns:minmax(360px,42%) minmax(0,1fr); }
:where([data-crm-screen~="accounting"]) .accounting-details fieldset { border:0; padding:0; margin:0; display:grid; gap:12px; min-width:0; }
:where([data-crm-screen~="accounting"]) .accounting-details { min-width:0; }
:where([data-crm-screen~="accounting"]) .accounting-header { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
:where([data-crm-screen~="accounting"]) .accounting-header>.field-group { flex:1 1 160px; min-width:0; }
:where([data-crm-screen~="accounting"]) .accounting-lines-area { min-width:0; }
:where([data-crm-screen~="accounting"]) .accounting-lines-area .directory-toolbar { margin:14px 0; }
:where([data-crm-screen~="accounting"]) .accounting-lines { table-layout:fixed; min-width:580px; }
:where([data-crm-screen~="accounting"]) .accounting-lines th:first-child { width:48px; }
:where([data-crm-screen~="accounting"]) .accounting-lines .amount-col { width:110px; text-align:right; }
:where([data-crm-screen~="accounting"]) .accounting-lines td { white-space:normal; overflow-wrap:anywhere; vertical-align:middle; }
:where([data-crm-screen~="accounting"]) .accounting-lines td .input { border:0; border-radius:0; box-shadow:none; background:transparent; width:100%; min-width:0; text-align:right; height:38px; font:inherit; }
:where([data-crm-screen~="accounting"]) .accounting-lines input:focus { outline:1px solid #888; outline-offset:-1px; }
:where([data-crm-screen~="accounting"]) .accounting-lines .choice-field { border:0; min-width:0; width:100%; border-radius:0; box-shadow:none; }
:where([data-crm-screen~="accounting"]) .accounting-lines .choice-value { white-space:normal; overflow-wrap:anywhere; }
:where([data-crm-screen~="accounting"]) .accounting-lines [data-field=payment_number] { text-align:left; }
:where([data-crm-screen~="accounting"]) .accounting-lines tfoot,
:where([data-crm-screen~="accounting"]) .accounting-lines .balance-row { font-weight:700; background:#f0f3f3; }
:where([data-crm-screen~="accounting"]) .accounting-statements .accounting-lines { min-width:950px; }
:where([data-crm-screen~="accounting"]) .accounting-lines .date-col { width:160px; }
:where([data-crm-screen~="accounting"]) .accounting-lines .number-col { width:100px; }
:where([data-crm-screen~="accounting"]) .accounting-lines .operation-col { width:120px; }
:where([data-crm-screen~="accounting"]) .accounting-document .table-scroll { max-height:none; overflow:auto; }
:where([data-crm-screen~="accounting"]) .accounting-document .document-link { background:transparent; border:0; color:inherit; text-align:left; font:inherit; padding:0; text-decoration:underline; }
:where([data-crm-screen~="accounting"]) .accounting-details>.field-hint { margin:0; }
:where([data-crm-screen~="accounting"]) .accounting-lines input[type=date] { text-align:left; }
:where([data-crm-screen~="accounting"]) .accounting-document .form-toolbar { flex-wrap:wrap; }
@media(max-width:1199px) {
    :where([data-crm-screen~="accounting"]) .accounting-columns.is-waybill { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:600px) {
    :where([data-crm-screen~="accounting"]) .accounting-header>.field-group { flex-basis:100%; }
    :where([data-crm-screen~="accounting"]) .accounting-header { gap:8px; }
    :where([data-crm-screen~="accounting"]) .accounting-columns { gap:12px; }
}
:where([data-crm-screen~="accounting"]) .accounting-header>.field-group:has(#number) { flex:0 0 120px; }
:where([data-crm-screen~="accounting"]) .accounting-header>.field-group:has(input[type=date]) { flex:0 0 200px; }
:where([data-crm-screen~="accounting"]) .accounting-header #number+label { top:10px; font-size:12px; }
:where([data-crm-screen~="accounting"]) .accounting-lines .balance-row th:first-child { width:auto; }
:where([data-crm-screen~="accounting"]) .accounting-details .field-group:has(#employee_name) { max-width:200px; }
@media(max-width:600px) {
    :where([data-crm-screen~="accounting"]) .accounting-header>.field-group:has(#number),
    :where([data-crm-screen~="accounting"]) .accounting-header>.field-group:has(input[type=date]) { flex:1 1 100%; }
}
:where([data-crm-screen~="accounting"]) .accounting-columns.is-waybill { align-items:stretch; }
:where([data-crm-screen~="accounting"]) .accounting-waybills .accounting-header>.field-group:has(#number) { flex:1 1 260px; min-width:260px; }
:where([data-crm-screen~="accounting"]) .accounting-header>.field-group:has(#document_on) { flex:0 0 200px; }
:where([data-crm-screen~="accounting"]) .accounting-shipment-row { display:grid; grid-template-columns:180px minmax(0,1fr); gap:12px; align-items:start; }
:where([data-crm-screen~="accounting"]) .accounting-shipment-row>[hidden] { display:none; }
:where([data-crm-screen~="accounting"]) .accounting-waybills .accounting-lines-area { display:flex; flex-direction:column; }
:where([data-crm-screen~="accounting"]) .accounting-waybills .accounting-lines-area>.crm-tab-content { flex:0 0 auto; }
:where([data-crm-screen~="accounting"]) .waybill-comment { border:0; padding:0; margin:12px 0 0; min-height:150px; flex:1; display:flex; flex-direction:column; }
:where([data-crm-screen~="accounting"]) .waybill-comment>.field-group,
:where([data-crm-screen~="accounting"]) .waybill-comment .form-field { display:flex; flex:1; min-height:0; }
:where([data-crm-screen~="accounting"]) .waybill-comment textarea { width:100%; height:100%; min-height:150px; resize:vertical; }
:where([data-crm-screen~="accounting"]) .accounting-acts .accounting-columns { max-width:100%; }
:where([data-crm-screen~="accounting"]) .accounting-acts .accounting-header>.field-group:has([data-picker="document_type"]) { flex:0 0 170px; }
:where([data-crm-screen~="accounting"]) .accounting-acts .accounting-header>.field-group:has(#number) { flex:0 0 260px; }
:where([data-crm-screen~="accounting"]) .accounting-acts .field-group:has(#amount) { width:100px; }
@media(max-width:1199px) {
    :where([data-crm-screen~="accounting"]) .accounting-acts .accounting-columns { width:100%; min-width:0; }
    :where([data-crm-screen~="accounting"]) .waybill-comment { min-height:180px; }
}
@media(max-width:600px) {
    :where([data-crm-screen~="accounting"]) .accounting-header>.field-group:has(#document_on),
    :where([data-crm-screen~="accounting"]) .accounting-waybills .accounting-header>.field-group:has(#number),
    :where([data-crm-screen~="accounting"]) .accounting-acts .accounting-header>.field-group:has(#number) { flex:1 1 100%; min-width:0; }
    :where([data-crm-screen~="accounting"]) .accounting-shipment-row { grid-template-columns:minmax(0,1fr); }
}
:where([data-crm-screen~="accounting"]) .accounting-lines tbody td.empty-state { padding:10px 15px; }
:where([data-crm-screen~="accounting"]) .accounting-acts>form { width:50%; min-width:600px; max-width:100%; }
:where([data-crm-screen~="accounting"]) .accounting-acts .accounting-columns { width:100%; min-width:0; }
@media(max-width:1199px) {
    :where([data-crm-screen~="accounting"]) .accounting-acts>form { width:100%; min-width:0; }
}
/* Widths of cashless requisites. */
:where([data-crm-screen~="accounting"]) .directory-page.accounting-acts .field-group:has(> #status),
:where([data-crm-screen~="accounting"]) .directory-page.accounting-acts .accounting-header>.field-group:has([data-picker="document_type"]),
:where([data-crm-screen~="accounting"]) .directory-page.accounting-acts .field-group:has(#amount) { width:200px; max-width:100%; flex:0 0 200px; }
@media(min-width:1400px) {
    :where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-columns.is-waybill { grid-template-columns:max-content minmax(0,1fr); gap:24px; }
    :where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-details { width:min-content; }
    :where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-header:first-child { width:max-content; grid-template-columns:240px 180px max-content max-content; }
}
@media(max-width:1399px) {
    :where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-details { width:auto; }
}
@media(max-width:600px) {
    :where([data-crm-screen~="accounting"]) .directory-page.accounting-acts .field-group:has(> #status),
    :where([data-crm-screen~="accounting"]) .directory-page.accounting-acts .accounting-header>.field-group:has([data-picker="document_type"]),
    :where([data-crm-screen~="accounting"]) .directory-page.accounting-acts .field-group:has(#amount) { width:100%; flex-basis:100%; }
}
/* Same width as posting status; compact header defines the left column. */
:where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-header:first-child { grid-template-columns:180px 180px max-content max-content; }
:where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-header:first-child>.field-group:has(#number) { width:180px; max-width:180px; min-width:0; flex-basis:180px; }
:where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills>form { display:flex; flex-direction:column; min-height:100%; min-width:0; }
:where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-columns { flex:1; align-items:stretch; }
:where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-lines-area { min-height:0; }
:where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .waybill-comment { flex:1; min-height:160px; margin-bottom:0; }
@media(max-width:600px) {
    :where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-header:first-child { grid-template-columns:minmax(0,1fr); }
    :where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-header:first-child>.field-group:has(#number) { max-width:100%; }
}
:where([data-crm-screen~="accounting"]) .accounting-waybills { display:flex; flex-direction:column; }
:where([data-crm-screen~="accounting"]) .accounting-waybills>form { flex:1; }
/* Act / incoming waybill comment fills remaining form height. */
:where([data-crm-screen~="accounting"]) .accounting-acts { display:flex; flex-direction:column; }
:where([data-crm-screen~="accounting"]) .accounting-acts>form { display:flex; flex-direction:column; flex:1; min-height:100%; gap:12px; }
:where([data-crm-screen~="accounting"]) .accounting-acts .form-toolbar { margin-bottom:0; }
:where([data-crm-screen~="accounting"]) .accounting-acts .accounting-columns { flex:1; display:flex; flex-direction:column; }
:where([data-crm-screen~="accounting"]) .accounting-acts .accounting-details { display:flex; flex-direction:column; flex:1; }
:where([data-crm-screen~="accounting"]) .accounting-acts .accounting-details>fieldset { display:flex; flex-direction:column; flex:1; }
:where([data-crm-screen~="accounting"]) .accounting-acts .accounting-details>fieldset>.field-group:has(#comment) { display:flex; flex-direction:column; flex:1; min-height:160px; }
:where([data-crm-screen~="accounting"]) .accounting-acts .form-field:has(#comment) { display:flex; flex:1; min-height:160px; }
:where([data-crm-screen~="accounting"]) .accounting-acts #comment { flex:1; height:100%; min-height:160px; resize:vertical; }
/* The amount field is in a vertical flex container. */
:where([data-crm-screen~="accounting"]) .directory-page.accounting-acts .accounting-details>fieldset>.field-group:has(#amount),
:where([data-crm-screen~="accounting"]) .directory-page.accounting-acts .accounting-details>fieldset>.field-group:has(> #status) { flex:0 0 auto; }
/* Match the invoice's 44:56 columns and responsive breakpoint. */
:where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-columns.is-waybill { grid-template-columns:minmax(0,44fr) minmax(0,56fr); gap:24px; }
:where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-details { width:auto; min-width:0; }
:where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-header:first-child { display:flex; flex-wrap:wrap; width:100%; gap:12px; align-items:center; }
:where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-header:first-child>.field-group { flex:0 1 180px; min-width:0; }
@media(max-width:1199px) {
    :where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-columns.is-waybill { grid-template-columns:minmax(0,1fr); gap:20px; }
}
@media(max-width:600px) {
    :where([data-crm-screen~="accounting"]) .directory-page.accounting-waybills .accounting-header:first-child>.field-group { flex:1 1 150px; max-width:100%; }
}
/* Справочники контрагентов */
/* Compact contact columns, with remaining width assigned to the person's name. */
:where([data-crm-screen~="business"]) .business-list[data-business-kind="customers"][data-embedded-list="false"] .customer-list-table { table-layout: auto; }
:where([data-crm-screen~="business"]) .business-list[data-business-kind="customers"][data-embedded-list="false"] .customer-list-table [data-column="name"] { width: auto; }
:where([data-crm-screen~="business"]) .business-list[data-business-kind="customers"][data-embedded-list="false"] .customer-list-table
:is([data-column="unp"], [data-column="card_number"], [data-column="phone"], [data-column="information"]) { box-sizing: border-box; width: var(--crm-customer-column-width, 200px); min-width: var(--crm-customer-column-width, 200px); max-width: var(--crm-customer-column-width, 200px); white-space: normal; overflow-wrap: anywhere; }
.customer-list-table :is([data-column="card_number"], [data-column="unp"]) { --crm-customer-column-width: 150px; }
:where([data-crm-screen~="business"]) .business-list[data-business-kind="customers"][data-embedded-list="false"] .customer-list-table [data-column="party_flags"] { width: 1%; min-width: 0; white-space: nowrap; }
:where([data-crm-screen~="business"]) .business-list[data-business-kind="customers"] .customer-list-table th[data-column="party_flags"] .table-sort { white-space: nowrap; }
:where([data-crm-screen~="business"]) .business-list[data-business-kind="legal-contacts"] .data-table { table-layout:auto!important; }
:where([data-crm-screen~="business"]) .business-list[data-business-kind="legal-contacts"] [data-column="contact_kind"],
:where([data-crm-screen~="business"]) .business-list[data-business-kind="legal-contacts"] [data-column="phone"],
:where([data-crm-screen~="business"]) .business-list[data-business-kind="legal-contacts"] [data-column="email"] { width:1%!important; min-width:0!important; white-space:nowrap!important; }
:where([data-crm-screen~="business"]) .business-list[data-business-kind="legal-contacts"] [data-column="fio"] { width:auto!important; }
:where([data-crm-screen~="business"]) .business-list[data-business-kind="accounts"] [data-column="number"] { white-space:nowrap; min-width:290px; }
:where([data-crm-screen~="business"]) .business-list[data-business-kind="accounts"][data-embedded-list="false"] .data-table { table-layout:auto; }
:where([data-crm-screen~="business"]) .business-list[data-business-kind="accounts"][data-embedded-list="false"] :is(th,td):is([data-column="number"],[data-column="bank_name"],[data-column="branch_name"]) { width:1%; min-width:0; white-space:nowrap; overflow-wrap:normal; }
:where([data-crm-screen~="business"]) .customer-postal-match { grid-column:1/-1; }
/* crm-cashless-lists-opening-v1 */

/* crm-opening-entry-customers-v1 */
/* Договоры */
/* Contract fields in the left half of the workspace. */
:where([data-crm-screen~="contract"]) .contract-document .contract-content { width:calc((100% - 14px)/2); max-width:100%; gap:16px; }
:where([data-crm-screen~="contract"]) .contract-document .contract-header,
:where([data-crm-screen~="contract"]) .contract-document .contract-fields { flex-wrap:wrap; }
:where([data-crm-screen~="contract"]) .contract-document .contract-flags { width:100%; flex:none; }
:where([data-crm-screen~="contract"]) .contract-document .contract-body-fields,
:where([data-crm-screen~="contract"]) .contract-document .contract-details { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; align-items:start; flex:none; }
:where([data-crm-screen~="contract"]) .contract-document .contract-body-fields>* { min-width:0; width:100%; }
:where([data-crm-screen~="contract"]) .contract-document .contract-details>.field-group { min-width:0; width:100%; }
:where([data-crm-screen~="contract"]) .contract-document .contract-details textarea { min-height:160px; }
:where([data-crm-screen~="contract"]) .contract-document .contract-details>.field-group:has(#comment),
:where([data-crm-screen~="contract"]) .contract-document .contract-details .form-field:has(#comment) { min-height:0; }
@media(max-width:700px) {
    :where([data-crm-screen~="contract"]) .contract-document .contract-body-fields,
    :where([data-crm-screen~="contract"]) .contract-document .contract-details { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:1000px) {
    :where([data-crm-screen~="contract"]) .contract-document .contract-content { width:100%; }
}
/* Paired fields inside the left column. */
:where([data-crm-screen~="contract"]) .contract-document [data-contract-extra] { grid-template-columns:repeat(2,minmax(0,1fr)); }
:where([data-crm-screen~="contract"]) .contract-document [data-contract-print][disabled] { opacity:.5; cursor:not-allowed; }
:where([data-crm-screen~="contract"]) .contract-document .contract-information textarea { min-height:100px; }
@media(max-width:700px) {
    :where([data-crm-screen~="contract"]) .contract-document [data-contract-extra] { grid-template-columns:minmax(0,1fr); }
}
/* Match the amount field to the 120px document number field. */
:where([data-crm-screen~="contract"]) .contract-document .contract-body-fields [data-contract-amount] { width:120px; max-width:100%; }
:where([data-crm-screen~="contract"]) .contract-document .contract-content.contract-columns { display: grid; width: 100%; grid-template-columns: minmax(550px, 1fr) minmax(0, 1fr); align-items: stretch; gap: 24px; }
:where([data-crm-screen~="contract"]) .contract-main { display: grid; min-width: 0; align-content: start; gap: 16px; }
:where([data-crm-screen~="contract"]) .contract-number-date,
:where([data-crm-screen~="contract"]) .contract-type-row,
:where([data-crm-screen~="contract"]) .contract-comment { min-width: 0; min-inline-size: 0; margin: 0; padding: 0; border: 0; }
:where([data-crm-screen~="contract"]) .contract-number-date { display: grid; grid-template-columns: repeat(2, minmax(0, 200px)); gap: 14px; }
:where([data-crm-screen~="contract"]) .contract-number-date > .field-group { min-width: 0; }
:where([data-crm-screen~="contract"]) .contract-number-date .form-field #number + label { top: 10px; font-size: 12px; }
:where([data-crm-screen~="contract"]) .contract-type-row,
:where([data-crm-screen~="contract"]) .contract-type-flags { display: flex; align-items: center; gap: 14px; }
:where([data-crm-screen~="contract"]) .contract-type-row > .field-group { flex: 0 1 200px; min-width: 0; }
:where([data-crm-screen~="contract"]) .contract-type-flags { flex: none; }
:where([data-crm-screen~="contract"]) .contract-type-flags .checkbox-row { margin: 0; white-space: nowrap; }
:where([data-crm-screen~="contract"]) .contract-document .contract-comment,
:where([data-crm-screen~="contract"]) .contract-comment > .field-group,
:where([data-crm-screen~="contract"]) .contract-comment .form-field { display: flex; flex-direction: column; align-items: stretch; min-height: 0; }
:where([data-crm-screen~="contract"]) .contract-comment > .field-group,
:where([data-crm-screen~="contract"]) .contract-comment .form-field { flex: 1; }
:where([data-crm-screen~="contract"]) .contract-document .contract-comment #comment { flex: 1; height: auto; min-height: 160px; resize: none; }
@media (max-width: 1000px) {
    :where([data-crm-screen~="contract"]) .contract-document .contract-content.contract-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
    :where([data-crm-screen~="contract"]) .contract-type-row { flex-wrap: wrap; }
    :where([data-crm-screen~="contract"]) .contract-type-row > .field-group { flex: 1 1 130px; }
    :where([data-crm-screen~="contract"]) .contract-type-flags { flex-wrap: wrap; }
}
:where([data-crm-screen~="contract"]) .contract-document [data-contract-kind="customer"] [data-contract-amount] { width: 200px; max-width: 100%; }
/* crm-card-transfer-contracts-v1 */

/* crm-contract-invoice-entry-v1 */
/* Счета */
:where([data-crm-screen~="invoice"]) .invoice-list { margin-top:16px; }
:where([data-crm-screen~="invoice"]) .invoice-list .invoice-customer { white-space:normal; overflow-wrap:anywhere; min-width:200px; }
:where([data-crm-screen~="invoice"]) .invoice-document fieldset { border:0; padding:0; margin:0 0 16px; min-width:0; }
:where([data-crm-screen~="invoice"]) .invoice-header { display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
:where([data-crm-screen~="invoice"]) .invoice-parties { grid-template-columns:minmax(250px,1fr) auto minmax(250px,1fr); }
:where([data-crm-screen~="invoice"]) .invoice-terms { grid-template-columns:repeat(3,minmax(0,1fr)); }
:where([data-crm-screen~="invoice"]) .invoice-document [hidden] { display:none!important; }
:where([data-crm-screen~="invoice"]) .invoice-lines { table-layout:fixed; min-width:650px; }
:where([data-crm-screen~="invoice"]) .invoice-lines .choice-value { white-space:normal; overflow-wrap:anywhere; }
:where([data-crm-screen~="invoice"]) .invoice-lines td:nth-child(n+3),
:where([data-crm-screen~="invoice"]) .invoice-lines th:nth-child(n+3) { text-align:right; }
:where([data-crm-screen~="invoice"]) .invoice-lines input { width:100%; box-sizing:border-box; text-align:right; }
:where([data-crm-screen~="invoice"]) .invoice-document .form-toolbar { flex-wrap:wrap; }
:where([data-crm-screen~="invoice"]) .invoice-document .choice-field { width:100%; }
@media(max-width:760px) {
    :where([data-crm-screen~="invoice"]) .invoice-parties,
    :where([data-crm-screen~="invoice"]) .invoice-terms { grid-template-columns:1fr; }
    :where([data-crm-screen~="invoice"]) .invoice-header>.field-group { flex:1 1 150px; }
    :where([data-crm-screen~="invoice"]) .invoice-document { min-width:0; }
    :where([data-crm-screen~="invoice"]) .invoice-document .table-scroll { max-width:100%; overflow-x:auto; }
}
/* Invoice rows follow the common document layout. */
:where([data-crm-screen~="invoice"]) .invoice-parties,
:where([data-crm-screen~="invoice"]) .invoice-terms { display:flex; flex-direction:column; align-items:stretch; gap:16px; }
:where([data-crm-screen~="invoice"]) .invoice-contract-row { display:flex; gap:12px; align-items:center; }
:where([data-crm-screen~="invoice"]) .invoice-contract-row>[data-invoice-contract] { flex:1; min-width:0; }
:where([data-crm-screen~="invoice"]) .invoice-contract-row>.checkbox-row { flex:none; }
:where([data-crm-screen~="invoice"]) .invoice-delivery-row { display:grid; grid-template-columns:minmax(0,1fr) 200px; gap:12px; }
:where([data-crm-screen~="invoice"]) .invoice-without-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
:where([data-crm-screen~="invoice"]) .invoice-header>.field-group { width:200px; flex:0 0 200px; }
@media(max-width:760px) {
    :where([data-crm-screen~="invoice"]) .invoice-without-row { grid-template-columns:1fr; }
    :where([data-crm-screen~="invoice"]) .invoice-delivery-row { grid-template-columns:1fr; }
    :where([data-crm-screen~="invoice"]) .invoice-delivery-row>.field-group:last-child { width:200px; max-width:100%; }
    :where([data-crm-screen~="invoice"]) .invoice-contract-row { flex-wrap:wrap; }
    :where([data-crm-screen~="invoice"]) .invoice-contract-row>[data-invoice-contract] { flex-basis:100%; }
}
/* Desktop: requisites on the left, goods on the right. */
:where([data-crm-screen~="invoice"]) .invoice-columns { display:grid; grid-template-columns:minmax(0,44fr) minmax(0,56fr); gap:24px; align-items:start; }
:where([data-crm-screen~="invoice"]) .invoice-details-column,
:where([data-crm-screen~="invoice"]) .invoice-goods-column { min-width:0; }
:where([data-crm-screen~="invoice"]) .invoice-goods-column>.workspace-tabs { margin-top:0; }
:where([data-crm-screen~="invoice"]) .invoice-goods-column .table-scroll { max-width:100%; overflow-x:auto; }
:where([data-crm-screen~="invoice"]) .invoice-goods-column .invoice-lines td[colspan] { width:auto!important; white-space:normal; }
:where([data-crm-screen~="invoice"]) .invoice-details-column .choice-label { white-space:normal; }
@media(max-width:1199px) {
    :where([data-crm-screen~="invoice"]) .invoice-columns { grid-template-columns:minmax(0,1fr); gap:20px; }
}
:where([data-crm-screen~="invoice"]) .invoice-without-row { grid-template-columns:minmax(0,1fr); }
:where([data-crm-screen~="invoice"]) .invoice-list th[data-column="order_number"],
:where([data-crm-screen~="invoice"]) .invoice-list td[data-column="order_number"] { width:80px; min-width:80px; max-width:80px; white-space:normal; overflow-wrap:anywhere; }
:where([data-crm-screen~="invoice"]) .invoice-list th[data-column="released"],
:where([data-crm-screen~="invoice"]) .invoice-list td[data-column="released"] { width:45px; min-width:45px; }
:where([data-crm-screen~="invoice"]) .invoice-list th[data-column="customer_name"],
:where([data-crm-screen~="invoice"]) .invoice-list td.invoice-customer { white-space:normal; overflow-wrap:anywhere; }
/* Buyer has the remaining width; signer stays compact. */
:where([data-crm-screen~="invoice"]) .invoice-list .data-table { table-layout:auto; min-width:950px; }
:where([data-crm-screen~="invoice"]) .invoice-list th[data-column="customer_name"],
:where([data-crm-screen~="invoice"]) .invoice-list td.invoice-customer { width:auto; min-width:0; }
:where([data-crm-screen~="invoice"]) .invoice-list :is(th, td)[data-column="basis_label"] { width: 1%; white-space: nowrap; }
:where([data-crm-screen~="invoice"]) .invoice-list th[data-column="document_on"],
:where([data-crm-screen~="invoice"]) .invoice-list th[data-column="delivery_on"] { width:120px; }
:where([data-crm-screen~="invoice"]) .invoice-list th[data-column="amount_minor"] { width:145px; }
:where([data-crm-screen~="invoice"]) .invoice-document>form { display:flex; flex-direction:column; min-height:100%; min-width:0; }
:where([data-crm-screen~="invoice"]) .invoice-document .invoice-columns { flex:1; align-items:stretch; }
:where([data-crm-screen~="invoice"]) .invoice-details-column { display:flex; flex-direction:column; }
:where([data-crm-screen~="invoice"]) .invoice-document fieldset.invoice-comment { display:flex; flex:1; min-height:160px; margin-bottom:0; }
:where([data-crm-screen~="invoice"]) .invoice-comment>.field-group,
:where([data-crm-screen~="invoice"]) .invoice-comment .form-field { display:flex; flex:1; min-height:160px; }
:where([data-crm-screen~="invoice"]) .invoice-comment textarea { flex:1; width:100%; height:100%; min-height:160px; resize:vertical; }
:where([data-crm-screen~="invoice"]) .invoice-document { display:flex; flex-direction:column; }
:where([data-crm-screen~="invoice"]) .invoice-document>form { flex:1; }
:where([data-crm-screen~="invoice"]) #directory-selection[data-choice-kind="invoice-customers"][open] { box-sizing: border-box; width: min(1200px, calc(100vw - 24px)); max-width: none; min-width: 0; margin-inline: auto; }
:where([data-crm-screen~="invoice"]) #directory-selection[data-choice-kind="invoice-customers"] .data-table { table-layout: fixed !important; width: 100%; min-width: 510px; }
:where([data-crm-screen~="invoice"]) #directory-selection[data-choice-kind="invoice-customers"] th:is([data-column="phone"], [data-column="unp"]) { box-sizing: border-box; width: 150px; }
:where([data-crm-screen~="invoice"]) #directory-selection[data-choice-kind="invoice-customers"] td:first-child { overflow-wrap: anywhere; }
:where([data-crm-screen~="invoice"]) .invoice-document .form-field .crm-date-input > input:not([type="hidden"]) { flex: 1; min-width: 0; width: 0; }
:where([data-crm-screen~="invoice"]) .invoice-document .crm-date-button { margin-inline-end: 6px; }
/* crm-contract-invoice-entry-v1 */

/* crm-cashless-entry-retail-v1 */
/* Кабинет курьера */
:where([data-crm-screen~="courier"]) .courier-mobile { width:100%; max-width:1200px; margin:0 auto; overflow:auto; padding:4px 4px 24px; min-height:0; }
/* The workspace supplies the outer gutters on mobile. */
.courier-shift-prompt { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-block: 12px; }
.courier-shift-prompt p { margin: 0; }
.courier-shift-prompt .button { width: 100%; }
.courier-workspace :is(.button, .workspace-tab, .sidebar-link, .sidebar-logout) { min-height: 60px; }
.courier-shift-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.courier-shift-form p { margin: 0; }
.courier-opening-difference p { margin-bottom: 10px; }
.courier-shift-form .form-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; grid-auto-rows: 1fr; border: 0; margin: 0; padding: 0; }
.courier-shift-form .form-toolbar > .button { width: 100%; margin: 0; padding: 6px 12px; }
:where([data-crm-screen~="courier"]) .courier-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
:where([data-crm-screen~="courier"]) .courier-box { padding:16px; background:#fff; border-radius:12px; margin:12px 0; overflow-wrap:anywhere; }
:where([data-crm-screen~="courier"]) .courier-box h2 { font-size:18px; }
:where([data-crm-screen~="courier"]) .courier-box p { margin:10px 0; }
.courier-order-card {
    --order-stripe: #e69a16;
    --order-status-color: #995500;
    position: relative;
    min-width: 0;
    padding: 12px 14px;
    background: #fff;
    color: #19232b;
    border: 1px solid #a5afb5;
    border-inline-start: 5px solid var(--order-stripe);
    border-radius: 6px;
    overflow-wrap: anywhere;
}
.courier-order-card[data-payment="invoice"] { --order-stripe: #154780; --order-status-color: #154780; }
.courier-order-card[data-payment="paid"] { --order-stripe: #008480; --order-status-color: #00736f; }
.courier-order-heading, .courier-order-status { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.25; }
.courier-order-heading a, .courier-order-row a { color: inherit; text-decoration: none; }
.courier-order-heading a::after { content: ""; position: absolute; inset: 0; border-radius: 6px; }
.courier-order-heading a:focus-visible::after { outline: 2px solid #214c66; outline-offset: -2px; }
.courier-order-status { margin: 2px 0 8px; color: var(--order-status-color); }
.courier-order-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    margin-top: 3px;
    font-size: 16px;
    line-height: 1.35;
}
.courier-order-row .crm-icon { width: 19px; height: 19px; margin-top: 1px; }
.courier-order-row .phone-number { position: relative; z-index: 1; display: inline-block; }
.courier-order-row a:is(:hover, :focus-visible) { text-decoration: underline; }
.courier-order-comment { white-space: pre-line; }
.courier-delivery-tabs { display: grid; grid-template-columns: auto auto auto; align-items: stretch; justify-content: start; gap: 8px; margin: 0 0 12px; }
.courier-delivery-tabs .button { min-width: 0; }
.courier-order-form { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.courier-order-form > * { flex-shrink: 0; }
.courier-map-link { margin-top: 12px; }
.courier-form-section { min-width: 0; padding: 12px 14px; background: #fff; border: 1px solid var(--color-border); border-radius: 6px; overflow-wrap: anywhere; }
.courier-form-section h2, .courier-form-section summary, .courier-payment h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.courier-form-section summary { cursor: pointer; }
.courier-form-section form, .courier-payment form { display: grid; gap: 10px; margin-top: 10px; }
.courier-form-section p { margin: 6px 0; }
.courier-form-section .courier-items { min-width: 0; margin-top: 10px; width: 100%; }
.courier-items :is(th, td):last-child:not([colspan]) { width: 1%; white-space: nowrap; text-align: right; }
.courier-document-actions.form-toolbar { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 8px; border: 0; margin: 0; padding: 0; }
.courier-document-actions .button { width: 100%; height: 100%; min-width: 0; }
@media (max-width: 600px) {
    .courier-delivery-tabs { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 44px; }
    .courier-delivery-tabs .button { padding-inline: 4px; gap: 4px; }
    .courier-refresh span { display: none; }
    .courier-document-actions.form-toolbar { grid-auto-flow: row; }
}
:where([data-crm-screen~="courier"]) .courier-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:12px 0; }
:where([data-crm-screen~="courier"]) .courier-actions h1 { flex:1; font-size:22px; }
:where([data-crm-screen~="courier"]) .courier-mobile .button { white-space:normal; text-align:center; }
:where([data-crm-screen~="courier"]) .courier-mobile .field { display:flex; flex-direction:column; gap:7px; margin:14px 0; }
:where([data-crm-screen~="courier"]) .courier-mobile input:where(:not(.form-field input)),
:where([data-crm-screen~="courier"]) .courier-mobile select,
:where([data-crm-screen~="courier"]) .courier-mobile textarea:where(:not(.form-field textarea)) { font:inherit; width:100%; min-height:48px; border:1px solid #b9bdc4; border-radius:8px; padding:10px; box-sizing:border-box; color:#20242c; background:#fff; }
:where([data-crm-screen~="courier"]) .courier-mobile textarea:where(:not(.form-field textarea)):focus,
:where([data-crm-screen~="courier"]) .courier-mobile input:where(:not(.form-field input)):focus { outline:none; border:1px solid #596270; }
:where([data-crm-screen~="courier"]) .courier-total { display:block; font-size:22px; margin:16px 0; }
:where([data-crm-screen~="courier"]) .courier-payment { width: min(480px, calc(100% - 24px)); padding: 16px; margin-inline: auto; border: 1px solid var(--color-border); border-radius: 8px; box-sizing: border-box; color: var(--color-text); overflow: auto; }
:where([data-crm-screen~="courier"]) .courier-payment::backdrop { background: #18212c66; }
.courier-payment .courier-total { margin: 8px 0; }
.courier-payment .courier-document-actions { grid-auto-flow: row; }
:where([data-crm-screen~="courier"]) .courier-mobile select:focus { outline:none; }
@media(max-width:600px) {
    :where([data-crm-screen~="courier"]) .courier-mobile { padding:0 0 20px; }
    :where([data-crm-screen~="courier"]) .courier-box { padding:14px; }
    :where([data-crm-screen~="courier"]) .courier-actions .button { flex:1; }
    :where([data-crm-screen~="courier"]) .courier-actions form { flex:1; }
    :where([data-crm-screen~="courier"]) .courier-actions form .button { width:100%; }
    :where([data-crm-screen~="courier"]) .courier-mobile h1 { font-size:20px; }
}
@media (scripting: none) {
    html.crm-tab-checking body { visibility: visible; }
}
/* official-picker-button-order */
:where([data-crm-screen~="accounting-form"]) #directory-selection[data-choice-kind="accounting-officials"] [data-directory-confirm] { order: 0 !important; }
:where([data-crm-screen~="accounting-form"]) #directory-selection[data-choice-kind="accounting-officials"] [data-directory-add] { order: 1 !important; }
:where([data-crm-screen~="accounting-form"]) #directory-selection[data-choice-kind="accounting-officials"] .search-field { order: 2 !important; }
:where([data-crm-screen~="cash-registers-form"]) .cash-name-flags { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:12px; }
@media(max-width:550px) {
    :where([data-crm-screen~="cash-registers-form"]) .cash-name-flags { grid-template-columns:auto 1fr; }
    :where([data-crm-screen~="cash-registers-form"]) .cash-name-flags>.field-group { grid-column:1/-1; }
}
:where([data-crm-screen~="couriers-form"]) .courier-name-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:14px; }
:where([data-crm-screen~="couriers-form"]) .business-card:has([data-kind="couriers"]),
:where([data-crm-screen~="couriers-form"]) form[data-kind="couriers"],
:where([data-crm-screen~="couriers-form"]) form[data-kind="couriers"] fieldset,
:where([data-crm-screen~="couriers-form"]) form[data-kind="couriers"] .field-group:has(#comment),
:where([data-crm-screen~="couriers-form"]) form[data-kind="couriers"] .form-field:has(#comment) { flex:1; display:flex; flex-direction:column; }
:where([data-crm-screen~="couriers-form"]) form[data-kind="couriers"] #comment { flex:1; }
:where([data-crm-screen~="couriers-form"]) form[data-kind="couriers"] #employee_id-picker:has(.choice-value:not(:empty)) .choice-label { position:static; font-size:12px; }
:where([data-crm-screen~="couriers-form"]) .courier-contact-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; align-items:start; }
@media(max-width:620px) {
    :where([data-crm-screen~="couriers-form"]) .courier-contact-row { grid-template-columns:minmax(0,1fr); }
}
:where([data-crm-screen~="couriers-index"]) .directory-table-page .data-table th:last-child { width:1%; white-space:nowrap; }
:where([data-crm-screen~="employees-form"]) .employee-full-row,
:where([data-crm-screen~="employees-form"]) .employee-role-row { display:grid; gap:12px; align-items:start; }
:where([data-crm-screen~="employees-form"]) .employee-full-row { grid-template-columns:minmax(0,1fr) 200px; }
:where([data-crm-screen~="employees-form"]) .employee-role-row { grid-template-columns:200px repeat(2,minmax(0,1fr)); }
:where([data-crm-screen~="employees-form"]) .employee-fields .employee-contact-row { grid-template-columns:200px minmax(0,1fr) 200px; }
:where([data-crm-screen~="employees-form"]) .employee-document .employee-columns { flex:1 0 auto; align-items:stretch; }
:where([data-crm-screen~="employees-form"]) .employee-fields > .field-group:has(#employee_comment),
:where([data-crm-screen~="employees-form"]) .employee-fields .form-field:has(#employee_comment) { display:flex; flex:1; }
:where([data-crm-screen~="employees-form"]) .employee-fields #employee_comment { flex:1; }
@container (max-width:660px) {
    :where([data-crm-screen~="employees-form"]) .employee-fields .employee-contact-row,
    :where([data-crm-screen~="employees-form"]) .employee-full-row,
    :where([data-crm-screen~="employees-form"]) .employee-role-row { grid-template-columns:minmax(0,1fr); }
    :where([data-crm-screen~="employees-form"]) .employee-fields .field-group:has(:is(#employment_status,#pin_code,#role,#birth_date)) { width:min(200px,100%); }
}
:where([data-crm-screen~="history-order-versions"]) .order-versions { display:grid; grid-template-columns:minmax(160px,26%) minmax(0,1fr); padding:10px; }
:where([data-crm-screen~="history-order-versions"]) .order-versions nav a { display:block; padding:7px; border-bottom:1px solid #ddd; }
:where([data-crm-screen~="history-order-versions"]) .order-versions [aria-current] { background:#e7f3fa; }
:where([data-crm-screen~="history-order-versions"]) .order-versions table { width:100%; border-collapse:collapse; table-layout:fixed; }
:where([data-crm-screen~="history-order-versions"]) .order-versions th,
:where([data-crm-screen~="history-order-versions"]) .order-versions td { padding:6px; text-align:left; border-bottom:1px solid #ddd; overflow-wrap:anywhere; vertical-align:top; }
:where([data-crm-screen~="history-order-versions"]) .order-versions select { max-width:100%; }
:where([data-crm-screen~="history-order-versions"]) .order-versions form label { display:block; margin:5px 0; }
@media(max-width:650px) {
    :where([data-crm-screen~="history-order-versions"]) .order-versions nav { max-height:140px; overflow:auto; }
}
:where([data-crm-screen~="history-order-versions"]) .order-versions { grid-template-columns:minmax(205px,23%) minmax(0,1fr); gap:22px; }
:where([data-crm-screen~="history-order-versions"]) .order-versions nav a { padding:10px 12px; line-height:1.45; text-decoration:none; }
:where([data-crm-screen~="history-order-versions"]) .order-versions nav a[aria-current] { border-left:3px solid #276888; font-weight:700; }
:where([data-crm-screen~="history-order-versions"]) .order-versions form { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
:where([data-crm-screen~="history-order-versions"]) .order-versions th,
:where([data-crm-screen~="history-order-versions"]) .order-versions td { padding:9px 12px; line-height:1.4; }
:where([data-crm-screen~="history-order-versions"]) .order-versions thead th { background:#eef2f5; }
:where([data-crm-screen~="history-order-versions"]) .order-versions tbody th[colspan] { background:#f3f6f8; text-align:left; }
:where([data-crm-screen~="history-order-versions"]) .order-versions tbody td { font-weight:400; }
:where([data-crm-screen~="history-order-versions"]) .order-versions tbody td:first-child { font-weight:600; }
@media(max-width:650px) {
    :where([data-crm-screen~="history-order-versions"]) .order-versions { grid-template-columns:1fr; gap:10px; }
}
/* crm-hide-order-label */
:where([data-crm-screen~="orders-form"]) [data-order-label] { display:none!important; }
/* crm-product-movements-height */
@media screen and (min-width: 1024px) {
    section.product-movements { display: flex; flex-direction: column; box-sizing: border-box; height: calc(100dvh - 185px); min-height: 0; }
    section.product-movements > .table-scroll { flex: 1 1 0; min-height: 0; max-height: none; overflow: auto; }
    section.product-movements > .directory-toolbar { flex-shrink: 0; }
}
:where([data-crm-screen~="settings"]) .settings-page .settings-directory { padding-top: 0; }
:where([data-crm-screen~="settings"]) .settings-page .organization-summary .field-group:has(#organization_account) { grid-column: auto; }
:where([data-crm-screen~="settings"]) .cleanup-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--color-border,#b6bfc7); }
:where([data-crm-screen~="settings"]) .cleanup-actions:not(:has(.button)) { display: none; }
:where([data-crm-screen~="settings"]) .cleanup-actions .directory-button { width:min(100%,var(--settings-button-width,200px)); flex:0 0 auto; box-sizing:border-box; }
:where([data-crm-screen~="settings"]) .cleanup-actions .button--danger { background: #a93232; color: white; border-color: #a93232; }
/* settings-grouped-buttons-v1 */
:where([data-crm-screen~="settings"]) .settings-page .settings-directory { display: flex; flex-direction: column; gap: 8px; align-items: stretch; justify-content: flex-start; }
:where([data-crm-screen~="settings"]) .settings-page .settings-button-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
:where([data-crm-screen~="settings"]) .settings-page .settings-button-row .directory-button { width: 100%; min-width: 0; box-sizing: border-box; }
:where([data-crm-screen~="settings"]) .settings-page .settings-button-row:not(:has(.directory-button)) { display: none; }
@media (max-width: 1100px) {
    :where([data-crm-screen~="settings"]) .settings-page .settings-button-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    :where([data-crm-screen~="settings"]) .settings-page .settings-button-row { grid-template-columns: minmax(0, 1fr); }
}
/* positions-picker-single-row */
#directory-selection[data-choice-kind="positions"] .directory-toolbar { display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: 10px !important; }
#directory-selection[data-choice-kind="positions"] [data-directory-confirm] { order: 0 !important; flex: 0 0 auto !important; }
#directory-selection[data-choice-kind="positions"] [data-directory-add] { order: 1 !important; flex: 0 0 auto !important; }
#directory-selection[data-choice-kind="positions"] .search-field { order: 2 !important; flex: 1 1 0 !important; width: auto !important; min-width: 0 !important; max-width: none !important; margin: 0 !important; }
#directory-selection[data-choice-kind="positions"] .search-field input { width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
/* Фотографии в табличных частях */
table.data-table [data-line-photo] { width:54px; min-width:54px; max-width:54px; text-align:center; }
table.data-table td[data-line-photo] { padding:3px 6px; }
.cash-shift-required { max-width:620px; margin:12vh auto; text-align:center; }
.check-amount-warning { color:#b42318; }
.col-width-100 { width:100px; }
.col-width-150 { width:150px; }
.col-width-180 { width:180px; }
.col-width-220 { width:220px; }
.col-width-55 { width:55px; }
.courier-order-messages .courier-order-message { margin:0 0 8px; white-space:pre-wrap; overflow-wrap:anywhere; }
.courier-order-messages { width:100%; min-width:0; flex:none; box-sizing:border-box; max-height:220px; overflow:auto; }
.grid-full-width { grid-column:1/-1; }
.order-versions td.history-added { background:#e2f4e8; }
.data-table td.history-details-cell { padding:10px 16px 16px; white-space:normal; }
.history-field-grid { display:grid; grid-template-columns:minmax(100px,1fr) repeat(2,minmax(0,1.5fr)); gap:5px 14px; align-items:start; text-align:left; }
.order-versions td.history-removed { background:#ffebeb; }
.sales-today-filter { display:inline-flex; align-items:center; gap:.4rem; white-space:nowrap; }
.space-above { margin-top:16px; }
.text-multiline { white-space:pre-wrap; overflow-wrap:anywhere; }
.text-regular { font-weight:400; }
.text-wrap { overflow-wrap:anywhere; }
.form-toolbar.toolbar-centered { justify-content:center; }
dialog.business-frame-dialog.crm-order-history-wide { width:min(1360px, calc(100vw - 24px)); max-width:none; }
/* Печать страниц PDF */
.crm-pdf-preview__page canvas { max-width:100%; height:auto; }
.crm-print-pages,
.crm-print-pages body { page:crm-pdf; margin:0; padding:0; width:var(--crm-print-width); }
.crm-print-pages img { display:block; width:var(--crm-print-width); height:calc(var(--crm-print-height) - 0.75pt); object-fit:contain; margin:0; padding:0; break-inside:avoid; page-break-inside:avoid; }
.crm-print-pages img + img { break-before:page; page-break-before:always; }
@page crm-pdf { size:var(--crm-print-width) var(--crm-print-height); margin:0; }

/* crm-all-phone-limits-v1 */

/* crm-shift-toolbar-sms-v1 */

/* crm-login-phone-first-v1 */

/* crm-courier-shift-required-v1 */

/* crm-courier-opening-simple-v1 */

/* crm-courier-closing-simple-v1 */

/* crm-courier-order-cards-v1 */

/* crm-courier-delivery-screen-v1 */

/* crm-login-resend-layout-v1 */

/* crm-organization-account-rows-v1 */

/* crm-employee-pickers-courier-pin-v1 */

form[data-kind="legal-contacts"] .customer-contact-row > .checkbox-row { align-self: center; align-items: center; }

/* crm-legal-contact-kind-width-v1 */

/* crm-customer-list-card-unp-v1 */

.business-list[data-business-kind="discount-cards"][data-embedded-list="false"] .data-table
:is([data-column="number"], [data-column="issued_on"], [data-column="shop_name"], [data-column="employee_name"]) {
    --crm-list-column-width: 150px;
    box-sizing: border-box;
    width: var(--crm-list-column-width);
    min-width: var(--crm-list-column-width);
    max-width: var(--crm-list-column-width);
    overflow-wrap: anywhere;
}

/* crm-discount-card-list-toolbar-v1 */

/* crm-defect-transfer-form-v1 */

/* crm-transfer-dialog-outline-v1 */

/* crm-transfer-entry-goods-v1 */

/* crm-showcase-entry-v1 */

/* crm-showcase-list-widths-v1 */

/* crm-sales-list-picker-v1 */

/* crm-sale-picker-labels-v1 */

/* crm-sale-check-v1 */

/* crm-returns-quantity-check-view-v1 */

/* crm-order-entry-collection-v1 */

/* crm-order-fields-pickers-v1 */

/* crm-order-data-layout-v1 */

/* crm-order-delivery-row-v1 */

/* crm-order-stock-on-save-v1 */

/* crm-order-adaptive-columns-v1 */

/* crm-order-act-contracts-v1 */

/* crm-order-start-inventory-header-v1 */

/* crm-waybill-columns-order-v1 */
.task-header {display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:12px}
.task-header > .field-group {width:200px;max-width:100%}
.directory-page.accounting-acts .accounting-header > .checkbox-row:has([name="original"]) {align-self:center;display:inline-flex;align-items:center;margin-block:0}
.directory-page.accounting-acts .accounting-header > .checkbox-row [name="original"] {margin-block:0}

/* crm-director-tasks-forms-20261125 */
