/* ТК «Мой город» — CRM. Рассчитано на Chrome 109 / Firefox 115 (Windows 7): без :has, вложенности и color-mix. */
:root {
  --brand: #13614d;
  --brand-dark: #0d4638;
  --brand-deep: #0a2f26;
  --brand-soft: #e7f2ee;
  --accent: #f7bc13;
  --accent-soft: #fff6d6;
  --bg: #f2f4f6;
  --panel: #ffffff;
  --line: #e2e6ea;
  --line-strong: #cfd5db;
  --text: #1f2429;
  --muted: #6b737c;
  --faint: #9aa2aa;
  --danger: #c9372c;
  --danger-soft: #fdecea;
  --warn: #b7791f;
  --warn-soft: #fff4e0;
  --ok: #1f8a4c;
  --ok-soft: #e6f5ec;
  --info: #2764c5;
  --info-soft: #e8f0fc;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 1px 1px rgba(20, 30, 40, .04);
  --shadow-lg: 0 10px 30px rgba(20, 30, 40, .18);
  --sidebar: 232px;
  --font: "Segoe UI", Tahoma, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.45 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: Consolas, "Courier New", monospace; }
.hidden { display: none !important; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -4px; }
.ic.sm { width: 15px; height: 15px; vertical-align: -3px; }

