/* CRM: свои правила по размерам эталонов, без ресурсов МойСклада. */
.ms-crm-list .ms-crm-selected { display:inline-flex; align-items:center; justify-content:center; width:47px; height:26px; border:1px solid #ccc; border-radius:3px 0 0 3px; margin-left:0; font-size:12px; color:#555; }
.ms-crm-list .ms-crm-edit { margin-left:-1px; border-radius:0; }
.ms-crm-list .ms-list-head > .ms-btn { flex-shrink:0; }
.ms-crm-list .ms-list-range .ms-input { box-sizing:border-box; width:calc((100% - 13px)/2); text-align:right; }
.ms-crm-list .ms-list-range { display:flex; gap:4px; align-items:center; }
.ms-crm-list .ms-crm-empty { text-align:center; color:#888; height:32px; }
.ms-crm-list .ms-crm-inline-footer { position:relative; left:auto; right:auto; bottom:auto; width:var(--ms-list-width); margin-left:0; box-shadow:none; border-top:0; }
.ms-crm-list .ms-crm-inline-footer .ms-list-total-toggle { display:none; }
.ms-crm-field-menu { max-height:440px; overflow:auto; width:285px; }
.ms-crm-field-menu label { display:flex; gap:8px; padding:5px 10px; cursor:pointer; }
.ms-crm-field-menu label:hover { background:#fffb8c; }
.ms-crm-field-menu input { margin:0; }
.ms-crm-product { width:250px; }.ms-crm-product > .ms-input { width:250px; box-sizing:border-box; height:21px; }
.ms-crm-list #crm-product-folders { max-height:320px; max-width:370px; overflow:auto; }
.ms-crm-card .ms-co-toolbar > .ms-btn { box-sizing:border-box; width:100px; height:28px; }
.ms-crm-card .ms-co-doc-table th:nth-child(5) { text-align:right; padding-right:7px; }
.ms-crm-toolbar .ms-co-close { margin-right:32px; }
.ms-crm-toolbar .ms-co-changes a { color:#186999; }
.ms-crm-card .ms-co-groups > a { display:inline-block; max-width:200px; padding:0 6px; border:1px solid #c2e0f3; border-radius:10px; font:11px/13px Tahoma,Geneva,sans-serif; color:#3585b1; background:#e4f4fe; margin-right:2px; }
.ms-crm-card .ms-co-contacts > .ms-btn,.ms-crm-bank-action > .ms-btn { margin-left:10px; margin-top:8px; }
.ms-crm-side-link { font-size:11px; margin-left:4px; }
.ms-crm-address-dialog .ms-dialog-panel { width:540px; height:auto; min-height:0; }.ms-crm-address-dialog .ms-co-label { color:#555; }
.ms-crm-bank-action { margin-top:20px; }
.ms-crm-add-document { margin-top:25px; }
.ms-crm-pager { display:flex; gap:15px; align-items:center; margin:15px 0; font-size:12px; }
.ms-crm-stamp { color:#888; font-size:11px; margin:0 0 16px; }
.ms-crm-stale { color:#946900; }
.ms-crm-metrics { margin:0 0 25px; }
.ms-crm-metrics > div { display:flex; width:600px; padding:10px 0; border-bottom:1px solid #ddd; }
.ms-crm-metrics dt { width:300px; color:#888; }.ms-crm-metrics dd { margin:0; width:270px; text-align:right; font-size:16px; }
.ms-crm-event { border-top:1px solid #ddd; padding:14px 0; }.ms-crm-event time { color:#888; margin-left:12px; }.ms-crm-event p { white-space:pre-wrap; overflow-wrap:anywhere; }
.ms-crm-card .ms-crm-note { width:740px; height:75px; }
.ms-crm-event-tabs { margin:0 0 20px; }
.ms-crm-account { margin-bottom:14px; border:1px solid #ddd; padding:12px; }.ms-crm-account summary { color:#186999; cursor:pointer; }
.ms-crm-account dl { display:grid; grid-template-columns:150px 1fr; gap:10px; }.ms-crm-account dd { margin:0; }.ms-crm-account dt { color:#888; }
.ms-crm-address { margin:8px 0 8px 24px; }.ms-crm-address > summary { color:#186999; cursor:pointer; }
.ms-crm-contract { position:relative; min-width:1410px; padding-top:20px; }
.ms-crm-contract .ms-co-toolbar { width:1400px; }
.ms-crm-contract .ms-co-close { margin-right:37px; }
.ms-crm-contract .ms-co-pager { gap:8px; }
.ms-crm-contract-tools { position:absolute; top:20px; left:637px; display:flex; align-items:center; }
.ms-crm-contract-tools > .ms-btn:first-child { margin-right:28px; }
.ms-crm-contract-tools > .ms-btn:not(:first-child) { margin-right:-1px; border-radius:0; }
.ms-crm-contract-title { display:flex; gap:18px; align-items:center; margin:42px 0 8px 4px; font-size:20px; font-weight:400; height:29px; }
.ms-crm-contract-title .ms-btn { margin-left:5px; height:22px; }
.ms-crm-contract-columns { display:grid; grid-template-columns:448px 466px; gap:15px; }
.ms-crm-contract .ms-co-field { margin-bottom:10px; }
.ms-crm-contract .ms-crm-ref { box-sizing:border-box; width:228px; min-height:21px; padding:2px; border:1px solid #bfbfbf; background:#f0f0f0; }
.ms-crm-ref a { display:block; max-width:222px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ms-crm-contract .ms-co-label { width:196px; flex-basis:196px; }
.ms-crm-contract .ms-co-field:nth-child(2) { margin-top:-4px; }
.ms-crm-contract textarea.ms-input { height:70px; }
.ms-crm-contract-balance { margin:-1px 0 10px 196px; min-height:14px; font-size:12px; }
.ms-crm-reward .ms-co-control { display:flex; align-items:center; gap:5px; width:325px; }
.ms-crm-reward .ms-co-control select.ms-select { flex:none; width:250px; }
.ms-crm-reward .ms-co-control input.ms-input { width:55px; text-align:right; }
.ms-crm-contract-access { position:absolute; top:20px; left:1123px; z-index:1; }
.ms-crm-contract-access summary { color:#186999; cursor:pointer; font-size:12px; text-align:right; list-style:none; }
.ms-crm-contract-access summary small { display:block; color:#999; font-size:10px; }
.ms-crm-contract-access[open] { background:#fff; border:1px solid #ddd; padding:10px; left:975px; top:50px; }
.ms-crm-contract-access[open] summary { margin-bottom:12px; }
.ms-crm-contract .ms-co-changes { width:220px; }
/* На узком настольном окне история и владелец привязаны к видимому правому краю. */
@media screen and (max-width:1490px) {
  .ms-crm-contract { min-width:0; }
  .ms-crm-contract .ms-co-toolbar { width:100%; }
  .ms-crm-contract-tools { left:clamp(370px, calc(100% - 840px), 637px); }
  .ms-crm-contract-access { left:auto; right:160px; max-width:170px; }
  .ms-crm-contract-access summary { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  .ms-crm-contract-access[open] { left:auto; right:40px; max-width:calc(100% - 80px); }
}
@media screen and (max-width:1100px) {
  .ms-crm-contract-tools { top:58px; left:40px; }
  .ms-crm-contract-title { margin-top:80px; height:auto; flex-wrap:wrap; }
}
@media print { .ms-crm-contract-tools,.ms-crm-contract-title button,.ms-crm-card button,.ms-crm-card nav { display:none !important; } .ms-crm-list .ms-list-head-slot { display:none; } .ms-crm-list .ms-list-footer { position:static; } }
@media(max-width:900px) { .ms-crm-list .ms-list-head { flex-wrap:wrap; height:auto; gap:5px; } .ms-crm-card { min-width:1264px; } }
/* «CRM → Скидки» — как у МойСклада (живая сверка под администратором 22.10.2026): условия с x 40 (12 px, строки по 14),
   таблица с x 30: 80 + 205 + 205 + 29 px, шапка 31 px с синей чертой, строки 31 px, переключатель 24 × 13 (вкл. #3b99fc,
   выкл. #f5f5f5 с рамкой #ddd), листалка со стрелками 13 × 13: текст «1-N из N» с x 78. Условия скидки — раскрытием имени. */
.ms-disc-show { margin-left:0; }
.ms-disc-settings { box-sizing:border-box; width:37px; height:27px; padding:0; justify-content:center; }
.ms-disc-settings svg { width:16px; height:16px; }
.ms-disc-note { max-width:640px; margin:14.5px 0 0 10px; color:#222; font:12px/14px "Helvetica Neue",Helvetica,Arial,sans-serif; }
.ms-disc-log { margin-top:14px; }
.ms-disc-link { color:#186999; text-decoration:underline; cursor:default; }
.ms-disc-apps { margin:14px 0 0 10px; color:#777; }
.ms-disc-table { width:519px; margin-top:10px; border-collapse:collapse; table-layout:fixed; font:11px Tahoma,Geneva,sans-serif; color:#222; }
.ms-disc-table th { position:relative; box-sizing:border-box; height:31px; padding:0; border-bottom:2px solid #186999; font-weight:400; color:#186999; text-align:left; white-space:nowrap; }
.ms-disc-table th:first-child, .ms-disc-table td:first-child { padding-left:10px; }
.ms-disc-sort { position:absolute; top:6px; left:calc(50% - 9.5px); width:0; height:0; border:4px solid transparent; border-top:0; border-bottom-color:#849aa7; }
.ms-disc-gear button { display:flex; align-items:center; gap:1px; height:20px; padding:0 0 0 3px; border:0; background:none; color:#186999; cursor:default; }
.ms-disc-gear svg { width:9px; height:9px; }
.ms-disc-gear svg + svg { width:6px; height:6px; }
.ms-disc-table td { box-sizing:border-box; height:31px; padding:0; border-bottom:1px solid #ddd; vertical-align:middle; }
.ms-disc-table tbody tr:last-child td { border-bottom-color:#186999; }
.ms-disc-switch { box-sizing:border-box; display:block; position:relative; top:-1.5px; width:24px; height:13px; border:1px solid #ddd; border-radius:7px; background:#f5f5f5; }
.ms-disc-switch::after { content:""; position:absolute; box-sizing:border-box; top:1px; left:1px; width:9px; height:9px; border:1px solid #e0e0e0; border-radius:50%; background:#fff; }
.ms-disc-switch.on { border-color:#3b99fc; background:#3b99fc; }
.ms-disc-switch.on::after { left:12px; border-color:#fff; }
.ms-disc-details summary { cursor:pointer; color:#186999; list-style:none; }
.ms-disc-details summary::-webkit-details-marker { display:none; }
.ms-disc-details dl { display:grid; grid-template-columns:max-content 1fr; gap:3px 10px; margin:6px 0 6px; font-size:11px; color:#444; }
.ms-disc-details dt { color:#777; }
.ms-disc-details dd { margin:0; }
.ms-disc-empty { height:50px; text-align:center; color:#777; }
.ms-disc-pager { display:flex; align-items:flex-start; box-sizing:border-box; height:28px; padding-top:5px; margin-left:10px; font:11px "Helvetica Neue",Helvetica,Arial,sans-serif; color:#222; }
.ms-disc-pager > span:not(.ms-disc-range) { display:inline-flex; box-sizing:border-box; width:13px; height:13px; margin-right:4px; align-items:center; justify-content:center; border:1px solid #ddd; border-radius:1px; color:#d5d5d5; }
.ms-disc-range { width:100px; margin:0 8px 0 4px; padding-top:1.3px; text-align:center; }
@media(max-width:600px) { .ms-disc-table { width:100%; } }
