/* Төлемдер — касса филиала. Вкладки и окна берут общие классы ct-* из contracts.css. */
.py-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.py-bar input[type="search"], .py-bar input[type="date"] {
  font: inherit; font-size: 14px; padding: 9px 13px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); min-width: 200px;
}
.py-bar input[type="date"] { min-width: 150px; border-radius: var(--r-ctl); }
.py-chk { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.py-chk input { accent-color: var(--green); width: 16px; height: 16px; }
.py-sum { color: var(--ink-2); font-size: 14px; }
.py-warn { color: var(--mid); border-color: #ead7b0; background: var(--mid-bg); }

.py-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.py-table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.py-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.py-table tfoot td { font-weight: 600; border-bottom: 0; }
.py-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.py-mono { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.py-red { color: var(--low); font-weight: 600; }
.py-green { color: var(--ok); font-weight: 600; }
.py-dim { color: var(--ink-3); font-size: 13px; }
.py-err { color: var(--low); font-size: 14px; min-height: 1em; margin: 8px 0 0; }
.py-acts { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.py-acts .btn { padding: 5px 10px; font-size: 13px; }
.py-acts a.btn { text-decoration: none; }
/* Напоминание родителю: телеграм и ватсап — своими цветами, чтобы не спутать с оплатой. */
/* Ряд кнопок ученика: одинаковые круглые места, пустое место там, где кнопки нет, — столбики ровные. */
.py-acts-st { align-items: center; }
.py-acts-st > .btn:not(.btn-danger), .py-ic-slot { flex: 0 0 34px; width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.py-acts .py-ic svg { display: block; }
/* Телеграм и ватсап — отдельная пара: отступ и тонкая черта перед ней (только когда кнопка есть). */
.py-acts-st > :nth-last-child(2) { margin-left: 14px; position: relative; }
.py-acts-st:has(.py-ic) > :nth-last-child(2)::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 1px; background: #d9dde3; }
.py-acts .py-tg { color: #229ed9; }
.py-acts .py-wa { color: #1fa855; }
.py-acts .py-tg:hover { background: #e8f5fc; } .py-acts .py-wa:hover { background: #e7f7ec; }
/* Уже отправлено за сутки: значок бледный и зелёная галочка в углу. */
.py-acts .py-tg.is-sent { position: relative; opacity: 1; color: #9cc9e0; cursor: default; }
.py-acts .py-tg.is-sent::after { content: "✓"; position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; background: #1fa855; color: #fff; font: 700 10px/15px system-ui, sans-serif; text-align: center; }
.py-remind[data-remind-all] { color: #229ed9; border-color: #229ed9; display: inline-flex; align-items: center; gap: 6px; }
tr.py-del td { opacity: .45; text-decoration: line-through; }
tr.py-del td.py-acts, tr.py-del td:last-child { text-decoration: none; }
tr.py-req td { background: var(--mid-bg); }
tr.py-overdue td { background: var(--low-bg); }
tr.py-paid td { background: var(--ok-bg, #e4f4eb); }
.py-list { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
.py-list li { padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.py-mini { padding: 2px 8px; font-size: 12px; }
.py-photo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.py-photo .btn { display: inline-flex; align-items: center; gap: 6px; }
.py-photo .btn svg { width: 16px; height: 16px; }

/* окна */
.py-dlg {
  width: min(460px, calc(100vw - 32px)); padding: 20px 22px; border: 0; border-radius: 20px;
  background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
}
.py-dlg.is-wide { width: min(900px, calc(100vw - 32px)); }
.py-sched-wrap { overflow-x: auto; }
.py-dlg::backdrop { background: rgba(20, 24, 22, .32); backdrop-filter: blur(6px); }
.py-dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.py-dlg-head b { font-size: 16px; display: block; }
.py-dlg-head small { color: var(--ink-3); font-size: 13px; }
.py-x { padding: 4px 10px; }
.py-dlg .field { margin-bottom: 12px; }
.py-dlg .field input[type="number"], .py-dlg .field input[type="text"], .py-dlg .field input[type="date"], .py-dlg .field select {
  font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink);
}
.py-dlg h4 { font-size: 13px; color: var(--ink-3); margin: 14px 0 6px; font-weight: 500; }
/* История оплат по договорам: каждый договор — своим блоком. */
.py-hist-group { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.py-hist-group:first-of-type { border-top: 0; padding-top: 4px; }
.py-hist-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.py-hist-head b { font-size: 15px; }
.py-hist-head > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.py-hist-sum { display: flex; gap: 16px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.py-hist-sum b { color: var(--ink); font-size: 14px; }
.py-hist-group:not(.is-current) .py-table td { color: var(--ink-2); }
.py-dlg-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.py-sched tbody tr td:first-child { white-space: nowrap; }

/* отчёт дня */
.py-report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; max-width: 760px; }
.py-rep-head { margin: 0 0 10px; }
.py-rep th:first-child, .py-rep td:first-child { text-align: left; }
.py-sign { color: var(--ink-2); line-height: 2.2; margin-top: 18px; }
@media (max-width: 720px) {
  .py-bar input[type="search"] { min-width: 0; width: 100%; }
  .py-acts { flex-wrap: wrap; justify-content: flex-start; }
}
/* На телефоне: ЖСН, телефон и курс прячем, долг и кнопки — на виду. */
@media (max-width: 720px) {
  #py-students .py-table th:nth-child(3), #py-students .py-table td:nth-child(3),
  #py-students .py-table th:nth-child(5), #py-students .py-table td:nth-child(5),
  #py-students .py-table th:nth-child(6), #py-students .py-table td:nth-child(6) { display: none; }
  #py-journal .py-table th:nth-child(3), #py-journal .py-table td:nth-child(3),
  #py-journal .py-table th:nth-child(7), #py-journal .py-table td:nth-child(7),
  #py-journal .py-table th:nth-child(8), #py-journal .py-table td:nth-child(8) { display: none; }
}

/* тип оплаты — чипом, как в eduway: Kaspi красный, карта синий, наличные зелёный */
.py-chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.py-chip-kaspi { background: #d62b2b; color: #fff; }
.py-chip-card { background: #e8eef9; color: #2f5bb7; }
.py-chip-cash { background: var(--ok-bg); color: var(--ok); }

.py-report h4 { font-size: 13px; color: var(--ink-3); margin: 16px 0 6px; font-weight: 500; }
.py-rep-list { font-size: 13px; }
.py-alert { background: var(--low-bg); color: var(--low); padding: 10px 14px; border-radius: var(--r-ctl); font-size: 14px; margin: 0 0 12px; }
tr.py-unclosed td { color: var(--low); }
tr.py-unclosed td b { color: var(--low); }

/* Приложения договора в окне графика. */
.py-annex { margin: 0 0 10px; font-size: 13px; }
.py-annex li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.py-chip-ok { background: var(--ok-bg); color: var(--ok); }
.py-chip-low { background: var(--low-bg); color: var(--low); }
.py-chip-mid { background: var(--mid-bg); color: var(--mid); }
.py-link { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; text-align: left; }

/* ⏱ в графике оплат: нажимается, открывает подробности перерасчёта */
.py-recalc { border: 0; background: none; padding: 2px 6px; margin: -2px -6px; border-radius: 6px; font: inherit; font-weight: 600; color: var(--low); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.py-recalc:hover { background: var(--low-bg); }
.py-pop { position: fixed; z-index: 5; width: 300px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 22, 19, .18); font-size: 13px; }
.py-pop-h { font-weight: 700; margin-bottom: 8px; }
.py-pop-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.py-pop-row span { color: var(--ink-2); }
.py-pop-row.py-red b { color: var(--low); }
.py-pop-total { border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 6px; }
.py-pop-note { color: var(--ink-3); font-size: 12px; margin: 2px 0; }
.py-pop-f { color: var(--ink-3); font-size: 11.5px; margin: 8px 0; line-height: 1.4; }

.py-note { max-width: 220px; font-size: 13px; color: var(--ink-2); }
.py-note-btn { border: 0; background: none; color: var(--ink-3, #999); cursor: pointer; padding: 0 4px; font-size: 13px; opacity: .55; }
tr:hover .py-note-btn, .py-note-btn:focus-visible { opacity: 1; }
.py-note-in { width: 100%; min-width: 160px; font: inherit; padding: 4px 6px; border: 1px solid var(--line, #ccc); border-radius: 6px; }
.py-note-in.is-bad { border-color: #d33; }
.py-chip-halyk { background: #e3f3ee; color: #1f8a70; }
.py-chip-bank { background: #f4eedf; color: #8a6d1f; }

/* Топ, курс, телефоны и время — в одну строку: справа места хватает (28.11). */
.py-table td.py-nw, .py-table td.num { white-space: nowrap; }
