/* contracts.css - реестр договоров и обязательств (contracts.js), префикс ct-. Только токены дизайна v4: синий и красный
   акценты, без мятного, персикового и жёлтого. Адаптив как в handoff 06: ≤1050 планшет, ≤740 телефон. Текст не мельче 12 px. */

.ct-root{display:block;min-width:0}
.ct-loading{display:flex;gap:10px;align-items:center;justify-content:center;padding:40px 20px;margin:0;color:var(--muted);font-size:14px;background:var(--white);border:1px dashed var(--line);border-radius:22px}
.ct-muted{color:var(--muted);font-size:13px}
.ct-head-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.ct-root .pf-tabs{margin-bottom:16px}
.ct-root .pf-stat-grid{margin:0 0 18px}
/* кнопки и блоки с display из дизайна: атрибут hidden должен прятать их */
.ct-root [hidden],.ct-dialog [hidden]{display:none!important}
#dialog.ct-modal{max-width:780px}

/* Фильтры */
.ct-filters-box{margin:0 0 18px;border:1px solid var(--line);border-radius:20px;background:var(--white)}
.ct-filters-box>summary{display:flex;align-items:center;gap:8px;padding:14px 16px;font-size:13px;font-weight:750;cursor:pointer;list-style:none}
.ct-filters-box>summary::-webkit-details-marker{display:none}
.ct-filters-box[open]>summary{padding-bottom:4px}
.ct-filters{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;align-items:end;padding:8px 16px 16px}
.ct-filters.is-admin{grid-template-columns:repeat(4,minmax(0,1fr))}
.ct-filter{margin:0;min-width:0}
.ct-filter select,.ct-filter input{width:100%;padding:10px 12px;font-size:13px}
.ct-filters .button{min-height:42px;width:100%}

/* Таблица */
.ct-table td{font-size:13px}
.ct-table td small{font-size:12px}
.ct-table .tag{font-size:12px}
.ct-number{white-space:nowrap}
.ct-src{color:var(--blue)!important}
.ct-period{display:block;white-space:nowrap}
/* QA-3 BUG-302: пометка «срок истёк» под сроком - одной строкой */
.ct-overdue{display:inline-block;margin-top:4px;white-space:nowrap}
.ct-table td:first-child{min-width:170px}
.ct-parties{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.ct-arrow{color:var(--muted);display:inline-flex}
.ct-subject{display:block;line-height:1.5}
.ct-profs{line-height:1.6}
.ct-code{font-family:Menlo,Consolas,monospace;font-size:12px;color:var(--muted)}
.ct-bar{display:block;width:100%;max-width:160px;height:6px;border-radius:6px;background:var(--line);margin:6px 0 2px;overflow:hidden}
.ct-bar span{display:block;height:100%;background:var(--blue);border-radius:6px}
.ct-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.ct-danger,.ct-actions .button.secondary.ct-danger{color:var(--red);border-color:var(--red)}
.ct-actions .button.secondary.ct-danger:hover{background:var(--red);color:var(--white)}
.ct-phone{margin:0 0 18px}
.ct-phone .pep-block{margin-top:0}
.ct-foot{font-size:13px;color:var(--muted);line-height:1.6;margin:14px 0 0}

/* Диалог договора */
.ct-dialog h2{margin:4px 0 14px}
.ct-form fieldset.ct-party{border:1px solid var(--line);border-radius:16px;padding:14px 16px 16px;margin:14px 0 0;min-width:0;background:var(--white)}
.ct-form legend{font-size:13px;font-weight:750;padding:0 6px}
.ct-form .pf-form-grid+.pf-form-grid,.ct-form fieldset+.pf-form-grid{margin-top:14px}
.ct-picker{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.ct-picker .pf-field{margin:0}
.ct-picker+.pf-form-grid{margin-top:12px}
.ct-org-results{display:flex;flex-direction:column;gap:6px;max-height:220px;overflow:auto;padding:6px;border:1px solid var(--line);border-radius:12px;background:var(--paper)}
.ct-org{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;padding:10px 12px;border-radius:10px;background:var(--white);border:1px solid var(--line);font-size:13px}
.ct-org:hover,.ct-org:focus-visible{border-color:var(--blue)}
.ct-org small{font-size:12px;color:var(--muted)}
.ct-org-chosen{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0;padding:8px 12px;border-radius:12px;background:var(--blue-soft);color:var(--blue);font-size:13px;font-weight:650}
.ct-org-chosen span{color:var(--ink)}
.ct-org-chosen .wk-text-button{margin-left:auto;font-size:13px}
.ct-prof-row{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) auto;gap:10px;align-items:end;margin-bottom:10px}
.ct-prof-row .pf-field{margin:0}
.ct-prof-del{width:42px;height:42px;flex:none}

@media (max-width:1050px){
  .ct-filters,.ct-filters.is-admin{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:740px){
  /* показатели - сеткой 2 × 2 без иконок и подписей: четыре карточки во всю ширину занимали весь экран */
  .ct-root .pf-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;row-gap:8px}
  .ct-root .pf-stat{padding:12px 14px;min-height:0}
  .ct-root .pf-stat-icon,.ct-root .pf-stat small{display:none}
  .ct-root .pf-stat strong{font-size:22px}
  .ct-filters,.ct-filters.is-admin{grid-template-columns:minmax(0,1fr) minmax(0,1fr);padding:8px 12px 12px}
  .ct-filter-q,.ct-filters .button{grid-column:1 / -1}
  .ct-head-actions{justify-content:flex-start}
  .ct-head-actions .button{flex:1 1 auto}
  .ct-actions{justify-content:flex-start}
  .ct-prof-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;padding-bottom:10px;border-bottom:1px solid var(--line)}
  .ct-prof-row .pf-field:first-child{grid-column:1 / -1}
  .ct-bar{max-width:none}
}
