/* Модуль «Договоры»: ход договоров, реестр, карточка.
   Кегль, отступы и радиусы — только токенами (docs/ОБЛИК-И-ШКАЛЫ.md). */

.dog .table--wide { overflow-x: auto; }
.dog__card { margin-bottom: var(--s-3); padding: var(--s-4); }
.dog__card > h2 { margin: 0 0 var(--s-1); }
.dog__card > .note { margin: 0 0 var(--s-3); }
.dog__pad { padding: var(--s-2) 0; }
.dog__kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-3); }
.dog__kpis > .card + .card { margin-top: 0; }
.dog__kpi { padding: var(--s-3) var(--s-4); }
.dog__kpi-l { font-size: var(--t-sm); color: var(--text-dim); }
.dog__kpi-v { font-family: var(--mono); font-size: var(--t-xl); font-weight: 600; font-variant-numeric: tabular-nums; }
.dog__kpi-v.is-late { color: var(--late-fg); }
.dog__kpi-n { font-size: var(--t-sm); color: var(--text-dim); }

.dog__todo { display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: left; border: 0; border-top: 1px solid var(--border); background: none; padding: var(--s-2) 0; cursor: pointer; font: inherit; color: inherit; }
.dog__todo:first-child { border-top: 0; }
.dog__todo:hover:where([data-hover="mouse"] *) { background: var(--hover); }
.dog__todo-t { flex: 1; font-size: var(--t-sm); }
.dog__todo-t b { font-weight: 500; }
.dog__dot { width: 8px; height: 8px; border-radius: var(--radius-full); flex: none; }
.dog__dot--late { background: var(--late); }
.dog__dot--warn { background: var(--warn); }