/* ---------- каркас ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--brand-deep); color: #cfe3dc;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto;
}
.brand-logo { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo:hover { text-decoration: none; }
.brand-logo img { width: 128px; height: auto; display: block; }
.brand-logo span, .login-logo span { font-size: 11px; font-weight: 600; letter-spacing: 3px; color: #8fb8aa; }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 22px; }
.login-logo img { width: 150px; height: auto; display: block; }
.login-logo span { color: var(--muted); }
.nav { padding: 6px 10px 16px; flex: 1; }
.nav-group { margin: 14px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #6f9a8c; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: #cfe3dc;
  margin-bottom: 1px;
}
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav a.active { background: var(--brand); color: #fff; }
.nav .count {
  margin-left: auto; background: var(--accent); color: #3b2c00; font-size: 11px; font-weight: 700;
  border-radius: 10px; padding: 0 7px; line-height: 18px;
}
.sidebar-foot { padding: 12px 18px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #8fb8aa; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.search { position: relative; flex: 1 1 360px; max-width: 520px; }
.search .ic { position: absolute; left: 11px; top: 10px; color: var(--faint); }
.search input { padding-left: 36px; background: var(--bg); border-color: transparent; }
.search input:focus { background: #fff; }
.topbar .spacer { flex: 1 1 0; }
.user-chip { display: flex; align-items: center; gap: 10px; color: var(--text); }
.user-chip:hover { text-decoration: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.user-chip .who { line-height: 1.15; white-space: nowrap; }
.user-chip .who small { display: block; color: var(--muted); font-size: 11px; }
.content { padding: 22px 24px 40px; width: 100%; }

.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin-right: auto; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
/* заголовок с переключателем вида: переключатель стоит сразу за названием и не прыгает между видами */
.page-head .head-main { margin-right: auto; }
.page-head .title-row { display: flex; align-items: center; gap: 18px; }
.page-head .title-row h1 { margin-right: 0; }
.page-head .title-row + .sub { margin-top: 6px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text); font: 500 14px var(--font);
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: #f6f7f9; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.accent { background: var(--accent); border-color: #e0a800; color: #2f2300; }
.btn.accent:hover { background: #ffc933; }
.btn.danger { color: var(--danger); border-color: #efc2be; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.input {
  width: 100%; height: 36px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px;
  background: #fff; color: var(--text); font: 14px var(--font);
}
textarea.input { height: auto; min-height: 60px; resize: vertical; }
select.input { padding-right: 6px; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(19, 97, 77, .15); }
.input[readonly] { background: var(--bg); }
.check { width: 16px; height: 16px; accent-color: var(--brand); vertical-align: -3px; }
.file { font: 13px var(--font); max-width: 100%; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field .req { color: var(--danger); }
.field .help { font-size: 12px; color: var(--faint); margin-top: 3px; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 3px; }
.field.has-err .input { border-color: var(--danger); }
.field.checkbox { display: flex; align-items: center; gap: 8px; padding-top: 20px; }
.field.checkbox label.lbl { margin: 0; font-size: 14px; color: var(--text); font-weight: 400; }
.form-errors {
  background: var(--danger-soft); color: var(--danger); border-radius: 6px; padding: 10px 12px; margin-bottom: 14px;
}
.form-section { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600;
  margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); grid-column: 1 / -1; }
.form-section:first-child { margin-top: 0; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- панели ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.grid-2 > .panel + .panel { margin-top: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin-right: auto; }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.card-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 1fr); gap: 16px; align-items: start; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.warn { border-left: 3px solid var(--accent); }
.stat.bad { border-left: 3px solid var(--danger); }
.stat a { color: inherit; }

/* ---------- таблицы ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 12px;
  border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap;
}
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child b { white-space: nowrap; }
.table tbody tr:hover td { background: #fafcfb; }
.table tr.row-link { cursor: pointer; }
.table tfoot td { font-weight: 600; background: #fafbfc; border-top: 1px solid var(--line); }
.table .sub { font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.filters .input { width: auto; min-width: 140px; height: 32px; font-size: 13px; }
.filters .q { min-width: 240px; }
.filters .btn { height: 32px; }
.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 11px 12px 9px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.totals-bar { display: flex; gap: 22px; padding: 10px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); background: #fafbfc; flex-wrap: wrap; }
.totals-bar b { color: var(--text); font-variant-numeric: tabular-nums; }

.pager { display: flex; gap: 6px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.pager .info { margin-right: auto; color: var(--muted); }

/* ---------- значки ---------- */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; line-height: 18px; }
.st-expected { background: var(--accent-soft); color: #7a5800; }
.st-accepted { background: var(--info-soft); color: var(--info); }
.st-ready { background: #efe9fb; color: #6b3fc4; }
.st-shipped { background: #fff0e3; color: #c25a00; }
.st-delivered { background: #e3f4f6; color: #0e7c86; }
.st-issued { background: var(--ok-soft); color: var(--ok); }
.st-new { background: var(--info-soft); color: var(--info); }
.st-review { background: var(--warn-soft); color: var(--warn); }
.st-satisfied, .st-partial { background: var(--ok-soft); color: var(--ok); }
.st-rejected { background: #eef0f2; color: var(--muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: #eef0f2; color: var(--muted); white-space: nowrap; }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.yellow { background: var(--accent-soft); color: #7a5800; }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.blue { background: var(--info-soft); color: var(--info); }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; display: flex; gap: 10px; align-items: flex-start; }
.alert.success { background: var(--ok-soft); color: #145c33; }
.alert.error { background: var(--danger-soft); color: #8c2019; }
.alert.warning { background: var(--warn-soft); color: #7a4d0b; }
.alert.info { background: var(--info-soft); color: #1b4a94; }
.messages { margin-bottom: 14px; }

/* ---------- карточка ---------- */
.props { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 7px 14px; font-size: 14px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.card-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-title .num-big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.route { font-size: 15px; font-weight: 500; }
.route .arrow { color: var(--faint); margin: 0 6px; }
.status-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pipeline { display: flex; gap: 4px; margin: 14px 0 4px; }
.pipeline span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.pipeline span.done { background: var(--brand); }
.pipeline-labels { display: flex; gap: 4px; font-size: 11px; color: var(--muted); }
.pipeline-labels span { flex: 1; }
.kv-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv-row:last-child { border-bottom: 0; }
.kv-row.total { font-weight: 700; font-size: 15px; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo { position: relative; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #f5f6f7; }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; }
.photo .cap { font-size: 11px; padding: 4px 6px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo .flag { position: absolute; top: 6px; left: 6px; }
.photo form { position: absolute; top: 4px; right: 4px; }
.photo .del { width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; display: grid; place-items: center; }

/* ---------- лента ---------- */
.feed-form { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.feed-form textarea { min-height: 42px; }
.feed-form .btn-row { margin-top: 8px; justify-content: flex-end; }
.feed { list-style: none; margin: 0; padding: 4px 16px 12px; max-height: 760px; overflow-y: auto; }
.feed li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #eef0f2; color: var(--muted); }
.feed .dot.comment { background: var(--accent-soft); color: #7a5800; }
.feed .dot.create { background: var(--ok-soft); color: var(--ok); }
.feed .dot.status { background: var(--brand-soft); color: var(--brand); }
.feed .dot.delete { background: var(--danger-soft); color: var(--danger); }
.feed .body { min-width: 0; flex: 1; }
.feed .meta { font-size: 12px; color: var(--muted); }
.feed .what { font-weight: 600; font-size: 13px; }
.feed .text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.feed .changes { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; }
.feed .changes li { display: block; padding: 1px 0; border: 0; }
.feed .changes .old { color: var(--faint); text-decoration: line-through; }

/* ---------- доска ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { flex: 0 0 262px; background: #e9edf0; border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.col-head { padding: 10px 12px 8px; border-top: 3px solid var(--line-strong); border-radius: var(--radius) var(--radius) 0 0; }
.col-head .t { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.col-head .s { font-size: 12px; color: var(--muted); }
.col-expected .col-head { border-top-color: var(--accent); }
.col-accepted .col-head { border-top-color: var(--info); }
.col-ready .col-head { border-top-color: #6b3fc4; }
.col-shipped .col-head { border-top-color: #c25a00; }
.col-delivered .col-head { border-top-color: #0e7c86; }
.col-issued .col-head { border-top-color: var(--ok); }
.col-body { padding: 4px 8px 10px; overflow-y: auto; flex: 1; min-height: 80px; }
.col.drop-ok .col-body { background: rgba(19, 97, 77, .08); outline: 2px dashed var(--brand); outline-offset: -4px; border-radius: 6px; }
.col.drop-no { opacity: .55; }
.kcard { background: #fff; border-radius: 6px; padding: 9px 10px; margin-top: 6px; box-shadow: var(--shadow); border: 1px solid transparent; cursor: grab; }
.kcard:hover { border-color: var(--line-strong); }
.kcard.dragging { opacity: .5; }
.kcard .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.kcard .c { font-size: 13px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard .r { font-size: 12px; color: var(--muted); }
.kcard .tags { margin-top: 5px; display: flex; gap: 4px; flex-wrap: wrap; }
.col-more { font-size: 12px; color: var(--muted); text-align: center; padding: 8px; }

/* ---------- автоподбор клиента ---------- */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 2px; background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: var(--shadow-lg); z-index: 30; max-height: 320px; overflow-y: auto; }
.ac-item { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.active { background: var(--brand-soft); }
.ac-item .sub { font-size: 12px; color: var(--muted); }
.ac-item.new { color: var(--brand); font-weight: 600; }
.client-picked { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--brand); background: var(--brand-soft); border-radius: 6px; }
.client-picked .name { font-weight: 600; }
.client-picked .x { margin-left: auto; }

/* ---------- отправитель / получатель ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: #fff; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 16px; font-weight: 500; color: var(--muted); border-right: 1px solid var(--line); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--brand); color: #fff; }
.seg input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--accent); }
.party[data-kind="person"] .ip-only, .party[data-kind="person"] .company-only, .party[data-kind="person"] .biz-only { display: none; }
.party[data-kind="ip"] .person-only, .party[data-kind="ip"] .company-only { display: none; }
.party[data-kind="company"] .person-only, .party[data-kind="company"] .ip-only, .party[data-kind="company"] .not-company { display: none; }
.party .panel-head { flex-wrap: wrap; }
.party-found { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1.5px solid #3f8f5a; background: #eef8f1; border-radius: 8px; }
.pf-check { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #3f8f5a; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.pf-main { flex: 1; min-width: 0; }
.pf-label { font-size: 11px; font-weight: 600; color: #2f7a48; text-transform: uppercase; letter-spacing: .03em; }
.pf-name { font-weight: 700; font-size: 15px; }
.pf-actions { flex: none; display: flex; gap: 6px; }
.party-found .party-summary { margin-top: 2px; }
.ac-head { padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg-soft, #f5f6f8); border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.ac-name { font-weight: 600; }
.ac-kind { font-weight: 400; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 0 6px; margin-left: 4px; }
input::-webkit-contacts-auto-fill-button, input::-webkit-credentials-auto-fill-button { visibility: hidden; display: none !important; pointer-events: none; }
.same-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.inn-row { display: flex; gap: 6px; }
.inn-row .btn { height: 36px; flex: none; }
.inn-msg.bad { color: var(--danger); }
.inn-msg.good { color: var(--ok); }
.passport-row { display: flex; gap: 8px; }
.passport-row > .input { width: 90px; flex: none; }
.passport-row .grow { flex: 1; position: relative; }
.payer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.payer-row .lbl-inline { font-weight: 600; }
.payer-row .radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.payer-row .radio input { accent-color: var(--brand); }

.phrases { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line-strong); background: #fff; border-radius: 14px; padding: 3px 10px; font: 12px var(--font); color: var(--muted); cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }

.value-list { display: flex; flex-wrap: wrap; gap: 6px; }
.value-item { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line-strong); border-radius: 16px; padding: 1px 2px 1px 12px; background: #fafbfc; }
.value-item .btn { height: 24px; width: 24px; padding: 0; justify-content: center; border-radius: 50%; }

/* ---------- задачи и календарь ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.cal-nav h2 { margin: 0 auto 0 8px; min-width: 150px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); }
.cal-day { display: flex; flex-direction: column; gap: 3px; min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--text); overflow: hidden; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: #f7faf9; text-decoration: none; }
.cal-day.out { background: #fafbfc; }
.cal-day.out .cal-num { color: var(--faint); }
.cal-day.selected { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-soft); }
.cal-num { font-weight: 600; font-size: 13px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--brand); color: #fff; }
.cal-task { font-size: 11.5px; line-height: 1.25; padding: 2px 5px; border-radius: 4px; background: var(--info-soft); color: #1b4a94; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-task.done { background: #eef0f2; color: var(--faint); text-decoration: line-through; }
.cal-task.overdue { background: var(--danger-soft); color: #8c2019; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.quick-task { display: grid; gap: 8px; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.quick-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; }
.quick-task .btn { justify-self: start; }
.task-list { display: grid; gap: 2px; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; color: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; margin-top: 1px; }
.task .tick:hover { border-color: var(--brand); color: var(--brand); }
.task.done .tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.task-body { min-width: 0; flex: 1; }
.task-title { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.task.done .task-title { color: var(--faint); text-decoration: line-through; }
.task.overdue .sub { color: var(--danger); }
.task .sub { font-size: 12px; color: var(--muted); }
.task .sub > span + span::before { content: ' · '; }

.view-switch span { padding: 6px 14px; }
.task-board .col { flex: 1 1 240px; min-width: 230px; background: transparent; }
.task-board .col-head { border-top: 0; border-bottom: 3px solid var(--line-strong); text-align: center; border-radius: 0; text-transform: uppercase; font-size: 12px; letter-spacing: .5px; }
.task-board .col-head .t { justify-content: center; gap: 8px; }
.tcol-today .col-head { border-bottom-color: var(--brand); }
.tcol-overdue .col-head { border-bottom-color: var(--danger); color: var(--danger); }
.tcard { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); }
.tcard-body { color: var(--text); flex: 1; min-width: 0; }
.tcard-body:hover { text-decoration: none; }
.tcard .tdate { color: var(--info); font-size: 14px; margin: 1px 0; }
.tcol-overdue .tdate { color: var(--danger); }
.tcard .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; color: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; margin-top: 2px; }
.tcard .tick:hover { border-color: var(--brand); color: var(--brand); }

details.fold > summary { cursor: pointer; list-style: none; border-bottom: 0; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin-right: 10px; }
details.fold > summary h2::before { content: '▸ '; color: var(--faint); }
details.fold[open] > summary h2::before { content: '▾ '; }
details.fold[open] > summary { border-bottom: 1px solid var(--line); }
details.fold > summary .small { margin-right: auto; }
details.more { grid-column: 1 / -1; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 13px; margin: 4px 0 10px; }

.team-tabs { margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.team-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; min-width: 120px; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.progress.reached > span { background: var(--ok); }
.goal-num { font-weight: 600; white-space: nowrap; }
.goal-num.reached { color: var(--ok); }
.month-nav { display: inline-flex; align-items: center; gap: 8px; }
.month-nav b { min-width: 130px; text-align: center; font-size: 15px; }
.matrix-n { text-align: center; }
.table th.matrix-n { white-space: normal; padding-left: 6px; padding-right: 6px; }
.matrix-n.zero { color: var(--faint); }

.task.boss { border-left: 3px solid var(--danger); padding-left: 8px; background: var(--danger-soft); border-radius: 4px; }
.tcard.boss { border-left: 3px solid var(--danger); }
.check-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; cursor: pointer; }
.boss-panel { border: 1px solid var(--danger); border-left: 4px solid var(--danger); margin-bottom: 16px; }
.boss-panel > .panel-head { background: var(--danger-soft); }
.boss-panel > .panel-head h2 { color: var(--danger); display: flex; align-items: center; gap: 8px; }
.boss-task { display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.boss-task:last-child { border-bottom: 0; }
.boss-task .boss-body { flex: 1; min-width: 0; }
.boss-task .boss-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }

.an-filters { padding: 12px 14px; display: grid; gap: 10px; }
.an-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.an-row select.input { width: auto; max-width: 230px; }
.an-row .seg span { padding: 6px 12px; }
.table.wrap-first td:first-child b { white-space: normal; }
.table.wrap-first td, .table.wrap-first th { padding-left: 10px; padding-right: 10px; }
.progress.thin { height: 4px; margin-top: 5px; min-width: 0; }
.share { display: flex; align-items: center; gap: 8px; }
.share .progress { flex: 1; min-width: 36px; }
.share > span { width: 38px; text-align: right; color: var(--muted); font-size: 12px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; overflow-x: auto; }
.bars.days { gap: 3px; }
.bar { flex: 1 1 0; min-width: 18px; display: flex; flex-direction: column; align-items: stretch; height: 100%; }
.bar-n { font-size: 11px; text-align: center; color: var(--muted); height: 16px; }
.bar-col { flex: 1; display: flex; align-items: flex-end; }
.bar-col span { display: block; width: 100%; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-l { font-size: 11px; text-align: center; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.bar.weekend .bar-l { color: var(--danger); }
tr.selected td { background: var(--brand-soft); }

.fee-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 140px 34px; gap: 8px; align-items: center; margin-top: 6px; max-width: 640px; }
.fee-row .fee-label { color: var(--text); font-size: 14px; }
.fee-row.fixed .small { font-size: 12px; }

.close-zones { position: fixed; left: var(--sidebar); right: 0; bottom: 0; display: none; gap: 12px; padding: 12px 24px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line-strong); z-index: 40; }
.close-zones.show { display: flex; }
.close-zone { flex: 1; text-align: center; padding: 18px 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; font-size: 13px; border-top: 3px solid var(--line-strong); color: var(--muted); border-radius: 4px; }
.close-zone.fail { border-top-color: var(--danger); }
.close-zone.win { border-top-color: var(--ok); }
.close-zone.back { border-top-color: var(--warn); }
.close-zone.over.back { background: var(--warn-soft); color: var(--warn); }
.st-returned { background: var(--warn-soft); color: #7a4d0b; }
.close-zone.over.fail { background: var(--danger-soft); color: var(--danger); }
.close-zone.over.win { background: var(--ok-soft); color: var(--ok); }
.st-cancelled { background: #eceff1; color: #5b6570; }

.party-summary { color: var(--muted); font-size: 13px; margin-top: 6px; }

.dim-row { display: grid; grid-template-columns: minmax(120px, 1fr) 70px 14px 70px 14px 70px 14px 64px 80px 34px; gap: 6px; align-items: center; margin-top: 6px; }
.dim-row span { text-align: center; color: var(--muted); }
.dim-row .input { height: 32px; }

.trip-row { display: grid; grid-template-columns: 104px minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.3fr) 118px 104px 112px 112px 96px; gap: 10px; padding: 9px 14px; align-items: start; border-bottom: 1px solid var(--line); }
.no-money .trip-row { grid-template-columns: 104px minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.3fr) 118px 96px; }
.trip-row { min-width: 980px; }
.trip-row > span:last-child .badge { white-space: normal; line-height: 1.3; }  /* «Ожидается (в пути к нам)» переносится, а не уходит за край */
.trip-head { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; }
.trip-client > summary { cursor: pointer; list-style: none; }
.trip-client > summary::-webkit-details-marker { display: none; }
.trip-client > summary:hover, .trip-client[open] > summary { background: var(--brand-soft); }
.trip-more { padding: 10px 14px 14px 134px; border-bottom: 1px solid var(--line); background: #fcfdfd; }

.arrive-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--line); }

.trip-link { color: var(--text); text-decoration: none; cursor: pointer; }
.trip-link:hover { background: var(--brand-soft); text-decoration: none; }
.tab-n { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #3b2c00; font-size: 12px; font-weight: 600; text-align: center; }

.table.reg { font-size: 13px; }
.table.reg td, .table.reg th { padding: 6px 8px; }
.table.reg td { max-width: 260px; }

.table.reg td.strong { font-weight: 600; }
.reg-hint { padding: 8px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--line); font-size: 13px; }
.reg-editing td.cell { cursor: text; }
.reg-editing td.cell:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.reg-editing td.cell.on { padding: 2px; box-shadow: inset 0 0 0 2px var(--brand); background: #fff; }
.reg-editing td.cell input { width: 100%; min-width: 90px; height: 28px; border: 0; outline: 0; font: inherit; background: transparent; padding: 0 5px; }
.reg-editing td.cell.saved { background: var(--ok-soft); transition: background .6s; }
.reg-editing td.cell.failed { box-shadow: inset 0 0 0 2px var(--danger); }
.btn.active-mode { background: var(--brand); color: #fff; border-color: var(--brand); }

.table.reg tr.reg-station td { background: #dcecff; }
.table.reg tr.reg-done td { background: #fff3c4; }
.table.reg tr.reg-checked td { background: #dcf5e3; }  /* проверена, расходы внесены — вошла в отчёт */
.table.reg tr.reg-expected td { background: #fff; }
.table.reg tr.reg-ban td { background: #fde2e1; }  /* запрет на вывоз — красная строка поверх любого состояния */
.table.reg tr.reg-cancelled td { background: #f1f3f5; }
.table.reg tr.row-link:hover td { filter: brightness(.97); }
.legend { display: inline-block; padding: 1px 8px; border-radius: 4px; border: 1px solid var(--line-strong); font-size: 12px; color: var(--text); margin-left: 4px; }
.lg-station { background: #dcecff; } .lg-done { background: #fff3c4; } .lg-expected { background: #fff; } .lg-checked { background: #dcf5e3; }

/* реестр: шапка и первые колонки стоят на месте, таблица листается внутри своего окна */
.reg-wrap { max-height: calc(100vh - 250px); min-height: 260px; overflow: auto; position: relative; }
.reg-wrap .reg-hint { position: sticky; left: 0; top: 0; z-index: 4; }
.table.reg { border-collapse: separate; border-spacing: 0; }
.table.reg thead th { position: sticky; top: 0; z-index: 3; background: #f3f5f7; box-shadow: inset 0 -1px 0 var(--line-strong); }
.table.reg .pin { position: sticky; z-index: 2; }
.table.reg thead .pin { z-index: 5; }
.table.reg .pin-0 { left: 0; width: 30px; min-width: 30px; }
.table.reg .pin-1 { left: 30px; width: 52px; min-width: 52px; }
.table.reg .pin-2 { left: 82px; min-width: 130px; box-shadow: inset -1px 0 0 var(--line-strong); }
.table.reg td.pin-1, .table.reg td.pin-0 { background: #fff; }
.reg-wrap.reg-hinted .table.reg thead th { top: 0; }
.reg-wrap::-webkit-scrollbar { height: 14px; width: 12px; }
.reg-wrap::-webkit-scrollbar-thumb { background: #b9c1c9; border-radius: 7px; border: 3px solid #f3f5f7; }
.reg-wrap::-webkit-scrollbar-thumb:hover { background: #8d97a1; }
.reg-wrap::-webkit-scrollbar-track { background: #f3f5f7; }
.reg-wrap { scrollbar-width: auto; scrollbar-color: #b9c1c9 #f3f5f7; }
.reg-wrap.grabbing { cursor: grabbing; user-select: none; }

.with-pick .trip-row { grid-template-columns: 30px 104px minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.3fr) 118px 104px 112px 112px 96px; }
.with-pick.no-money .trip-row { grid-template-columns: 30px 104px minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.3fr) 118px 96px; }

/* меню можно убрать, чтобы таблицам было шире */
.menu-toggle { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; margin-right: 10px; }
.menu-toggle:hover { border-color: var(--brand); color: var(--brand); }

.blank-table th { width: 42%; text-align: left; font-weight: 600; background: #fafbfc; white-space: normal; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); vertical-align: top; border-right: 1px solid var(--line); }
.blank-table td { vertical-align: top; }
.menu-toggle { width: auto; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; font-weight: 500; }

.table.reg .col-yn { width: 64px; min-width: 64px; max-width: 64px; text-align: center; padding-left: 4px; padding-right: 4px; }
.reg-editing td.cell.col-yn input { min-width: 0; text-align: center; }

/* ---------- окна ---------- */
dialog { border: 0; border-radius: 10px; padding: 0; box-shadow: var(--shadow-lg); width: 480px; max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(15, 25, 30, .45); }
dialog .dlg-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
dialog .dlg-head h2 { margin-right: auto; }
dialog .dlg-body { padding: 16px 18px; }
dialog .dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fafbfc; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 100; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 92vh; }

/* ---------- калькулятор ---------- */
.calc-result { font-size: 30px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }

/* ---------- роли и команда ---------- */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix th.area-office { color: var(--brand); }
.matrix th.area-warehouse { color: var(--warn); }
.area-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.area-card { position: relative; display: block; cursor: pointer; }
.area-card input { position: absolute; opacity: 0; pointer-events: none; }
.area-body { display: block; height: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff; }
.area-card:hover .area-body { border-color: var(--line-strong); }
.area-card input:checked + .area-body { border-color: var(--brand); background: var(--brand-soft); }
.area-card input:focus-visible + .area-body { box-shadow: 0 0 0 3px rgba(19, 97, 77, .2); }
.area-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.area-hint { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }
.role-caps { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 13px; }
.role-caps .desc { grid-column: 1 / -1; color: var(--muted); margin-bottom: 6px; }
.role-caps .yes { color: var(--ok); }
.role-caps .no { color: var(--faint); }
.team-group .avatar { width: 30px; height: 30px; }
.team-norole .panel-head h2, .team-blocked .panel-head h2 { color: var(--muted); }

/* ---------- вход ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--brand-deep), var(--brand) 70%); padding: 16px; }
.login-box { width: 380px; max-width: calc(100vw - 32px); box-sizing: border-box; background: #fff; border-radius: 12px; padding: 28px; box-shadow: var(--shadow-lg); }
.login-box .field { margin-bottom: 12px; }

@media (max-width: 1100px) {
  .card-layout, .grid-2, .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- печать ---------- */
@media print {
  .sidebar, .topbar, .no-print, .messages { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
}

/* карточка контейнера: главное — сразу в глаза */
.facts { display: flex; flex-wrap: wrap; gap: 10px 10px; margin: 0 0 16px; }
.fact { min-width: 96px; flex: 1 1 auto; text-align: center; }
.fact-l { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.fact-v { border: 2px solid var(--text); border-radius: 4px; padding: 8px 8px; font-size: 15px; white-space: nowrap; font-weight: 600; background: #fff; min-height: 40px; width: 100%; box-sizing: border-box; text-align: center; font-family: inherit; color: var(--text); }
.fact-sm { min-width: 80px; flex-grow: 0; }
select.fact-v { appearance: none; -webkit-appearance: none; cursor: pointer; }
input.fact-v:focus, select.fact-v:focus { outline: none; border-color: var(--brand); }
.fact-save { min-width: 0; }
.fact-ban .fact-v { color: var(--danger); border-color: var(--danger); }
.fact-text { flex: 1 1 100%; text-align: left; }
.fact-text .fact-v { font-weight: 400; font-size: 14px; border-width: 1px; text-align: left; }
.fact-text textarea.fact-v { white-space: pre-wrap; resize: vertical; line-height: 1.4; overflow: hidden; }  /* длинный текст виден целиком (26.10.2026) */

/* чат */
.chat { display: flex; gap: 16px; height: calc(100vh - 110px); min-height: 480px; position: relative; }
.chat-rooms { width: 250px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow-y: auto; }
.chat-rooms-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-rooms-head h2 { margin: 0; font-size: 16px; }
.chat-room { display: flex; align-items: center; gap: 8px; padding: 9px 14px; color: var(--text); border-bottom: 1px solid #f0f2f4; }
.chat-room:hover { background: #f6f7f9; text-decoration: none; }
.chat-room.active { background: var(--brand-soft, #e3efeb); font-weight: 600; }
.chat-room-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-room .count { background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: 16px; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 16px; background: #f8f9fa; }
.chat-empty { text-align: center; padding: 40px 0; }
.msg-day { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0; }
.msg { display: flex; gap: 10px; margin: 0 0 10px; max-width: 78%; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.msg.mine .msg-avatar { background: #7a8794; }
.msg-body { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 120px; }
.msg.mine .msg-body { background: #e8f3ee; border-color: #cfe3d9; }
.msg-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.msg-actions { margin-left: auto; opacity: 0; }
.msg:hover .msg-actions { opacity: 1; }
.msg-actions .link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font-size: 12px; }
.msg-text { white-space: normal; word-break: break-word; }
.msg-text .mention { color: var(--brand); }
.msg-file img { max-width: 320px; max-height: 240px; border-radius: 6px; margin-top: 6px; display: block; }
.msg-doc { display: inline-block; margin-top: 6px; }
.msg-task { margin-top: 6px; }
.msg.flash .msg-body { box-shadow: 0 0 0 3px #ffd666; }
.msg.deleted .msg-body { opacity: .6; }
.chat-form { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { flex: 1; resize: vertical; min-height: 38px; max-height: 160px; }
.chat-attach-name { padding: 0 16px 8px; }
.chat-task-box { position: absolute; right: 24px; bottom: 70px; width: 420px; z-index: 5; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.check-list label { display: block; padding: 3px 0; }
.msg.for-me .msg-body { border-color: #e6b800; background: #fff8dc; }
.msg.mine.for-me .msg-body { background: #e8f3ee; }
.chat-room .count.at { background: #e6b800; color: #222; }
.chat-form { position: relative; }
.chat-mention { position: absolute; bottom: 100%; left: 60px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); min-width: 220px; z-index: 6; margin-bottom: 4px; }
.chat-mention-item { padding: 7px 12px; cursor: pointer; }
.chat-mention-item.on, .chat-mention-item:hover { background: var(--brand-soft, #e3efeb); }
.chat-mode { width: auto; flex: none; }
.chat-task-fields { display: flex; gap: 6px; flex: none; }
.chat-task-fields .input { width: auto; }
.chat-form.task-mode { background: #fff8dc; }
.damage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 12px; }
.damage-grid .check-line { display: flex; align-items: center; gap: 6px; }
.inn-auto-msg { font-size: 12px; margin-top: 3px; color: var(--muted); min-height: 0; }
.inn-auto-msg.good { color: #1a7f45; }
.inn-auto-msg.bad { color: var(--danger); }

/* ---------- меню значками (кнопка «Меню») и разделы с широкими таблицами ---------- */
.menu-mini-btn { display: flex; align-items: center; gap: 10px; margin: 8px 10px 0; padding: 7px 10px; border: 0; border-radius: 6px; background: rgba(255,255,255,.06); color: #cfe3dc; font: inherit; font-size: 12px; cursor: pointer; }
.menu-mini-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-user { display: none; }
.menu-mini .sidebar { width: 64px; min-width: 64px; }
.menu-mini .brand-logo { padding: 12px 6px; }
.menu-mini .brand-logo img { width: 44px; }
.menu-mini .brand-logo span, .menu-mini .nav-group, .menu-mini .sidebar-foot, .menu-mini .menu-mini-btn span { display: none; }
.menu-mini .menu-mini-btn { justify-content: center; margin: 8px 6px 0; padding: 9px 0; }
.menu-mini .nav { padding: 8px 6px; }
.menu-mini .nav a { font-size: 0; justify-content: center; padding: 10px 0; position: relative; gap: 0; }
.menu-mini .nav a .ic { width: 20px; height: 20px; }
.menu-mini .nav a .count { position: absolute; top: 2px; right: 2px; font-size: 10px; padding: 0 5px; line-height: 15px; margin: 0; }
.menu-mini .content { max-width: none; }
.menu-mini .close-zones { left: 64px; }
.wide-section .topbar { display: none; }
.wide-section .content { max-width: none; padding: 14px 18px 24px; }
.wide-section .sidebar-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.menu-mini .wide-section .sidebar-user { flex-direction: column; padding: 10px 0 14px; }
.wide-section .sidebar-user .btn { color: #cfe3dc; }
.wide-section .page-head { margin-bottom: 10px; flex-wrap: nowrap; }
.wide-section .page-head .sub { font-size: 12px; }
.wide-section .page-head .btn, .wide-section .page-head label.btn { white-space: nowrap; }
.wide-section .reg-wrap { max-height: calc(100vh - 215px); }
@media (max-width: 1100px) { .wide-section .page-head { flex-wrap: wrap; } }

/* формы на всю ширину: на широком экране поля в 4 колонки, длинные — на две; узкий экран — как было */
.form-grid.fill { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1500px) {
  .form-grid.fill { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-grid.fill > .field.wide { grid-column: span 2; }
  .form-grid.fill > .gap { display: none; }
}
@media (min-width: 1150px) and (max-width: 1499.98px) {
  .form-grid.fill { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid.fill > .field.wide { grid-column: span 2; }
  .form-grid.fill > .gap { display: none; }
}
.side-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.side-layout > .panel + .panel { margin-top: 0; }
@media (max-width: 1250px) { .side-layout { grid-template-columns: minmax(0, 1fr); } }

/* «Свернуть меню» в самом меню — только там, где нет верхней строки с кнопкой «Меню» */
.app:not(.wide-section) .menu-mini-btn { display: none; }

/* меню не «прыгает»: в свёрнутом виде значки стоят на тех же местах, что и в развёрнутом —
   шапка той же высоты, заголовок группы остаётся чертой той же высоты, строки того же размера */
.brand-logo { height: 190px; box-sizing: border-box; justify-content: center; flex: none; }
.menu-mini .brand-logo { padding: 12px 6px; }
.menu-mini .nav { padding: 6px 10px 16px; }
.menu-mini .nav-group { display: block; margin: 14px 4px 6px; font-size: 11px; color: transparent; overflow: hidden; white-space: nowrap;
  background: linear-gradient(rgba(255,255,255,.22), rgba(255,255,255,.22)) center / 100% 1px no-repeat; user-select: none; }
.nav a { height: 36px; box-sizing: border-box; white-space: nowrap; }
.nav-group { height: 16px; line-height: 16px; }
.menu-mini .nav a { padding: 8px 10px; justify-content: flex-start; }
.menu-mini .nav a .ic { width: 18px; height: 18px; }
.menu-mini .nav a::after { content: ''; }
[hidden] { display: none !important; }

/* ---------- «Дальше / Назад» под таблицей — всегда видно внизу экрана ---------- */
.pager { position: sticky; bottom: 0; z-index: 6; background: var(--panel); border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 -4px 10px -6px rgba(16, 24, 40, .18); }

/* ---------- главные кнопки формы — в шапке страницы, шапка прилипает к верху ---------- */
.page-head.has-actions { position: sticky; top: 58px; z-index: 15; background: var(--bg); padding: 8px 0; margin-top: -8px;
  box-shadow: 0 6px 8px -8px rgba(16, 24, 40, .25); }
.wide-section .page-head.has-actions { top: 0; }
.main-actions.in-head { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.main-actions.in-head form { display: inline-flex; margin: 0; }
.page-head.has-actions h1 { margin-right: 0; }

/* ---------- цвета разделов формы ---------- */
.tone-1 { --t-bg: #f3f7fd; --t-line: #d3e1f4; --t-ac: #3767a8; }
.tone-2 { --t-bg: #f1f8f4; --t-line: #c9e3d3; --t-ac: #2c7550; }
.tone-3 { --t-bg: #fdf8ee; --t-line: #efdfb9; --t-ac: #9a6a14; }
.tone-4 { --t-bg: #f6f3fc; --t-line: #ddd2f1; --t-ac: #65499e; }
.tone-5 { --t-bg: #eff8f9; --t-line: #c6e2e6; --t-ac: #22737d; }
.tone-6 { --t-bg: #fcf3f4; --t-line: #f0d3d8; --t-ac: #9e4356; }
.form-grid.sectioned { row-gap: 14px; }
.fsec { grid-column: 1 / -1; display: grid; grid-template-columns: inherit; gap: 12px 16px; align-items: start;
  padding: 4px 16px 16px; background: var(--t-bg); border: 1px solid var(--t-line); border-left: 4px solid var(--t-ac); border-radius: 8px; }
.fsec > .form-section { margin: 10px 0 0; color: var(--t-ac); border-bottom-color: var(--t-line); }
.form-grid.fill .fsec > .field.wide { grid-column: span 2; }
.form-grid.fill .fsec > .gap { display: none; }
@media (max-width: 1149.98px) { .form-grid.fill .fsec > .field.wide { grid-column: 1 / -1; } .form-grid.fill .fsec > .gap { display: block; } }
.panel.toned { border-top: 3px solid var(--t-ac); }
.panel.toned > .panel-head { background: var(--t-bg); border-bottom-color: var(--t-line); border-radius: var(--radius) var(--radius) 0 0; }
.panel.toned > .panel-head h2 { color: var(--t-ac); }

/* кнопка с выбором вариантов (Бирки ▾) */
.btn-menu { position: relative; display: inline-block; }
.btn-menu > summary { list-style: none; cursor: pointer; }
.btn-menu > summary::-webkit-details-marker { display: none; }
.btn-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 300px; background: #fff; border: 1px solid var(--line-strong);
  border-radius: 8px; box-shadow: var(--shadow-lg); padding: 6px; }
.btn-menu-list a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.btn-menu-list a:hover { background: var(--bg); text-decoration: none; }
.btn-menu-list a span { display: block; font-size: 12px; color: var(--muted); }

/* плашка «Закрыть рейс» наверху ТН: время подачи и окончания — расчёт сразу */
.finish-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; padding: 12px 14px; margin-bottom: 14px; border-radius: 8px;
  background: #fff7e6; border: 1px solid #f3dca3; }
.finish-bar.done { background: #e9f5ec; border-color: #bfe3cb; }
.finish-bar .finish-title { font-weight: 600; display: flex; align-items: center; gap: 6px; align-self: center; min-width: 130px; }
.finish-bar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.finish-bar label .input { width: auto; min-width: 130px; }
.finish-bar .finish-result { align-self: center; font-size: 14px; }
.finish-bar .finish-date { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.finish-bar .finish-date b { font-size: 15px; color: var(--text, #1f2a24); line-height: 38px; }
.rkm-profit { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 6px 0; }
.rkm-profit.bad, .stat .value.bad, .profit.bad { color: var(--danger, #c0392b); }
.rkm-profit.good, .stat .value.good, .profit.good { color: #1e7b45; }
td .profit.good { background: #e6f4ea; border-radius: 6px; padding: 2px 8px; }

.perm-table td.c, .perm-table th.c { text-align: center; width: 100px; }
.perm-table input[type=radio] { width: 18px; height: 18px; }
.perm-table tr.muted td { color: var(--muted); }

/* ---------- тарифы контейнерного отдела ---------- */
.tf-newver { position: relative; }
.tf-newver > summary { list-style: none; cursor: pointer; }
.tf-newver > summary::-webkit-details-marker { display: none; }
.tf-newver-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px; display: grid; gap: 8px; width: 280px; }
.tf-versions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 0 10px; }
.tf-settings { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 10px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); align-items: center; }
.tf-settings b { color: var(--text); }
.tf-settings label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; }
.tf-settings .input { width: 150px; height: 32px; }
.tf-notes ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.tf-notes li.bad { color: var(--danger); }
.tf-notes li.warn { color: var(--warn); }
.tf-notes > summary { cursor: pointer; }
.tf-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.tf-layout.single { grid-template-columns: minmax(0, 1fr); }
.tf-main { min-width: 0; }
.tf-side { position: sticky; top: 76px; }
@media (max-width: 1100px) { .tf-layout { grid-template-columns: minmax(0, 1fr); } .tf-side { position: static; } }
.tf-matrix { display: grid; grid-template-columns: 110px repeat(4, minmax(0, 1fr)); gap: 6px; }
.tf-mh { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.tf-mh.size { grid-column: span 2; color: var(--text); font-size: 13px; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.tf-mw { font-size: 12px; color: var(--muted); align-self: center; }
.tf-cell { border: 1px solid var(--line); border-radius: 6px; padding: 8px 6px; text-align: center; background: var(--panel); font: inherit; color: inherit; min-width: 0; cursor: pointer; }
.tf-cell:hover { border-color: var(--brand); }
.tf-cell.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.tf-cell.none { background: #f6f7f8; color: var(--faint); border-style: dashed; cursor: default; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.tf-cell.edit { cursor: default; display: grid; gap: 4px; text-align: left; padding: 6px; }
.tf-cell.edit label { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.tf-cell.edit .input { height: 28px; padding: 2px 6px; font-size: 13px; }
.tf-price { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tf-pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 10px; padding: 1px 8px; margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-pill.ok { background: var(--ok-soft); color: var(--ok); }
.tf-pill.thin { background: var(--warn-soft); color: var(--warn); }
.tf-pill.loss { background: var(--danger-soft); color: var(--danger); }
.tf-pill.empty { background: #f3f4f5; color: var(--muted); border: 1px dashed var(--line-strong); }
.tf-legend { margin: 8px 2px 14px; }
.tf-svc td.c, .tf-svc th.c { text-align: center; }
.tf-svc .tf-note { color: var(--warn); font-size: 12px; }
.tf-svc tr.tf-internal td { color: var(--muted); }
.tf-svc.edit .input, .tf-area-edit .input { height: 30px; padding: 2px 6px; font-size: 13px; min-width: 70px; }
.tf-area-edit td:first-child .input, .tf-svc.edit td:first-child .input { min-width: 200px; }
.tf-new td { background: #fafcfb; }
.tf-calc-title { font-size: 15px; font-weight: 700; margin: 0 0 2px; }
.tf-chain { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 13px; margin-top: 8px; }
.tf-chain .k { color: var(--muted); }
.tf-chain .v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-chain .sum { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 700; color: var(--text); }
.tf-box { margin-top: 12px; font-size: 12px; border-radius: 6px; padding: 8px 10px; background: var(--warn-soft); color: var(--warn); }
.tf-box.bad { background: var(--danger-soft); color: var(--danger); }
.tf-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.tf-chip { border: 1px solid var(--line-strong); background: var(--panel); border-radius: 16px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.tf-chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.tf-search { flex: 1 1 200px; max-width: 320px; }
.tf-shead, .tf-row { display: grid; grid-template-columns: minmax(130px, 1.3fr) repeat(4, minmax(0, 1fr)) 110px; gap: 8px; align-items: center; }
.tf-layout.single .tf-shead, .tf-layout.single .tf-row { grid-template-columns: minmax(130px, 1.3fr) repeat(4, minmax(0, 1fr)); }
.tf-shead { padding: 0 10px 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.tf-shead span:not(:first-child) { text-align: right; }
.tf-list { display: grid; gap: 6px; }
.tf-row { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.tf-row:hover { border-color: var(--brand); }
.tf-row.on { border-color: var(--info); box-shadow: 0 0 0 2px var(--info-soft); }  /* выбранный пункт (расшифровка справа) — не зелёным, чтобы не путать с прибылью */
.tf-nm { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.tf-pc { text-align: right; min-width: 0; font-variant-numeric: tabular-nums; }
.tf-p { display: block; font-weight: 600; }
.tf-st { justify-self: end; }
.tf-side table { font-size: 12px; }
.tf-side .table th, .tf-side .table td { padding: 6px 6px; }
.tf-side .tf-wrap { overflow-x: auto; }
.tf-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tf-form .field { display: grid; gap: 4px; }
.tf-res { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 16px; }
.tf-rcard { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.tf-rcard h3 { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.tf-big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.input.tf-bad { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-soft); }

/* ТН: форма блоками */
.tn-form { display: grid; gap: 14px; }
.tn-sec { background: var(--t-bg); border: 1px solid var(--t-line); border-left: 4px solid var(--t-ac); border-radius: 8px; padding: 12px 16px 16px; display: grid; gap: 12px; }
.tn-sec > h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--t-ac); font-weight: 700; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tn-h-note { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); font-size: 12px; }
.tn-row { display: grid; gap: 12px 16px; align-items: start; }
.tn-row > * { min-width: 0; }
.tn-row.r1 { grid-template-columns: minmax(0, 1fr); }
.tn-row.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tn-row.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tn-row.r5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tn-row.r-goods { grid-template-columns: minmax(0, 2.2fr) repeat(3, minmax(0, 1fr)); }
.tn-stack { display: grid; gap: 10px; align-content: start; }
.tn-sub { font-size: 12px; font-weight: 700; color: var(--text); }
.tn-col { border: 1px solid var(--t-line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 10px; align-content: start; background: var(--panel); }
.tn-col-h { font-weight: 700; font-size: 13px; color: var(--t-ac); }
.tn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tn-form .field .help { font-size: 11px; line-height: 1.3; }
.tn-form .field input[disabled] { background: #f4f6f7; color: var(--muted); }
@media (max-width: 1100px) { .tn-row.r5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tn-row.r-goods { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .tn-row.r2, .tn-row.r3, .tn-row.r5, .tn-row.r-goods { grid-template-columns: minmax(0, 1fr); } }
.tn-sec.more > summary { cursor: pointer; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--t-ac); font-weight: 700; }
.tn-sec.more:not([open]) { padding-bottom: 12px; }
.form-grid .tn-two { grid-column: 1 / -1; }
.form-grid .tn-col { background: var(--panel); border-color: var(--line); }
.form-grid .tn-col-h { color: var(--brand-dark); }
.tn-two { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .tn-two { grid-template-columns: minmax(0, 1fr); } }

.tf-in { height: 30px; padding: 2px 6px; font-size: 13px; text-align: right; }
.tf-chain-edit .v .input { width: 130px; }
.tf-neg { color: var(--danger); }
.tf-shead.area, .tf-row.area { grid-template-columns: minmax(150px, 1.4fr) repeat(7, minmax(0, 1fr)); }
.tf-layout.single .tf-shead.area, .tf-layout.single .tf-row.area { grid-template-columns: minmax(150px, 1.4fr) repeat(4, minmax(0, 1fr)); }
.tf-shead small { font-weight: 400; color: var(--faint); }
.tf-row.area { cursor: default; }
.tf-row.area .tf-nm { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.tf-nm-btn { border: 0; background: none; font: inherit; font-weight: 600; color: var(--brand); cursor: pointer; padding: 0; text-align: left; }
.tf-nm-btn:hover { text-decoration: underline; }
.tf-row.area .tf-pc .tf-pill { display: block; width: fit-content; margin-left: auto; }
.tf-row.area.new { background: #fafcfb; border-style: dashed; }
@media print {
  .sidebar, .topbar, .page-head .btn, .tf-newver, .tabs, .tf-side, .tf-legend, .tf-notes, .messages, .main-actions { display: none !important; }
  .main, .content { margin: 0 !important; padding: 0 !important; }
  .tf-layout { grid-template-columns: 1fr !important; }
  .panel { box-shadow: none; break-inside: avoid; }
  .tf-cell { border: 1px solid #999; }
  .tf-pill { border: 1px solid #ccc; }
}

.dim-row.dim-head { margin-top: 4px; font-size: 11px; font-weight: 600; }
.dim-row.dim-head span { color: var(--muted); text-align: left; }
.dim-row.dim-head span:nth-child(n+2) { text-align: center; }

/* авиа отдел: без подписей под полями (формы с data-no-placeholders) */
form[data-no-placeholders] .field .help { display: none; }
/* «Нам с клиента» и «Прибыль» — размыты, пока не нажать (клиенты бывают у монитора) */
.secret { filter: blur(7px); cursor: pointer; user-select: none; transition: filter .15s; }
.secret.shown { filter: none; user-select: auto; }
.secret-hint { font-size: 11px; color: var(--faint); font-weight: 400; margin-left: 6px; }

/* авиа → Тарифы */
.av-tabs a { display: inline-flex; align-items: baseline; gap: 8px; }
.av-count { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.av-tabs a.active .av-count { color: var(--brand); border-color: var(--brand); background: transparent; }
.av-rates td { vertical-align: top; }
.av-rates .input { height: 34px; width: 100%; }
.av-rates .av-ap { min-width: 170px; }
.av-rates .av-rate { width: 110px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.av-rates .av-note { min-width: 110px; }
.av-rates .input.av-changed { background: var(--warn-soft); border-color: var(--warn); }
.av-code { font-size: 11px; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }
.av-new { border-top: 2px solid var(--line); }
.av-new td { background: #fafcfb; }
.av-new-head td { padding-top: 12px; padding-bottom: 4px; }
.av-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.av-foot [data-av-dirty] { color: var(--warn); font-weight: 600; }
.av-explain { font-size: 13px; background: var(--bg); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; line-height: 1.5; }
.av-explain ol { margin: 4px 0 0 18px; padding: 0; }
.av-calc-form { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.av-calc-form .av-wide { grid-column: 1 / -1; }
.av-prefix { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--bg); margin-bottom: 8px; }
.av-rules .k small { display: block; font-size: 11px; color: var(--muted); }
.av-why { font-size: 12px; color: var(--brand); font-weight: 600; margin-top: 2px; }
.av-rules .v .input { width: 120px; }
.btn-menu-note { display: block; padding: 8px 14px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.av-warn { margin: 0 0 12px; font-size: 13px; }
.av-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.av-chips a { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--panel); }
.av-chips a.active { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.av-chips a:hover { text-decoration: none; color: var(--text); }
.av-rates .av-date { width: 130px; }
.av-state { font-size: 11px; margin-top: 3px; text-align: right; }
.av-state.current { color: var(--brand); }
.av-state.future { color: var(--warn); font-weight: 600; }
.av-state.old { color: var(--muted); text-decoration: line-through; }
.av-oldlink { padding: 8px 16px; font-size: 13px; }
.av-sub { font-size: 14px; margin: 18px 0 6px; }
.av-fees { font-size: 12px; }
.av-fees td, .av-fees th { padding: 5px 6px; vertical-align: top; }
.av-fees .av-date { width: 130px; height: 30px; }
.av-fees tr.av-now td { background: #f1f8f5; }
/* авто → зарплата водителей */
.sal-months { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; }
.sal-pick { display: inline-flex; gap: 6px; align-items: center; }
.sal-pick .input { height: 30px; width: auto; }
.sal-chip { font-size: 12px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.sal-chip.closed { color: var(--ok); border-color: var(--ok); }
.sal-chip:hover { text-decoration: none; color: var(--text); }
.sal-state { margin-left: auto; }
.sal-money td, .sal-money th { vertical-align: top; white-space: nowrap; }
.sal-money .sal-in { width: 84px; height: 30px; text-align: right; padding: 2px 6px; }
.sal-money .sal-pay { background: #f1f8f5; }
.sal-money tfoot th { border-top: 2px solid var(--line); }
.sal-warn { font-size: 11px; color: var(--warn); white-space: normal; max-width: 260px; margin-top: 2px; }
tr.sal-changed td { background: var(--warn-soft); }
.sal-grid { font-size: 12px; }
.sal-grid th, .sal-grid td { padding: 3px 2px; text-align: center; }
.sal-grid .sal-name { text-align: left; white-space: nowrap; padding: 3px 8px; position: sticky; left: 0; background: var(--panel); z-index: 1; }
.sal-grid .sal-d { min-width: 34px; }
.sal-grid .we { background: #f6f7f9; }
.sal-grid td.on { background: #e7f4ee; }
.sal-grid td.fixed { background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn); }
.sal-grid .sal-cell { width: 34px; height: 26px; padding: 1px 2px; text-align: center; font-size: 12px; }
.sal-rules { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.sal-grid td.est { color: var(--warn); font-style: italic; }
.sal-open summary { cursor: pointer; }
.sal-open div { margin-top: 4px; }

/* зарплата водителей — ровные столбцы: одна строка на водителя, у обеих таблиц одинаковая колонка «Водитель» */
.sal-money { table-layout: fixed; min-width: 1180px; font-size: 13px; }
.sal-money col.c-name { width: 200px; } .sal-money col.c-n { width: 58px; } .sal-money col.c-m { width: 92px; }
.sal-money col.c-in { width: 88px; } .sal-money col.c-pay { width: 104px; }
.sal-money th, .sal-money td { padding: 6px 6px; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sal-money td.num, .sal-money th.num { text-align: right; font-variant-numeric: tabular-nums; }
.sal-money thead tr.sal-group th { font-size: 11px; color: var(--muted); text-align: center; border-bottom: 0; padding-bottom: 0; }
.sal-money thead tr.sal-group th[colspan] { border-bottom: 2px solid var(--line); }
.sal-money .sal-in { width: 100%; height: 28px; text-align: right; padding: 2px 5px; font-variant-numeric: tabular-nums; }
.sal-money .sal-in.sal-auto { color: var(--muted); font-style: italic; }
.sal-money .sal-who b { margin-right: 4px; }
.sal-money .sal-who .small { font-size: 11px; }
.sal-money td a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.sal-money .sal-who a:first-child { text-decoration: none; color: var(--brand); }
.sal-flag { display: inline-block; width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 50%; background: var(--warn); color: #fff !important; font-size: 11px; font-weight: 700; text-decoration: none !important; }
.sal-money .sal-warn { min-width: 0; font-size: 10px; }
.sal-grid { table-layout: fixed; }
.sal-grid .sal-name { width: 200px; min-width: 200px; }
.sal-grid .sal-name a { color: inherit; font-weight: 600; text-decoration: none; }
.sal-grid .sal-d { width: 38px; min-width: 38px; cursor: pointer; font-variant-numeric: tabular-nums; }
.sal-grid .sal-tot { width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.sal-grid td.has { box-shadow: inset 0 -3px 0 #9fd3bd; }
.sal-grid td.pick { outline: 2px solid var(--brand); outline-offset: -2px; }
.sal-grid tfoot th { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sal-day { margin: 0 16px 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fbfcfd; }
.sal-day-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; }
.sal-day-head .btn { margin-left: auto; }
.sal-day-trips { margin-top: 8px; font-size: 13px; }
.sal-legend { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sal-key { display: inline-block; width: 14px; height: 12px; border-radius: 3px; border: 1px solid var(--line); vertical-align: middle; }
.sal-key.on { background: #e7f4ee; } .sal-key.fixed { background: var(--warn-soft); border-color: var(--warn); } .sal-key.has { box-shadow: inset 0 -3px 0 #9fd3bd; }
.sal-key.auto { background: #fff; border-style: dashed; }
.sal-key.pct { background: linear-gradient(225deg, #2f7dd1 0 5px, transparent 5px); }
.sal-grid .sal-d.pct { background-image: linear-gradient(225deg, #2f7dd1 0 6px, transparent 6px); }  /* рейс на машине с 10 % — не вывоз */
.sal-grid .sal-cell.sal-rub { width: 52px; font-size: 11px; }
.sal-money .sal-pct .sal-sub { white-space: nowrap; }
.sal-checks > div, .sal-checks > details { padding: 6px 0; border-bottom: 1px solid var(--line); }
.sal-checks > :last-child { border-bottom: 0; }
.sal-checks .sal-warn { max-width: none; font-size: 12px; }
.sal-trips tr.sal-drv td { background: #f4f7f6; font-weight: 600; border-top: 2px solid var(--line); }
.sal-trips td.num, .sal-trips th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sal-trips td { vertical-align: middle; }
/* тарифы: прибыль под ценой — вводится, цена считается по формуле */
.tf-fx { display: flex; flex-direction: column; gap: 3px; }
.tf-want { display: flex; align-items: center; gap: 4px; font-size: 11px; border-radius: 6px; padding: 1px 4px; }
.tf-want span { color: var(--muted); white-space: nowrap; }
.tf-want input { height: 24px; font-size: 12px; text-align: right; padding: 1px 4px; font-weight: 600; min-width: 0; width: 100%; }
.tf-want.ok input { color: var(--ok); } .tf-want.thin input { color: var(--warn); } .tf-want.loss input { color: var(--danger); background: var(--danger-soft); }
.tf-cell.edit label.tf-cell-price input { font-weight: 700; }
.tf-want span { font-size: 10px; }
.tf-want input { font-size: 11px; padding: 1px 3px; letter-spacing: -0.2px; }
/* деньги в полях: знак рубля справа, цифры по правому краю */
input.rub-in { text-align: right; padding-right: 22px !important; font-variant-numeric: tabular-nums;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14'%3E%3Ctext x='0' y='11' font-size='12' font-family='Arial,sans-serif' fill='%238a94a0'%3E%E2%82%BD%3C/text%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; }
.tf-want input.rub-in { padding-right: 15px !important; background-position: right 3px center; background-size: 9px 13px; }

/* Авто отдел → Выходы водителей (путевой лист дня) */
.sh-days { display: flex; align-items: center; gap: 4px; padding: 10px 12px; overflow-x: auto; }
.sh-day { display: flex; flex-direction: column; align-items: center; min-width: 34px; padding: 4px 2px; border-radius: 6px; color: var(--text); text-decoration: none; border: 1px solid transparent; position: relative; }
.sh-day b { font-size: 13px; line-height: 1.1; }
.sh-day small { font-size: 10px; color: var(--muted); }
.sh-day i { font-style: normal; font-size: 10px; font-weight: 600; color: var(--brand); }
.sh-day:hover { background: var(--brand-soft); }
.sh-day.we b { color: var(--danger); }
.sh-day.today { border-color: var(--line-strong); }
.sh-day.on { background: var(--brand); border-color: var(--brand); }
.sh-day.on b, .sh-day.on small, .sh-day.on i { color: #fff; }
.sh-table { table-layout: fixed; min-width: 1350px; }
.sh-table col.c-who { width: 170px; } .sh-table col.c-st { width: 160px; } .sh-table col.c-veh { width: 170px; }
.sh-table col.c-t { width: 118px; } .sh-table col.c-ot { width: 100px; } .sh-table col.c-trips { width: auto; } .sh-table col.c-note { width: 220px; }
.sh-table col.c-hh { width: 168px; }
.sh-hh { display: flex; gap: 4px; align-items: center; }
.sh-table .sh-hh .input { width: 78px; flex: none; text-align: right; }
.sh-hh .btn { padding: 2px 6px; font-size: 11px; white-space: nowrap; }
.sh-table td { vertical-align: top; }
.sh-table .input { width: 100%; }
.sh-table tr.sh-suggested td { background: var(--warn-soft); }
.sh-table tr.sh-off td { color: var(--muted); }
.sh-trips div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* зарплата: три сетки дней одной высоты строк — при переключении «Часы / Табель / Переработка» ничего не сдвигается */
.sal-grid tbody td { height: 33px; }
/* сообщение после сохранения, когда страница осталась на месте (data-keep-scroll) */
.messages.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: 460px; margin: 0; transition: opacity .5s; }
.messages.toast .alert { box-shadow: var(--shadow-lg); margin: 0 0 8px; }
.messages.toast.toast-out { opacity: 0; pointer-events: none; }
.sal-unfix { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
/* реестр: «проверьте» — причина сразу при наведении (а не через долгую системную подсказку) */
.reg-issue[data-tip] { position: relative; cursor: help; }
.reg-issue[data-tip]:hover::after, .reg-issue[data-tip]:focus::after { content: attr(data-tip); position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  width: max-content; max-width: 360px; white-space: normal; text-align: left; font-weight: 400; font-size: 12px; line-height: 1.4;
  padding: 8px 10px; border-radius: 6px; background: var(--text); color: #fff; box-shadow: var(--shadow-lg); }
/* 26.10.2026: столбца «Состояние» нет — состояние видно по цвету строки; «!» с причиной стоит рядом с № */
.table.reg .pin-1 .reg-issue[data-tip] { position: absolute; top: 4px; right: 3px; margin: 0; padding: 0 5px; font-size: 11px; line-height: 16px; }
.pin-1 .reg-issue[data-tip]:hover::after, .pin-1 .reg-issue[data-tip]:focus::after { left: 0; right: auto; }
/* тарифы области: таблица на всю ширину, настройки формулы и краны — заметным блоком, выбор пунктов для Excel/PDF */
.tf-layout.wide { grid-template-columns: minmax(0, 1fr); }
.tf-settings-area { display: flex; flex-wrap: wrap; gap: 14px; padding: 14px 16px; background: var(--brand-soft); border-top: 1px solid var(--line); }
.tf-set-group { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 10px 12px; background: var(--panel); border: 1px solid #cfe3da; border-radius: var(--radius); }
.tf-set-title { flex-basis: 100%; font-weight: 700; font-size: 13px; color: var(--brand); text-transform: uppercase; letter-spacing: .03em; }
.tf-settings-area label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tf-settings-area .input { width: 140px; font-size: 15px; font-weight: 600; }
.tf-export { display: inline-flex; align-items: center; gap: 8px; }
.tf-pick { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
/* тарифы города: таблица «кран + авто + прибыль = цена» */
.tf-citybar { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 14px; margin-bottom: 12px; background: var(--brand-soft); border: 1px solid #cfe3da; border-radius: var(--radius); }
.tf-cgrid { table-layout: fixed; }
.tf-cgrid th:first-child { width: 170px; text-align: left; font-weight: 600; color: var(--muted); }
.tf-cgrid td .input { width: 100%; max-width: 160px; text-align: right; margin-left: auto; display: block; }
.tf-cgrid .tf-cg-w th { background: #f6f8f9; color: var(--text); font-weight: 700; text-transform: none; }
.tf-cgrid .tf-cg-price th, .tf-cgrid .tf-cg-price td { border-top: 2px solid var(--line-strong); font-size: 16px; color: var(--text); }
.tf-cgrid thead th { text-align: right; }
.tf-cgrid thead th.c { text-align: center; }
.tf-cgrid thead th:first-child { text-align: left; }

/* цена клиенту — главное число на странице тарифов */
.tf-client-price { display: inline-block; padding: 4px 10px; border-radius: 6px; background: var(--brand); color: #fff !important; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.tf-cgrid .tf-cg-price td { background: var(--brand-soft); }
.tf-cgrid .tf-cg-price th { background: var(--brand-soft); color: var(--brand); }
.tf-weight-note { text-align: center; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 6px; border-radius: 6px; margin: 6px 0; }
/* зарплата: компактная таблица — число и расшифровка в одной клетке; водитель слева и «К выдаче» справа не уезжают при прокрутке */
.sal-compact { min-width: 1100px; }
.sal-compact col.c-name { width: 190px; } .sal-compact col.c-m { width: 118px; } .sal-compact col.c-in { width: 92px; } .sal-compact col.c-pay { width: 120px; }
.sal-compact th, .sal-compact td { white-space: normal; }
.sal-compact .sal-sub { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 1px; white-space: nowrap; }
.sal-compact .sal-who { position: sticky; left: 0; background: var(--panel); z-index: 2; }
.sal-compact th:first-child { position: sticky; left: 0; background: var(--panel); z-index: 3; }
.sal-compact .sal-pay, .sal-compact th:last-child { position: sticky; right: 0; z-index: 2; background: #f1f8f5; box-shadow: -6px 0 8px -8px rgba(16, 24, 40, .35); }
.sal-compact .sal-pay b { font-size: 14px; }
.sal-details > summary { list-style: none; cursor: pointer; }
.sal-details > summary::-webkit-details-marker { display: none; }
.sal-details > summary h2::before { content: '▸ '; color: var(--muted); font-size: 12px; }
.sal-details[open] > summary h2::before { content: '▾ '; }
/* зарплата: настройки месяца — подписи в две строки одной высоты, поля ровно в ряд, подсказки под полем */
.sal-rules .field { grid-template-rows: 2.6em auto auto; align-content: start; }
.sal-rules .field > .lbl { display: flex; align-items: flex-end; line-height: 1.25; }
.sal-rules .help { font-size: 11px; }
.sal-state { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 0 auto; }
/* одна кнопка «Сохранить» — появляется внизу экрана, только когда что-то поправили */
.sal-savebar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 40; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 18px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 600; }
.sal-savebar[hidden] { display: none !important; }

.veh-manual { display: contents; } .veh-manual.off { display: none; } .veh-manual.off.on { display: contents; }  /* «Авто»/«Номер» — только для машины не из списка */
.tn-more > summary { cursor: pointer; list-style: revert; }
.finish-bar .finish-result.small { font-size: 12px; }

.sal-why { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; max-width: 520px; width: 92vw; }
.sal-why::backdrop { background: rgba(0,0,0,.35); }
.sal-why h3 { margin: 0 0 12px; font-size: 15px; }
.sal-why .check-line { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.sal-why .check-line .input { flex: 1; }
.sal-why-sum { margin: 2px 0 8px 26px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sal-why-sum .input { width: 110px; }
.sal-why-sum .muted { flex-basis: 100%; }
.sal-pct-table tr.sal-drv td { background: var(--brand-soft); }

.sal-grid .sal-d.hh { box-shadow: inset 0 0 0 2px #e0a23a; }  /* день с хознуждами */
.sal-key.hh { box-shadow: inset 0 0 0 2px #e0a23a; }

.sal-pick select.input { min-width: 210px; font-weight: 600; }
.sal-pct-cars { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sal-pct-cars .lbl { flex-basis: 100%; font-weight: 600; }
.sal-pct-car { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.sal-pct-car.on { border-color: var(--brand); background: var(--brand-soft); }
.sal-pct-car .input { width: 64px; text-align: right; }

.sal-grid .sal-d.pct .sal-cell::placeholder { color: #2f7dd1; font-size: 10px; opacity: 1; }

/* начисления зарплаты: вся таблица на экране без прокрутки (16.10.2026) — денежные графы делят место поровну */
.sal-money.sal-compact { min-width: 0; width: 100%; font-size: 12.5px; }
.sal-compact col.c-name { width: 132px; } .sal-compact col.c-n { width: 44px; } .sal-compact col.c-m { width: auto; }
.sal-compact col.c-in { width: 96px; } .sal-compact col.c-pay { width: 110px; }
.sal-compact th, .sal-compact td { padding: 6px 4px; }
.sal-compact thead th { font-size: 11.5px; line-height: 1.25; white-space: normal; }
.sal-compact .sal-sub { white-space: normal; line-height: 1.25; }
.sal-compact .sal-in { padding: 2px 4px; font-size: 12px; }
.sal-compact .sal-who .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1500px) { .sal-money.sal-compact { min-width: 1240px; } }

/* цены клиенту в тарифах: не заливка, а светлая плашка — глазу легче по таблице (16.10.2026) */
.tf-client-price { background: #eef6f1; color: var(--brand) !important; border: 1px solid #cfe5d9; font-weight: 700; padding: 3px 10px; }
.tf-row:hover .tf-client-price, .tf-cgrid tr:hover .tf-client-price { background: #dcefe4; border-color: #9fcdb4; }

/* груз: описание и объявленная ценность в одну строку (16.10.2026) */
.cargo-desc-grid { display: grid; grid-template-columns: 3fr 1fr; gap: 14px; margin-top: 12px; align-items: start; }
.cargo-desc-grid.solo { grid-template-columns: 1fr; }
.cargo-desc-grid textarea { min-height: 74px; }
@media (max-width: 760px) { .cargo-desc-grid { grid-template-columns: 1fr; } }

/* пустое поле даты — пустое: Safari рисует в нём серую сегодняшнюю дату, её путают с вписанной (16.10.2026) */
input[type=date].is-empty:not(:focus)::-webkit-datetime-edit { color: transparent; }

.sal-compact .sal-ktu { margin-top: 2px; height: 24px; width: 100%; }

/* места по габаритам: без «Что это» (16.10.2026) — только размеры и количество */
.dim-row { grid-template-columns: minmax(160px, 1fr) 80px 14px 80px 14px 80px 14px 64px 90px 34px; }
.dim-row .dim-n { text-align: left; }

/* груз: блок «Места» — аккуратная таблица в рамке, итог внизу (16.10.2026) */
.dims-box { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fafcfb; }
.dims-title { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; flex-wrap: wrap; }
.dims-box .dim-row { grid-template-columns: minmax(180px, 1fr) 76px 12px 76px 12px 76px 12px 64px 90px 32px; gap: 6px; padding: 4px 0; border-bottom: 1px dashed var(--line); margin-top: 0; }
.dims-box .dim-rows .dim-row:last-child { border-bottom: 0; }
.dims-box .dim-row.dim-head { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.dims-box .dim-row .input { background: #fff; }
.dims-box .dim-vol { text-align: right; font-variant-numeric: tabular-nums; }
.dims-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.dims-total { font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.cargo-desc-grid textarea { min-height: 56px; }
@media (max-width: 760px) { .dims-box .dim-row { grid-template-columns: 1fr 1fr 1fr 1fr; } .dims-box .dim-row > span { display: none; } }

.av-matrix th, .av-matrix td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.av-matrix thead th { font-size: 11.5px; white-space: normal; vertical-align: bottom; }

/* авиа → тарифы (16.10.2026): калькулятор сверху в одну строку, таблица направлений спокойнее, правила свёрнуты */
.av-calc-row { display: grid; grid-template-columns: minmax(220px, 2.2fr) minmax(170px, 1.4fr) repeat(6, minmax(70px, .7fr)); gap: 10px; align-items: end; }
.av-calc-row .field { margin: 0; }
.av-res { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.av-res > p { grid-column: 1 / -1; }
.av-search { padding: 10px 16px 0; } .av-search .input { max-width: 360px; }
.av-rates td .input { border-color: transparent; background: transparent; box-shadow: none; }
.av-rates td .input:hover { border-color: var(--line); }
.av-rates td .input:focus, .av-rates td .input.av-changed { border-color: var(--brand); background: #fff; }
.av-rates td { padding-top: 6px; padding-bottom: 6px; }
.av-rates .av-code { font-size: 11px; color: var(--muted); padding-left: 12px; }
.av-rates tbody:not(.av-new) tr:hover td { background: #f7faf8; }
.av-rules-box .panel-body { max-width: 760px; }
@media (max-width: 1100px) { .av-calc-row { grid-template-columns: 1fr 1fr 1fr; } .av-res { grid-template-columns: 1fr; } }

/* калькулятор авиа: группы слева, результат справа (16.10.2026) */
.avc { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.avc-g { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fafcfb; }
.avc-g + .avc-g { margin-top: 12px; }
.avc-t { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.avc-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.avc-f { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.avc-f > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.avc-f .input { background: #fff; }
.avc-dest { flex: 2 1 260px; } .avc-prod { flex: 1 1 200px; }
.avc-s { width: 130px; } .avc-xs { width: 70px; }
.avc-unit { position: relative; } .avc-unit .input { padding-right: 34px; text-align: right; }
.avc-unit i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--muted); }
.avc-dimrow { display: flex; align-items: center; gap: 6px; } .avc-dimrow .input { width: 72px; text-align: center; } .avc-dimrow b { color: var(--muted); font-weight: 400; }
.avc-spec { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: #fff; user-select: none; }
.avc-spec input { display: none; } .avc-spec span { font-weight: 600; } .avc-spec small { color: var(--muted); }
.avc-spec.on { background: var(--warn-soft); border-color: var(--warn); }  /* без :has — класс ставит скрипт (Chrome 109) */
.avc-out { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.avc-out > p { margin: 0; padding: 18px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.avc-out .tf-rcard { margin: 0; }
@media (max-width: 1100px) { .avc { grid-template-columns: 1fr; } }

.av-compare-tab { font-weight: 600; }
.av-best { border-color: var(--brand) !important; background: var(--brand-soft); }
.av-cmp { margin-top: 4px; } .av-cmp td, .av-cmp th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.av-cmp tr.av-cmp-best td { background: #eef6f1; }

[data-av-compare].avc { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.av-cmp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.av-cmp { margin: 0; font-size: 13px; } .av-cmp th, .av-cmp td { padding: 8px 10px; }
.av-cmp td .small { font-size: 11px; }

/* галочка-карточка (авиа: «Спецгруз», «Груз улетел») — высотой с поле, с пояснением */
.check-card { display: flex; align-items: center; gap: 10px; align-self: end; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-strong);
  border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.check-card:hover { border-color: var(--brand); }
.check-card input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; margin: 0; }
.check-card span { display: flex; flex-direction: column; line-height: 1.25; }
.check-card b { font-size: 14px; font-weight: 600; color: var(--text); }
.check-card small { font-size: 12px; color: var(--muted); }
.check-card.on { border-color: var(--brand); background: rgba(19, 97, 77, .07); }
form[data-no-placeholders] .field .help.live { display: block; }
.help.err { color: var(--danger); }

/* заказ авто: паспорт/ВУ из справочника — строкой, поле только для нового водителя; «приём груза в ТН» — свёрнуто в колонке погрузки */
.docs-known { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 14px; color: var(--text); }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.tn-col .tn-more { border-top: 1px dashed var(--line); padding-top: 8px; }
.tn-col .tn-more > summary { font-size: 12px; color: var(--muted); }
.tn-col .tn-more[open] { display: grid; gap: 10px; }
input[type=date].is-empty:not(:focus)::-webkit-datetime-edit-day-field, input[type=date].is-empty:not(:focus)::-webkit-datetime-edit-month-field,
input[type=date].is-empty:not(:focus)::-webkit-datetime-edit-year-field, input[type=date].is-empty:not(:focus)::-webkit-datetime-edit-text { color: transparent; }

/* свои подсказки к полям со списком (вместо datalist браузера) */
.sugg { position: absolute; z-index: 1000; max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(16, 24, 40, .14); padding: 4px; font-size: 14px; }
.sugg > div { padding: 7px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.sugg > div:hover, .sugg > div.on { background: rgba(19, 97, 77, .10); }

/* пустое время — Safari рисует серым текущее время («12:30»), его путали с вписанным */
input[type=time].is-empty:not(:focus)::-webkit-datetime-edit, input[type=time].is-empty:not(:focus)::-webkit-datetime-edit-hour-field,
input[type=time].is-empty:not(:focus)::-webkit-datetime-edit-minute-field, input[type=time].is-empty:not(:focus)::-webkit-datetime-edit-text { color: transparent; }

/* все галочки форм — карточкой высотой с поле, выровнены по низу строки (16.10.2026) */
.field.checkbox { display: flex; flex-direction: column; justify-content: flex-end; padding-top: 0; gap: 4px; }
.field.checkbox .check-card { width: 100%; }
.field.checkbox.has-err .check-card { border-color: var(--danger); }
/* Safari рисует пустую дату/время серым «16 10 2026» не через ::-webkit-datetime-edit — прячем цвет самого поля, пока оно пустое */
input[type=date].is-empty:not(:focus), input[type=time].is-empty:not(:focus) { color: transparent; }

/* меню: группы «Работа» и «Управление» сворачиваются по заголовку (17.10.2026) */
button.nav-group { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 20px); box-sizing: border-box; border: 0; background: none;
  padding: 0; font: inherit; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #6f9a8c; cursor: pointer; text-align: left; }
button.nav-group:hover { color: #cfe3dc; }
.nav-chev { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.nav-sec.closed .nav-chev { transform: rotate(-45deg); }
.nav-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s ease; }
.nav-items > div { overflow: hidden; min-height: 0; }
.nav-sec.closed .nav-items { grid-template-rows: 0fr; }
.nav-chev { margin-left: auto; margin-right: 4px; flex: none; }
.nav-badge { margin-left: auto; margin-right: 10px; font-size: 10px; letter-spacing: 0; padding: 0 6px; line-height: 15px; border-radius: 8px; background: var(--accent); color: #3b2c00; font-weight: 700; }
.nav-badge + .nav-chev { margin-left: 0; }
.nav-sec:not(.closed) .nav-badge, .menu-mini .nav-badge { display: none; }
.menu-mini .nav-sec.closed .nav-items { grid-template-rows: 1fr; }  /* меню значками — все значки видны, группы не прячутся */
.menu-mini button.nav-group { pointer-events: none; width: auto; }
.menu-mini .nav-chev { display: none; }


/* =====================================================================
   ТЕЛЕФОН (до 760 px) — 17.10.2026. Меню выезжает по кнопке, поля в один столбец,
   широкие таблицы листаются пальцем вбок, кнопки крупнее под палец.
   ===================================================================== */
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  body { -webkit-text-size-adjust: 100%; }
  /* меню — выезжающая шторка; режим «значками» на телефоне не действует */
  .app { display: block; }
  .sidebar, .menu-mini .sidebar { position: fixed; z-index: 300; left: 0; top: 0; bottom: 0; height: 100%; width: 270px; min-width: 0;
    transform: translateX(-105%); transition: transform .22s ease; box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  .nav-open .sidebar { transform: none; }
  .nav-open body::after { content: ''; position: fixed; inset: 0; z-index: 250; background: rgba(15, 25, 30, .45); }
  .brand-logo, .menu-mini .brand-logo { height: auto; padding: 14px 12px 10px; }
  .brand-logo img, .menu-mini .brand-logo img { width: 92px; }
  .menu-mini .brand-logo span, .menu-mini .nav-group, .menu-mini .sidebar-foot { display: block; }
  .menu-mini .nav { padding: 6px 10px 16px; }
  .menu-mini .nav a { font-size: 14px; gap: 10px; justify-content: flex-start; padding: 8px 10px; }
  .menu-mini .nav a .count { position: static; margin-left: auto; font-size: 11px; padding: 0 7px; line-height: 18px; }
  .menu-mini .nav-group { color: #6f9a8c; background: none; margin: 14px 10px 6px; }
  .menu-mini button.nav-group { pointer-events: auto; width: calc(100% - 20px); }
  .menu-mini .nav-chev { display: block; }
  .menu-mini .nav-sec.closed .nav-items { grid-template-rows: 0fr; }
  .nav a { height: 42px; }
  .menu-mini-btn, .sidebar-user, .wide-section .sidebar-user { display: none !important; }
  .main { min-height: 100vh; }

  /* верхняя строка — всегда, и в «широких» разделах тоже (там в ней кнопка меню) */
  .topbar, .wide-section .topbar { display: flex; position: sticky; top: 0; z-index: 200; gap: 8px; padding: 8px 10px; height: auto; }
  .menu-toggle { margin-right: 0; height: 40px; padding: 0 11px; }
  .menu-toggle-t, .topbar .who, .topbar .spacer { display: none; }
  .search { flex: 1 1 auto; max-width: none; min-width: 0; }
  .topbar .btn.primary { padding: 0 10px; font-size: 0; gap: 0; height: 40px; }
  .topbar .btn.primary .ic { width: 20px; height: 20px; }
  .topbar form .btn { height: 40px; }

  /* страница */
  .content, .wide-section .content, .menu-mini .content { padding: 12px 10px 90px; max-width: none; }
  h1 { font-size: 19px; line-height: 1.25; }
  .page-head, .wide-section .page-head { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .page-head > div:first-child { flex: 1 1 100%; min-width: 0; }
  .page-head .btn, .wide-section .page-head .btn { white-space: normal; }
  .page-head.has-actions { top: 56px; position: static; box-shadow: none; }
  .main-actions.in-head { width: 100%; justify-content: flex-start; margin: 0; }
  .crumbs { font-size: 12px; }

  /* панели, сетки, формы — в один столбец */
  .panel-head { flex-wrap: wrap; gap: 6px; padding: 12px; }
  .panel-body { padding: 12px; }
  .grid-2, .grid-3, .card-layout, .cal-layout, .side-layout, .tf-layout, .avc, .av-res { grid-template-columns: minmax(0, 1fr) !important; }
  .form-grid, .form-grid.fill, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: minmax(0, 1fr) !important; gap: 10px; }
  .form-grid > *, .form-grid.fill > .field.wide, .form-grid .wide { grid-column: 1 / -1 !important; }
  .tn-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .input, select.input, textarea.input { font-size: 16px; min-height: 44px; }  /* 16 px — айфон не увеличивает страницу при вводе */
  textarea.input { min-height: 80px; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  .form-actions, .main-actions { flex-wrap: wrap; gap: 8px; }
  .form-actions .btn { flex: 1 1 auto; justify-content: center; }
  .check-card { min-height: 48px; }

  /* таблицы — листаются вбок внутри своей панели, страница не разъезжается */
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .table td, .table th { white-space: nowrap; }
  .table td.wrap, .table .wrap { white-space: normal; min-width: 180px; }
  .reg-wrap, .wide-section .reg-wrap { max-height: none; overflow: auto; }
  .tabs { padding: 0 6px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 12px 10px 10px; }

  /* окна и подсказки */
  dialog { width: calc(100vw - 20px); max-width: none; max-height: calc(100vh - 40px); overflow: auto; }
  .sugg { max-width: calc(100vw - 20px); }
  .sugg > div { padding: 11px 12px; white-space: normal; }
  .btn-menu-list { right: 0; left: auto; max-width: calc(100vw - 20px); }
}
@media (max-width: 760px) {
  /* чат: комнаты — лентой сверху, строка ввода переносится */
  .chat { flex-direction: column; gap: 8px; height: calc(100vh - 80px); min-height: 0; }
  .chat-rooms { width: auto; display: flex; overflow-x: auto; overflow-y: hidden; flex: none; border-radius: 8px; scrollbar-width: none; }
  .chat-rooms::-webkit-scrollbar { display: none; }
  .chat-rooms-head { border: 0; padding: 6px 8px; flex: none; }
  .chat-rooms-head h2 { display: none; }
  .chat-room { flex: none; border: 0; border-right: 1px solid #f0f2f4; padding: 8px 12px; max-width: 170px; }
  .chat-main { flex: 1; min-height: 0; }
  .chat-head { padding: 10px 12px; }
  .chat-log { padding: 10px; }
  .chat-form { flex-wrap: wrap; padding: 8px; gap: 6px; }
  .chat-form textarea { order: -1; flex: 1 1 100%; }
  .chat-form [data-send-btn] { margin-left: auto; }
  .chat-task-fields { flex-wrap: wrap; flex: 1 1 100%; }
  .chat-task-box { left: 0; right: 0; width: auto; bottom: 120px; }
  .chat-mention { left: 0; right: 0; min-width: 0; }
}
@media (max-width: 760px) {
  /* переключатели «Благовещенск / Хабаровск» и т.п. — на всю ширину, не обрезаются */
  .seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .page-head .seg, .page-head .view-switch { flex: 1 1 100%; }
  .page-head .seg > * { flex: 1 1 auto; text-align: center; }
  /* фильтры над таблицами: поиск на всю строку, остальное по два */
  .filters { flex-wrap: wrap; gap: 8px; }
  .filters > .input, .filters > input, .filters > select { flex: 1 1 calc(50% - 4px); min-width: 0; width: auto; }
  .filters > input[type=search], .filters > input[type=text]:first-child, .filters > .input:first-child { flex-basis: 100%; }
  .filters .btn { flex: 1 1 auto; }
}
@media (max-width: 760px) {
  .filters .input, .filters .q { min-width: 0; height: auto; font-size: 16px; }
  .filters .q { flex: 1 1 100%; }
  .filters .btn { height: auto; }
  .filters > label, .filters > .field { flex: 1 1 calc(50% - 4px); min-width: 0; }
}
@media (max-width: 760px) {
  .title-row { flex-wrap: wrap; gap: 8px; }
  .title-row .seg { flex: 1 1 100%; width: 100%; }
  .title-row .seg label { flex: 1 1 0; text-align: center; }
}
@media (max-width: 760px) {
  /* зарплата: «← месяц | выбор | месяц →» в одну строку */
  .sal-months { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: center; }
  .sal-months > :not(.sal-pick):not(a) { grid-column: 1 / -1; }
  .sal-pick { min-width: 0; }
  .sal-pick select { width: 100%; min-width: 0; font-size: 16px; }
  .sal-months > a { white-space: nowrap; padding: 0 10px; font-size: 13px; }
}
@media (max-width: 760px) {
  /* главные кнопки формы — полоской внизу экрана, всегда под пальцем */
  .main-actions.in-head { position: fixed; left: 0; right: 0; bottom: 0; z-index: 180; margin: 0; width: auto; background: #fff;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 16px rgba(16, 24, 40, .14); flex-wrap: nowrap; gap: 6px; }
  .main-actions.in-head .btn { flex: 1 1 auto; justify-content: center; white-space: nowrap; font-size: 14px; padding: 0 10px; }
  .main-actions.in-head .btn.ghost, .main-actions.in-head a.btn:not(.primary) { flex: 0 1 auto; }
  .nav-open .main-actions.in-head { display: none; }
}
@media (max-width: 760px) {
  .main-actions.in-head a.btn.ghost { display: none; }  /* «Отмена» на телефоне — кнопка «назад» */
  .main-actions.in-head .btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 760px) {
  /* главная: цифры — по две в ряд, компактнее */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .stat { padding: 12px; }
  .stat .small, .stat small { font-size: 11px; }
}

/* авиаотправка: «Платим авиакомпании» — три суммы в ряд и итог строкой; «Берём с клиента» — скрыто (18.10.2026) */
.air-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.air-money .field { min-width: 0; }
.air-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 10px 14px; border-radius: 10px;
  background: rgba(19, 97, 77, .06); border: 1px solid rgba(19, 97, 77, .18); }
.air-total-l { font-size: 13px; color: var(--muted); }
.air-total b { font-size: 18px; color: var(--text); }
.air-total [data-air-formula] { flex: 1 1 100%; }
.air-profit { min-height: 42px; display: flex; align-items: center; padding: 0 12px; border: 1px dashed var(--line-strong); border-radius: 8px; font-weight: 600; }
@media (max-width: 760px) { .air-money { grid-template-columns: minmax(0, 1fr); } }
.form-grid > .air-money, .form-grid > .air-total { grid-column: 1 / -1; }
.fsec > .air-money, .fsec > .air-total, .fsec > .check-card.wide { grid-column: 1 / -1; }

/* вагонная отправка: доход − расходы = прибыль по этой отправке */
.trip-profit { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); background: #fafbfc; }
.trip-profit > div { flex: 1 1 140px; display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.trip-profit span { font-size: 12px; color: var(--muted); }
.trip-profit b { font-size: 18px; }
.trip-profit .good b { color: var(--ok); }
.trip-profit .bad b { color: var(--danger); }

/* бирки авиа: правка перед печатью — поля и бирка как на наклейке (152,4 × 101,6, горизонтально) */
.lbl-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .lbl-edit { grid-template-columns: minmax(0, 1fr); } }
/* 26.10.2026: шрифт бирки крупнее и жирнее — как в печати (air_docs.labels_pdf) */
.lbl-preview { aspect-ratio: 152.4 / 101.6; display: grid; grid-template-columns: 69% 31%; border: 2px solid #111; background: #fff; color: #111;
  font-family: Arial, sans-serif; container-type: inline-size; }
.lp-left { display: grid; grid-template-rows: 22fr 20fr 19fr 22fr 17fr; border-right: 2px solid #111; min-width: 0; }
.lp-row { border-bottom: 2px solid #111; display: flex; align-items: center; gap: 6px; padding: 0 10px; min-width: 0; overflow: hidden; }
.lp-row:last-child { border-bottom: 0; }
.lp-cap { font-weight: 700; font-size: 16px; -webkit-text-stroke: .4px #111; line-height: 1.15; flex: none; }
.lp-row b { font-size: 40px; -webkit-text-stroke: .8px #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-awb b, .lp-route b { flex: 1; text-align: center; } .lp-route b { font-size: 35px; }
.lp-pieces { justify-content: space-around; text-align: center; } .lp-pieces b { font-size: 50px; }
.lp-dest b { margin-left: auto; }
.lp-foot { flex-direction: column; justify-content: center; gap: 2px; } .lp-foot b { font-size: 16px; -webkit-text-stroke: .4px #111; }
.lp-right { display: grid; grid-template-rows: 83fr 17fr; min-width: 0; }
.lp-bar { border-bottom: 2px solid #111; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 8px 6px; gap: 4px; }
.lp-bars { width: 90%; flex: 1; background: repeating-linear-gradient(90deg, #111 0 2px, #fff 2px 4px, #111 4px 5px, #fff 5px 8px, #111 8px 11px, #fff 11px 12px); }
.lp-digits { font-size: 10px; font-weight: 700; letter-spacing: 2px; }
.lp-gross { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; } .lp-gross span { font-size: 13px; font-weight: 700; } .lp-gross b { font-size: 26px; -webkit-text-stroke: .6px #111; }
/* «Берём с клиента»: наш тариф и сбор — в ряд, итог «Нам» и прибыль — строкой (19.10.2026) */
.air-money-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fsec > .air-options { grid-column: 1 / -1; }
.air-options { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: #fff; }
.air-options [data-client-chips] { display: flex; flex-wrap: wrap; gap: 6px; }
.air-chip { border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.air-chip b { margin-left: 4px; }
.air-chip.on { border-color: var(--brand); background: rgba(19, 97, 77, .08); color: var(--brand); }
.air-chip .muted { margin-left: 6px; font-size: 11px; }
.air-total-client { background: rgba(91, 75, 160, .06); border-color: rgba(91, 75, 160, .22); }
.air-total-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; flex: 1 1 100%; }
.air-total-line b { font-size: 18px; }
@media (max-width: 760px) { .air-money-2 { grid-template-columns: minmax(0, 1fr); } }
/* «Тарифы»: наш тариф для клиента рядом с тарифом авиакомпании */
.av-client.todo .input { border-color: var(--warn); background: var(--warn-soft); }
.av-client.loss .input, .av-client.loss b { border-color: var(--danger); color: var(--danger); }
.av-client.loss .av-code { color: var(--danger); font-weight: 600; }
/* варианты по направлению: авиакомпания и маршрут, наш тариф, прибыль, «выгоднее» */
.air-options [data-client-chips] { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.air-opt { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--line-strong); background: #fff; border-radius: 10px;
  padding: 8px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.air-opt:hover { border-color: var(--brand); }
.air-opt.on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(19, 97, 77, .18); }
.air-opt.best { background: rgba(19, 97, 77, .06); }
.air-opt-h { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.air-opt-best { font-size: 11px; font-weight: 700; color: #fff; background: var(--brand); border-radius: 999px; padding: 1px 8px; }
.air-opt-r { font-size: 11px; color: var(--muted); }
.air-opt-m b { font-size: 14px; }
.air-opt-warn { font-size: 12px; color: var(--warn); }

/* Тарифы авиа: где наши тарифы (клиенту) и что не подтверждено */
.av-our-todo{border-left:4px solid #e0a100}
.av-our-h{line-height:1.5;margin-bottom:10px}
.av-our-list{display:flex;flex-direction:column;gap:8px}
.av-our-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:8px 10px;border-radius:10px;background:#fffaf0}
.av-our-row form.inline{display:inline;margin:0}
.av-our-row .muted{flex:1 1 220px}

.av-best.todo{border-color:#e0a100;background:#fffaf0}
.av-cmp .secret{display:inline-block}

/* Сравнить авиакомпании (20.10.2026): карточка лучшего + карточки по авиакомпаниям; расход и прибыль размыты */
.av-hero{border:1px solid var(--brand);background:var(--brand-soft);border-radius:12px;padding:14px 16px;margin-bottom:12px}
.av-hero.todo{border-color:#e0a100;background:#fffaf0}
.av-hero-t{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.av-hero-name{font-size:22px;font-weight:700;margin-top:2px}
.av-hero-sum{display:flex;align-items:baseline;gap:8px;margin-top:2px}
.av-hero-sum span{font-size:13px;color:var(--muted)}
.av-hero-sum b{font-size:30px;font-weight:800;font-variant-numeric:tabular-nums;color:var(--brand)}
.av-hero-s{font-size:12.5px;color:var(--muted);margin-top:4px}
.av-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px;margin-top:12px}
.av-stats>div{background:#fff;border:1px solid var(--line);border-radius:10px;padding:8px 10px}
.av-stats>div.hid{background:#f6f7f6}
.av-stats span{display:block;font-size:11px;color:var(--muted);margin-bottom:2px}
.av-stats b{font-size:15px;font-variant-numeric:tabular-nums;display:inline-block}
.av-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px}
.av-card{border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:#fff}
.av-card.best{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand-soft)}
.av-card.todo{background:#fffaf0;border-color:#f0d58a}
.av-card-h{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:15px}
.av-card-r{font-size:12px;color:var(--muted);margin-top:2px}
.av-card-sum{margin-top:8px;display:flex;align-items:baseline;gap:6px}
.av-card-sum span{font-size:12px;color:var(--muted)}
.av-card-sum b{font-size:22px;font-weight:800;font-variant-numeric:tabular-nums}
.av-card-l{font-size:12px;color:var(--muted);margin-top:4px}
.av-card-l.hid{border-top:1px dashed var(--line);padding-top:6px;margin-top:8px}
.av-card-l .secret,.av-hero-s .secret{display:inline-block}
@media (max-width:760px){.av-hero-sum b{font-size:26px}.av-cards{grid-template-columns:1fr}}

/* авиаотправка: сделка с клиентом (20.10.2026) */
.air-deal{border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:#f7f5fc}
.form-grid > .air-deal, .fsec > .air-deal{grid-column:1/-1}
.air-deal-main{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 12px}
.air-deal-main b{font-size:24px;font-weight:800;font-variant-numeric:tabular-nums;color:var(--text);display:inline-block}
.air-deal-main .small{flex:1 1 100%}
.air-deal-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:10px}
.air-deal-row>div{background:#fff;border:1px solid var(--line);border-radius:10px;padding:8px 10px}
.air-deal-row span{display:block;font-size:11px;color:var(--muted);margin-bottom:2px}
.air-deal-row b{font-size:16px;font-variant-numeric:tabular-nums;display:inline-block}
@media (max-width:760px){.air-deal-row{grid-template-columns:1fr}}

.air-opt-loss{color:var(--danger)}
.air-opt.loss{opacity:.75}

.btn-menu-list.wide{min-width:340px}
.btn-menu-sep{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);padding:8px 10px 2px;border-top:1px solid var(--line);margin-top:4px}
.btn-menu-sep:first-child{border-top:0;margin-top:0}

.av-logo{height:22px;width:auto;max-width:90px;margin-right:10px;vertical-align:middle;object-fit:contain}
.av-hero-name .av-logo{height:30px;max-width:120px}

.air-fold-h{cursor:pointer;user-select:none}
.air-fold-arrow{display:inline-block;color:var(--muted);transition:transform .15s}
.air-fold-h.open .air-fold-arrow{transform:rotate(90deg)}
.air-fold-body{grid-column:1/-1}
.air-fold-body>.air-money{margin-top:4px}

/* Тарифы МГ */
.av-mg-bar{display:flex;flex-wrap:wrap;gap:8px;padding:10px 12px;border-bottom:1px solid var(--line)}
.av-mg-bar .input{max-width:260px}
.av-mg th .av-logo{height:18px;margin-right:6px}
.av-mg td,.av-mg th{white-space:nowrap;vertical-align:top}
.av-mg-cell .av-rate{width:96px;text-align:right}
.av-mg-cell.best{background:#eef6f1}
.av-mg-cell.todo .av-rate{border-color:#e0a100;background:#fffaf0}
.av-mg-cell .secret{display:inline-block}

.av-who{display:flex;flex-wrap:wrap;gap:6px}
.av-who-chip{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:10px;padding:6px 10px;background:#fff;min-width:220px}
.av-who-chip.best{border-color:var(--brand);background:#eef6f1}
.av-who-chip .av-logo{height:18px;margin:0;max-width:70px}
.av-who-n{font-weight:600;font-size:13px}
.av-mg td{white-space:normal}

.table.reg th.pin-0,.table.reg td.pin-0{width:28px;text-align:center}

.btn.danger-ghost{color:var(--danger)}
.btn.danger-ghost:disabled{color:inherit}

/* заявка контейнера: «Инфо по контейнеру» заметно сверху бланка; логотип — только на печати (22.10.2026) */
.blank-info{margin:0 14px 10px;padding:10px 12px;border:2px solid #e0a100;background:#fff6dd;border-radius:10px;font-size:14px;line-height:1.4}
.blank-info span{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#8a6a00;margin-bottom:2px}
.blank-logo{display:none}
@media print{.blank-logo.print-only{display:block;height:56px;width:auto;margin:0 0 8px}.blank-info{border-color:#000;background:#fff;-webkit-print-color-adjust:exact;print-color-adjust:exact}}

/* контейнеры: кнопки шапки в одну группу, фильтры одной ровной строкой с подписями, панель выбранных строк (22.10.2026) */
.reg-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-left:auto}
.reg-actions form{margin:0}
.reg-filters{display:flex;flex-wrap:wrap;gap:10px 12px;align-items:flex-end}
.reg-filters .rf{display:flex;flex-direction:column;gap:3px;font-size:11px;color:var(--muted)}
.reg-filters .rf span{line-height:1}
.reg-filters .rf .input{height:34px;min-width:0;font-size:13px;background:#fff;-webkit-appearance:none;appearance:none}
.reg-filters select.input{padding-right:26px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center}
.reg-filters .rf-q{flex:1 1 260px}
.reg-filters .rf-q .input{width:100%}
.reg-filters input[type=date].input{width:150px}
.reg-filters .rf-check{height:34px;display:flex;align-items:center}
.reg-filters .rf-btns{display:flex;gap:6px}
.reg-filters .rf-btns .btn{height:34px}
.reg-filters .rf-count{margin-left:auto;align-self:center}
.sel-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 16px;background:#eef6f1;border-bottom:1px solid var(--line)}
.sel-bar[hidden]{display:none}
.table.reg tr.row-picked td{background:#f3faf6}

.blank-info.bottom{margin:12px 14px 14px}
[data-addr-more][hidden],[data-addr-add][hidden]{display:none!important}

/* варианты перевозки: три метки (22.10.2026) */
.air-opt-tags,.av-card-tags{display:flex;flex-wrap:wrap;gap:4px;margin:4px 0 2px}
.air-opt-tags .tag,.av-card-tags .tag{font-size:11px}
.air-opt-sum{display:block;font-weight:700;margin-top:2px}
.air-opt.loss{opacity:.7}
.av-three{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
.av-three b{font-size:15px}

.sort-link{color:inherit;text-decoration:none;white-space:nowrap}
.sort-link:hover{color:var(--brand)}

/* оплата рейса РейлКонтиненту (23.10.2026) */
.rk-filter { padding-top: 10px; padding-bottom: 0; }
.rk-line { margin-top: 4px; }
.rk-cell { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--danger); cursor: pointer; white-space: nowrap; }
.rk-cell.on { color: #2f7a48; }
.rk-cell .check { width: 15px; height: 15px; }
/* претензия: графы бланка (23.10.2026) */
.form-pair { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.section-note { text-transform: none; letter-spacing: 0; font-weight: 400; }
.form-section [data-fill-again] { float: right; margin-top: -4px; }
.claim-fill-msg:empty { display: none; }
.claim-fill-msg.good { color: #2f7a48; }
.answer-snips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.claim-fill-msg, .answer-snips { grid-column: 1 / -1; }
.claim-fill-msg.bad { color: var(--danger); }
.air-deal-row[hidden]{display:none}
/* права по отделам (23.10.2026) */
.perm-group td { background: var(--brand-soft, #eef5f1); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--brand, #1f5e45); padding-top: 10px !important; padding-bottom: 8px !important; }

/* клиенты рейса (23.10.2026): итог отдельной строкой */
.trip-total { color: var(--text); font-weight: 600; border-top: 2px solid var(--line-strong); }
.trip-total .sub { font-weight: 400; }
.trip-row .rk-cell { font-size: 12px; }

/* реестр контейнеров (26.10.2026): длинное «Инфо по контейнеру» и примечание — 2 строки, полностью при наведении и в карточке */
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 260px; }
.table.reg td.pin-1:hover, .table.reg td.pin-1:focus-within { z-index: 40; }

/* 28.10.2026: пункты-кнопки в выпадающих меню (формы: ТТН, возврат, удалить) — как ссылки меню */
.btn-menu-list form { margin: 0; }
.btn-menu-list .menu-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px; font: inherit; color: var(--text); cursor: pointer; }
.btn-menu-list .menu-item:hover { background: var(--bg); }
.btn-menu-list .menu-item span { display: block; font-size: 12px; color: var(--muted); }
.btn-menu-list .menu-item.danger b { color: var(--danger); }
.status-actions .btn-menu-list { min-width: 260px; }

/* 28.10.2026: сообщения наёмных водителей (по ссылке) — жёлтая метка и аватар, чтобы отличать от сотрудников */
.msg.guest .msg-avatar { background: #c99a06; }
.msg-meta .msg-guest { font-size: 10px; padding: 0 5px; line-height: 16px; }

/* 28.10.2026: окно «Водители» в шапке группы — ссылка для наёмного водителя создаётся прямо в чате */
.guest-pop { position: absolute; right: 0; top: calc(100% + 6px); width: 420px; max-width: calc(100vw - 40px); background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; z-index: 30; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.guest-pop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.guest-form { display: flex; flex-direction: column; gap: 8px; }
.guest-terms { display: flex; gap: 14px; font-size: 13px; }
.guest-terms label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.guest-terms input { accent-color: var(--brand); }
.guest-new { margin-top: 10px; padding: 10px; background: var(--ok-soft); border-radius: 8px; }
.guest-link { display: flex; gap: 6px; margin-top: 6px; }
.guest-link input { flex: 1; font-size: 12px; }
.guest-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.guest-row > div:first-child { flex: 1; min-width: 0; }

/* 28.10.2026: вид реестра контейнеров под себя — «компактно» и скрытые колонки (localStorage) */
.reg-wrap.reg-dense .table.reg { font-size: 12px; }
.reg-wrap.reg-dense .table.reg td, .reg-wrap.reg-dense .table.reg th { padding: 3px 6px; line-height: 1.25; }
.reg-wrap.reg-dense .table.reg td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.reg-wrap.reg-dense .table.reg td .clamp2 { display: block; -webkit-line-clamp: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reg-wrap.reg-dense .table.reg .reg-check { width: 14px; height: 14px; }
.table.reg .col-hidden { display: none; }
.cols-pop { min-width: 280px; text-align: left; }
.cols-pop .check-line { display: block; padding: 3px 10px; cursor: pointer; }
.cols-pop .check-line:hover { background: var(--bg); border-radius: 6px; }
.cols-pop [data-cols-all] { margin: 6px 10px 0; }

/* 28.10.2026: кнопка вверху подписана по смыслу — «Свернуть меню» / «Показать меню» (владелец не находил, как свернуть) */
.menu-toggle-show { display: none; }
.menu-mini .menu-toggle-hide { display: none; }
.menu-mini .menu-toggle-show { display: inline; }

/* 30.10.2026: статусы водителя по контейнеру в чате сотрудников — зелёная плашка «Шаг N из 4» */
.msg.status .msg-body { background: #e3f4ea; border-color: #bfe3cd; }
.msg-status { color: #1d5c3c; }
.msg-status b { color: #14432b; }
/* водители в шапке группы (03.11.2026): карточка — имя, контейнер, 4 деления пути, последний статус */
.chat-head { flex: none; }
.chat-head > div:first-child { flex: 1; min-width: 0; }
.drv-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; }
.drv-sum-i { background: #f1f3f5; color: #4a5058; border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.drv-sum-i.s1, .drv-sum-i.s2, .drv-sum-i.s3 { background: #fff4d6; color: #7a5a00; }
.drv-sum-i.s4 { background: #e3f4ea; color: #1d5c3c; }
.drv-sum .btn { margin-left: auto; }
.drv-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; max-height: 196px; overflow-y: auto; }
.drv { width: 250px; border: 1px solid #ecdca6; background: #fffaf0; border-radius: 10px; padding: 7px 10px; font-size: 12px; }
.drv.done { border-color: #bfe3cc; background: #f1faf4; }
.drv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.drv-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drv-ktk { font-weight: 600; color: #7a5a00; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.drv.done .drv-ktk { color: #1d5c3c; }
.drv-bar { display: flex; gap: 3px; margin: 6px 0 4px; }
.drv-bar i { flex: 1; height: 5px; border-radius: 3px; background: #e6e8eb; }
.drv-bar i.on { background: #2f9e5e; }
.drv-st { color: #1d5c3c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drv-time { color: #8a9099; white-space: nowrap; font-size: 11px; }
@media (max-width: 700px) {  /* телефон: шапка в две строки, водители — лентой с прокруткой вбок */
  .chat-head { flex-wrap: wrap; gap: 8px; }
  .chat-head > div:first-child { flex-basis: 100%; }
  .drv-list { flex-wrap: nowrap; overflow-x: auto; max-height: none; padding-bottom: 2px; }
  .drv { flex: none; width: 210px; }
}
.guest-step { font-size: 11px; color: #1d5c3c; background: #e3f4ea; border-radius: 8px; padding: 0 6px; margin-left: 4px; }

/* 01.11.2026: прибытие, счётчик дней и причина задержки — отдельная помеченная группа столбцов */
.table.reg thead th.col-wait { background: #dff3e7; color: #17603d; }
.wait { display: inline-block; padding: 1px 7px; border-radius: 9px; background: #eceff1; color: #4a5560; font-weight: 600; white-space: nowrap; }
.wait.run { background: #ffe9b8; color: #8a5a00; }
.reg-reason { border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; padding: 1px 2px; max-width: 118px; color: var(--muted); cursor: pointer; }
.reg-reason:hover, .reg-reason:focus { border-color: var(--line-strong); background: #fff; }
.reg-reason:disabled { cursor: default; opacity: 1; }
.reg-reason[data-v="Клиент"] { background: #dcecff; color: #17497f; font-weight: 600; }
.reg-reason[data-v="Бухгалтерия"] { background: #fde2e1; color: #9b1c1c; font-weight: 600; }
.reg-reason[data-v="Авто отдел"] { background: #ffe9b8; color: #8a5a00; font-weight: 600; }

/* 02.11.2026: столбцы «Дата прибытия» и «Дней» зелёные целиком, поверх цвета строки */
.table.reg td.col-arrived .wait:not(.run) { background: #fff; }
.table.reg tbody tr td.col-arrived { background: #dff3e7; }

/* 02.11.2026: дату вывоза меняли — мелкая пометка под датой, подробности в подсказке */
.date-moved { display: block; font-size: 10.5px; line-height: 1.2; color: #b45309; font-weight: 600; cursor: help; }
.reg-dense .date-moved { display: inline; margin-left: 5px; }