/* Шкала */
.dog__tl { position: relative; }
.dog__row { display: grid; grid-template-columns: 220px 1fr; align-items: center; width: 100%; min-height: 46px; border: 0; border-top: 1px solid var(--border); background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.dog__row--head { min-height: 22px; border-top: 0; cursor: default; }
.dog__row:not(.dog__row--head):hover:where([data-hover="mouse"] *) { background: var(--hover); }
.dog__row-l { padding: var(--s-1) var(--s-3) var(--s-1) 0; font-size: var(--t-sm); min-width: 0; }
.dog__row-l b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dog__row-l small { color: var(--text-dim); }
.dog__row-r { position: relative; height: 46px; }
.dog__row--head .dog__row-r { height: 20px; }
.dog__mon { position: absolute; top: 2px; font-family: var(--mono); font-size: var(--t-xs); color: var(--text-dim); }
.dog__bar { position: absolute; top: 10px; height: 14px; border-radius: var(--radius-sm); font-size: var(--t-xs); line-height: 14px; padding-left: var(--s-1); overflow: hidden; white-space: nowrap; color: var(--text-dim); }
.dog__bar.is-done { background: color-mix(in srgb, var(--ok) 45%, var(--surface)); }
.dog__bar.is-wait { background: color-mix(in srgb, var(--warn) 45%, var(--surface)); }
.dog__bar.is-work { background: var(--accent-soft); }
.dog__bar.is-plan { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.dog__bar.is-late { background: color-mix(in srgb, var(--late) 40%, var(--surface)); }
.dog__sent { position: absolute; top: 4px; transform: translateX(-50%); font-size: var(--t-sm); color: var(--text); }
.dog__sent.is-late { color: var(--late-fg); }
.dog__rub { position: absolute; top: 28px; transform: translateX(-50%); font-family: var(--mono); font-size: var(--t-xs); font-weight: 700; color: var(--text-faint); }
.dog__rub.is-paid { color: var(--ok-fg); }
.dog__rub.is-wait { color: var(--warn-fg); }
.dog__rub.is-late { color: var(--late-fg); }
.dog__today { position: absolute; top: 0; bottom: 0; left: calc(220px + (100% - 220px) * var(--x) / 100); border-left: 1.5px dashed var(--accent); pointer-events: none; }
.dog__today span { position: absolute; bottom: calc(-1 * var(--s-4)); left: calc(-1 * var(--s-5)); font-family: var(--mono); font-size: var(--t-xs); font-weight: 600; color: var(--accent-fg); }

/* Таблицы */
.dog__table { font-size: var(--t-sm); }
.dog__table th, .dog__table td { padding: var(--s-2) var(--s-3); vertical-align: top; }
.dog__table td.num, .dog__table th.num { text-align: right; font-family: var(--mono); }
.dog__grp td { background: var(--hover); cursor: pointer; }
.dog__click { cursor: pointer; }
.dog__prog { height: 6px; border-radius: var(--radius-full); background: var(--border); overflow: hidden; min-width: 80px; margin-bottom: var(--s-1); }
.dog__prog i { display: block; height: 100%; background: var(--ok); }
.dog__table .chip { margin: 0 var(--s-1) var(--s-1) 0; }

/* Карточка: поля на месте */
.dog__title { margin: 0 0 var(--s-3); }
.dog__h1 { font-size: var(--t-2xl) !important; font-weight: 600; height: auto !important; padding: var(--s-1) var(--s-2) !important; }
.dog__in {
  width: 100%; min-width: 0; height: 32px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent;
  padding: 0 var(--s-2); font: inherit; color: var(--text);
}
.dog__in:hover:where([data-hover="mouse"] *) { border-color: var(--border); }
.dog__in:focus { outline: 0; border-color: var(--accent); background: var(--surface); }
.dog__in.num { text-align: right; font-family: var(--mono); }
select.dog__in { cursor: pointer; }
.dog__area { height: auto; padding: var(--s-1) var(--s-2); resize: vertical; line-height: 1.45; }
.dog__items { color: var(--text-dim); font-size: var(--t-sm); }
.dog__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2) var(--s-4); }
.dog__f { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dog__f > span:first-child { font-size: var(--t-xs); color: var(--text-dim); padding-left: var(--s-2); }
.dog__f--wide { grid-column: span 2; }
.dog__pair { display: flex; gap: var(--s-1); align-items: center; }
.dog__days { width: 64px; flex: none; }
.dog__size { width: 120px; flex: none; }
.dog__no { width: 80px; }
.dog__events { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: var(--s-3); }
.dog__edit td { padding: var(--s-1) var(--s-2); }
.dog__edit td:nth-child(2) { min-width: 240px; }
.dog__n { color: var(--text-dim); font-family: var(--mono); padding-top: var(--s-2) !important; }
.dog__chk { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-sm); margin: 2px 0; cursor: pointer; }
.dog__inv { display: flex; flex-wrap: wrap; gap: var(--s-1); align-items: center; }
.dog__inv .dog__in { width: auto; min-width: 90px; border-color: var(--border); }
.dog__x { border: 0; background: none; color: var(--text-faint); cursor: pointer; font: inherit; font-size: var(--t-md); padding: 0 var(--s-1); border-radius: var(--radius-sm); }
.dog__x:hover:where([data-hover="mouse"] *) { color: var(--late-fg); background: var(--hover); }
.dog__x--in { font-size: var(--t-sm); margin-left: var(--s-1); padding: 0; }
.dog__sum { margin-top: var(--s-3); font-size: var(--t-sm); color: var(--text-dim); }
.dog__del { color: var(--late-fg); }

@media (max-width: 900px) {
  .dog__grid, .dog__events { grid-template-columns: 1fr; }
  .dog__f--wide { grid-column: auto; }
  .dog__row { grid-template-columns: 130px 1fr; }
  .dog__today { left: calc(130px + (100% - 130px) * var(--x) / 100); }
}

/* Из DOCX */
.dog__modal-wide { width: min(1000px, calc(100vw - 2 * var(--s-4))); max-width: none; }
.dog__docx { max-height: 70vh; overflow: auto; }
.dog__docx .dog__card { box-shadow: none; border: 1px solid var(--border); }
.dog__docx-h { font-size: var(--t-base); margin-bottom: var(--s-2); }
.dog__docx-g { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin: var(--s-2) 0; font-size: var(--t-sm); }
.dog__warn { color: var(--warn-fg); margin: var(--s-1) 0 0; }
.dog__edit td.dog__lbl { min-width: 260px; }
.dog__edit td:nth-child(2) .dog__in:first-child { font-weight: 500; }
