:root {
  --beige: #FCE7D1; --beige-soft: #FEF5EC; --coral: #E76E51; --coral-soft: #FBE3DC;
  --blue: #287482; --blue-dark: #1F5E69; --blue-soft: #DCEDEF; --green: #749568; --green-soft: #E5EDE1;
  --ink: #26302F; --ink-2: #5D6866; --line: #EADCCB; --card: #FFFFFF; --bg: #FDF6EE;
  --gold: #A6843D; --gold-soft: #F8F1DE;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 14px rgba(60, 40, 20, .06);
  --r: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Nunito, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 24px; margin: 0; font-weight: 800; }
h2 { font-size: 17px; margin: 0 0 10px; font-weight: 800; }
h3 { font-size: 15px; margin: 0 0 6px; font-weight: 700; }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }
.boot { display: grid; place-items: center; height: 100vh; } .boot img { width: 120px; opacity: .8; }

/* layout */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--beige); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; position: relative; }
.brand img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.brand-copy { flex: 1; min-width: 0; }
.brand-title { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.brand b { font-size: 17px; font-weight: 800; color: var(--blue-dark); line-height: 1.1; } .brand-copy > span { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; }
/* Soft sidebar buttons in the centre's beige and pastel turquoise palette. */
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; color: var(--ink-2); font-weight: 600; background: rgba(255, 255, 255, .28); box-shadow: inset 0 0 0 1px rgba(234, 220, 203, .5); transition: background-color .16s ease, color .16s ease; }
.nav a:hover { background: rgba(255, 255, 255, .58); color: var(--ink); }
.nav a.on { background: var(--blue-soft); color: var(--blue-dark); box-shadow: inset 0 0 0 1px #CADFE0; }
.nav a.on:hover { background: #D3E7E9; }
.nav a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.nav .ico { width: 20px; text-align: center; color: #667B6D; }
.nav .ico svg { stroke-width: 1.5; }
.nav a.on .ico { color: var(--blue); }
@media (prefers-reduced-motion: reduce) { .nav a { transition: none; } }
.side .me { margin-top: auto; padding: 10px 12px; font-size: 13px; color: var(--ink-2); }
.side .me button { margin-top: 6px; }
.main { padding: 24px 28px 60px; min-width: 0; }
.topbar { display: none; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .spacer { flex: 1; }

/* elements */
.card { min-width: 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 700; cursor: pointer; background: var(--blue); color: #fff; min-height: 40px; }
.btn:hover { background: var(--blue-dark); }
.btn.ghost { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
.btn.ghost:hover { background: var(--blue-soft); }
.btn.light { background: var(--beige-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.light:hover { background: var(--beige); }
.btn.coral { background: var(--coral); } .btn.coral:hover { background: #cf5d42; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; font-weight: 700; }
input, select, textarea { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 11px; min-height: 42px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
textarea { min-height: 90px; resize: vertical; }
label.f { display: block; margin-bottom: 12px; } label.f > span { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row > .grow { flex: 1; min-width: 160px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 0; border-radius: 999px; padding: 6px 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; font-weight: 700; font-size: 13px; }
.chip.on { background: var(--blue); color: #fff; box-shadow: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.b-lead, .b-blue { background: var(--blue-soft); color: var(--blue-dark); }
.b-warm { background: var(--gold-soft); color: var(--gold); }
.b-active, .b-green { background: var(--green-soft); color: #3E6240; }
.b-left, .b-grey { background: #F3F1EE; color: #6E6862; }
.b-coral { background: var(--coral-soft); color: #A9452C; }
.debt-row, #dashboard-unpaid .it { box-shadow: inset 3px 0 0 #E8B2A4; }
/* On narrow screens the inset stripe hugs the text and looks like a layout artefact. */
@media (max-width: 900px) {
  #dashboard-unpaid .it { box-shadow: none; }
}
.list { display: flex; flex-direction: column; }
.list .it { display: flex; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.list .it:last-child { border-bottom: 0; } .list .it .grow { flex: 1; min-width: 0; }
.empty { color: var(--ink-2); padding: 14px 2px; font-size: 14px; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); padding: 8px 10px; border-bottom: 1.5px solid var(--line); cursor: default; white-space: nowrap; }
table.t th.sort { cursor: pointer; } table.t th.sort:hover { color: var(--blue); }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--beige-soft); }
.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 800; color: var(--ink-2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }

/* stat tiles */
.stat { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; }
.stat .v { font-size: 26px; font-weight: 800; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.stat .d { font-size: 12px; font-weight: 800; margin-top: 4px; } .up { color: #4C6B41; } .down { color: #C24E33; }

/* schedule */
.lesson { margin-bottom: 14px; }
.lesson-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.lesson-head .time { font-weight: 800; color: var(--blue); font-variant-numeric: tabular-nums; }
.kid { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.kid .grow { flex: 1; min-width: 140px; }
.marks { display: flex; gap: 6px; flex-wrap: wrap; }
.mark { border: 0; border-radius: 9px; padding: 7px 10px; font-weight: 800; font-size: 13px; cursor: pointer; background: var(--beige-soft); box-shadow: inset 0 0 0 1px var(--line); }
.mark.on.present { background: var(--green); color: #fff; box-shadow: none; }
.mark.on.sick { background: var(--blue); color: #fff; box-shadow: none; }
.mark.on.excused { background: #F2B544; color: #3B2A05; box-shadow: none; }
.mark.on.noshow { background: var(--coral); color: #fff; box-shadow: none; }

/* funnel */
.funnel { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--beige-soft); border-radius: var(--r); padding: 10px; min-height: 300px; box-shadow: inset 0 0 0 1px var(--line); }
.col.drop { box-shadow: inset 0 0 0 2px var(--blue); }
.col-h { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 10px; font-weight: 800; }
.fcard { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: grab; }
.fcard .row { gap: 6px; } .fcard .mv { display: none; }

/* charts */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 190px) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bar-track { background: var(--beige-soft); border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { background: var(--blue); height: 100%; border-radius: 6px; }
.bar-row .val { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
svg.chart text { font: 11px Nunito, system-ui, sans-serif; fill: var(--ink-2); }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(38, 48, 47, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 18px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal h2 { font-size: 19px; margin-bottom: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.enroll-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.enroll-option { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--beige-soft); text-align: left; cursor: pointer; }
.enroll-option b { font-size: 15px; line-height: 1.3; }
.enroll-option:hover { background: var(--blue-soft); border-color: var(--blue); }
.enroll-option:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 480px) { .enroll-options { grid-template-columns: 1fr; } }
#toast-root { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow); max-width: 90vw; }
.toast.warn { background: var(--coral); } .toast.ok { background: var(--green); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--beige); }
.auth .card { width: min(400px, 100%); padding: 28px; }
.auth img { width: 110px; display: block; margin: 0 auto 8px; }
.auth h1 { text-align: center; margin-bottom: 4px; } .auth p { text-align: center; margin: 0 0 18px; }
.err { color: #C24E33; font-weight: 700; margin: 6px 0 10px; }

.notice { background: var(--coral-soft); color: #8A3A26; border-radius: 12px; padding: 10px 14px; font-weight: 700; margin-bottom: 14px; }
.info { background: var(--blue-soft); color: var(--blue-dark); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }

/* mobile */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 39; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--beige); position: sticky; top: 0; z-index: 30; }
  .topbar img { width: 34px; height: 34px; object-fit: contain; } .topbar b { font-weight: 800; color: var(--blue-dark); }
  .burger { display: none; }
  .main { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; }
  .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 21px; }
  .funnel { grid-template-columns: 1fr; } .col { min-height: 0; } .fcard { cursor: default; } .fcard .mv { display: flex; }
  table.t.cards thead { display: none; }
  table.t.cards, table.t.cards tbody, table.t.cards tr, table.t.cards td { display: block; width: 100%; }
  table.t.cards tr { background: #fff; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 10px; padding: 8px 12px; }
  table.t.cards td { border: 0; padding: 3px 0; }
  table.t.cards td[data-l]::before { content: attr(data-l) ": "; color: var(--ink-2); font-size: 13px; font-weight: 700; }
  .bar-row { grid-template-columns: 1fr auto; } .bar-row .bar-track { grid-column: 1 / -1; order: 3; }
}

/* фото детей */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ph-grid figure { margin: 0; background: var(--beige-soft); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.ph-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--line); }
.ph-grid figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 8px; font-size: 12px; font-weight: 700; min-width: 0; }
.ph-grid figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* сообщения */
.nbadge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.nav a.on .nbadge { background: #fff; color: var(--coral); }
/* есть непрочитанные — пункт «Сообщения» подсвечен коралловым и коротко «подпрыгивает» при новом сообщении */
.nav a.has-new:not(.on) { background: rgba(231, 110, 81, .14); color: var(--coral); box-shadow: inset 3px 0 0 var(--coral); }
.nav a.pulse .nbadge { animation: nb-pulse 1s ease-in-out 3; }
@keyframes nb-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .nav a.pulse .nbadge { animation: none; } }
.burger { position: relative; } .nbadge.dot { position: absolute; top: 4px; right: 4px; min-width: 10px; width: 10px; height: 10px; padding: 0; }
.ch { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; flex: none; vertical-align: middle; }
h3 .ch { width: 26px; height: 26px; font-size: 10px; }
.ch-app { background: var(--coral); } .ch-telegram { background: #2AABEE; } .ch-facebook { background: #1877F2; } .ch-instagram { background: linear-gradient(45deg, #F58529, #DD2A7B 55%, #8134AF); } .ch-whatsapp { background: #25D366; }
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; height: calc(100vh - 150px); min-height: 460px; }
.ilist { display: flex; flex-direction: column; min-height: 0; padding: 12px; }
.convs { overflow: auto; min-height: 0; margin: 0 -6px; }
/* поиск в «Сообщениях» */
.isearch { display: flex; gap: 6px; } .isearch input { flex: 1; min-width: 0; } .isearch .btn.on { background: var(--blue-soft); }
.iflt { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.iflt[hidden] { display: none; }
.iflt-row { display: flex; gap: 6px; align-items: center; } .iflt-row span { width: 22px; } .iflt-row input { flex: 1; min-width: 0; }
.isfound { margin: 0 2px 6px; }
.conv-hit { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
mark { background: #FCE7D1; color: inherit; border-radius: 3px; padding: 0 1px; }
.msg.out .bub mark { background: rgba(255,255,255,.35); }
.msg.jumped .bub { box-shadow: 0 0 0 3px #E76E51; }
.conv { display: flex; gap: 10px; align-items: center; padding: 10px 8px; border-radius: 12px; color: var(--ink); min-width: 0; }
.conv:hover { background: var(--beige-soft); } .conv.on { background: var(--blue-soft); }
.conv.new b { color: var(--blue-dark); }
.conv .grow { min-width: 0; flex: 1; } .row-b { display: flex; justify-content: space-between; gap: 8px; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; min-height: 0; padding: 12px 14px; }
.th-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.th-head .grow { flex: 1; min-width: 120px; } .th-back { display: none; }
.msgs { flex: 1; overflow: auto; min-height: 0; padding: 12px 2px; display: flex; flex-direction: column; gap: 8px; }
.msg { display: flex; flex-direction: column; max-width: 78%; } .msg.in { align-self: flex-start; } .msg.out { align-self: flex-end; align-items: flex-end; }
.bub { padding: 9px 12px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; }
.msg.in .bub { background: var(--beige-soft); border-bottom-left-radius: 4px; } .msg.out .bub { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg.out .bub a { color: #fff; text-decoration: underline; }
.bub img { max-width: 240px; max-height: 260px; border-radius: 10px; display: block; margin-bottom: 4px; }
.msg .meta { font-size: 11px; color: var(--ink-2); margin: 2px 6px 0; }
/* реакция клиента на сообщение (как в Telegram: «таблетка» с эмодзи у края пузыря) */
.react { align-self: flex-start; margin: -6px 8px 0; padding: 1px 7px; border-radius: 999px; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.08);
  font-size: 15px; line-height: 1.5; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; position: relative; }
.msg.out .react { align-self: flex-end; }
.react[hidden] { display: none; }
/* своя реакция и кнопка выбора */
.bub-row { display: flex; align-items: center; gap: 4px; position: relative; } .msg.out .bub-row { flex-direction: row-reverse; }
.react.mine { background: var(--blue-soft); border-color: var(--blue-soft); cursor: pointer; }
.rbtn { border: 0; background: none; font-size: 16px; line-height: 1; padding: 4px; border-radius: 999px; cursor: pointer; opacity: .35; flex: none; }
.msg:hover .rbtn, .rbtn:focus { opacity: 1; } @media (hover: none) { .rbtn { opacity: .6; } }
.rpick { position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 5; display: flex; flex-wrap: wrap; gap: 2px; max-width: 260px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.rpick button { border: 0; background: none; font-size: 20px; padding: 4px 5px; border-radius: 8px; cursor: pointer; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.rpick button:hover { background: var(--beige-soft); }
.composer { display: flex; gap: 8px; align-items: flex-end; padding-top: 10px; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; min-height: 44px; }
/* панель клиента рядом с перепиской */
.inbox.has-thread { grid-template-columns: 300px minmax(0, 1fr) 340px; }
.cpanel { min-height: 0; overflow: auto; padding: 12px 14px; }
.cp-toggle { display: none; }
.cp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; } .cp-close { display: none; }
.cp-sec { padding: 10px 0; border-bottom: 1px solid var(--line); } .cp-sec:last-child { border-bottom: 0; }
.cp-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); margin-bottom: 6px; }
.cp-name { font-size: 18px; font-weight: 800; color: var(--blue-dark); }
.cp-contacts { margin-top: 8px; display: grid; gap: 3px; }
.cp-match { margin: 6px 0 4px; }
.cp-it { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; font: inherit; }
.cp-kid { padding: 6px 0; } .cp-kid + .cp-kid { border-top: 1px dashed var(--line); } .cp-sub { margin-top: 3px; color: var(--ink-2); }
.cp-more summary { cursor: pointer; color: var(--blue-dark); margin-top: 6px; }
.cp-task { display: flex; gap: 8px; align-items: center; padding: 4px 0; cursor: pointer; } .cp-task input { width: auto; min-height: 0; }
.cp-note { background: var(--beige-soft); border-radius: 10px; padding: 7px 9px; margin-top: 6px; white-space: pre-wrap; }
.cp-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.cpanel .f { margin-bottom: 8px; }
/* ноутбук: панель выезжает справа по кнопке «👤 Клиент» */
@media (max-width: 1350px) {
  .inbox.has-thread { grid-template-columns: 300px minmax(0, 1fr); }
  .cp-toggle, .cp-close { display: inline-flex; }
  .cpanel { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100vw); z-index: 60; border-radius: 0; box-shadow: -8px 0 30px rgba(0, 0, 0, .15);
    transform: translateX(105%); transition: transform .2s ease; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .inbox.cp-open .cpanel { transform: none; }
}
.sel { user-select: all; word-break: break-all; }
@media (max-width: 900px) {
  .inbox { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .inbox.has-thread { grid-template-columns: minmax(0, 1fr); }
  .cpanel { width: 100vw; }
  .inbox.has-thread .ilist { display: none; } .inbox:not(.has-thread) .thread { display: none; }
  .inbox.has-thread .thread { height: calc(100dvh - 130px); }
  .inbox-head.has-thread { display: none; }
  .th-back { display: inline-flex; }
  .msg { max-width: 88%; }
}

.site-link { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--blue); }
.site-link:hover { text-decoration: underline; }
.site-link.top { margin: 0 0 0 auto; font-size: 14px; padding: 8px 12px; background: #fff; border-radius: 10px; box-shadow: var(--shadow); }

.imp-box { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 2px 0 12px; border-radius: 12px; background: var(--beige-soft); border: 1px dashed var(--line); cursor: pointer; }
.imp-box input { width: 20px; min-height: 20px; margin-top: 2px; flex: none; }

/* Телефон: окна по видимой высоте экрана (без панели Safari), кнопки всегда видны внизу окна */
.modal { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.modal .actions { position: sticky; bottom: -20px; background: #fff; padding: 12px 0 4px; margin-bottom: -4px; border-top: 1px solid var(--line); z-index: 2; }
@media (max-width: 900px) {
  .modal-bg { align-items: end; padding: 0; padding-top: max(12px, env(safe-area-inset-top)); }
  .modal { width: 100%; border-radius: 18px 18px 0 0; max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px - env(safe-area-inset-top)); padding: 18px 16px 0; }
  .modal .actions { bottom: 0; margin-bottom: 0; padding: 10px 0 calc(12px + env(safe-area-inset-bottom)); }
  .modal .actions .btn { flex: 1; min-height: 46px; }
  .main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .inbox.has-thread .thread { height: calc(100dvh - 130px - env(safe-area-inset-bottom)); }
}
@media (max-width: 900px) {
  /* все вкладки видны сразу: переносятся на вторую строку, без скрытой прокрутки */
  /* на телефоне вкладки — одна полоса, листается пальцем вбок; активная видна целиком */
  .tabs { flex-wrap: nowrap; overflow-x: auto; gap: 6px; border-bottom: 0; margin: 0 -14px 14px; padding: 2px 14px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; scroll-snap-align: start; }
  .tabs button { padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px; margin: 0; background: #fff; }
  .tabs button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.list.visits .it { flex-wrap: wrap; } .list.visits .grow { min-width: 0; }
@media (max-width: 900px) { table.t:not(.cards) { display: block; overflow-x: auto; } }

/* специалисты */
.spec { font-size: 13px; font-weight: 700; color: var(--ink-2); } .spec.sub { color: #A9452C; }
.spec-card { display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
.spec-card:hover { box-shadow: 0 0 0 2px var(--blue-soft), var(--shadow); }
.spec-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.spec-nums div { background: var(--beige-soft); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; }
.spec-nums b { font-size: 17px; font-variant-numeric: tabular-nums; } .spec-nums span { font-size: 11px; color: var(--ink-2); font-weight: 700; }
.sp-day { padding: 8px 0; border-top: 1px solid var(--line); } .sp-day:first-of-type { border-top: 0; }
.sp-day.today .sp-date { color: var(--coral); }
.sp-date { font-size: 13px; font-weight: 800; color: var(--ink-2); margin-bottom: 4px; }
.sp-l { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 3px 0; font-size: 14px; } .sp-l .grow { flex: 1; min-width: 140px; }
.sp-dir { flex-wrap: wrap; } .sp-dir .grow { flex: 1; min-width: 160px; }
@media (max-width: 900px) { .tabs.page-tabs button { flex: 1; } }

/* оплата после занятия */
.pay-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.pay-row .btn.sm { padding: 6px 10px; }

/* календарь занятий в форме записи */
.cal { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: #fff; max-width: 360px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-w { font-size: 11px; font-weight: 700; color: var(--ink-2); padding: 2px 0; }
.cal-d { display: grid; place-items: center; height: 36px; border-radius: 10px; font-size: 14px; color: #b9b2a8; border: 0; background: none; }
.cal-d.on { background: var(--blue-soft); color: var(--blue-dark); font-weight: 800; cursor: pointer; }
.cal-d.on.sel { background: var(--blue); color: #fff; }

/* отметка посещения: «Не пришёл» с подписью списано / не списано */
.mark .mark-sub { display: block; font-size: 10.5px; font-weight: 700; opacity: .85; }

/* телефон: страница не ездит вбок */
html, body { overflow-x: hidden; overflow-x: clip; overscroll-behavior-x: none; }
.list .it .grow, .card { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  /* iPhone увеличивает страницу при нажатии на поле мельче 16px — и она потом гуляет */
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 900px) {
  /* спрятанное меню не торчит тенью у левого края */
  .side:not(.open) { box-shadow: none; visibility: hidden; }
  .side { transition: transform .2s, visibility .2s; }
}
@media (max-width: 900px) {
  /* как в приложении: страница двигается только вверх-вниз, без приближения пальцами;
     полосы вкладок и широкие таблицы листаются вбок сами по себе */
  html, body { touch-action: pan-y; }
  .tabs, table.t, .funnel, .modal { touch-action: pan-x pan-y; }
}
/* кнопки оплаты — в одну строку, одинаковой высоты */
.pay-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pay-row .btn { white-space: nowrap; }
.cal-d.on.cur { outline: 2px solid var(--blue); outline-offset: -2px; }

/* строка ребёнка: кнопки «Пришёл / Не пришёл» не налезают на текст — на телефоне уходят на свою строку */
.kid .grow { min-width: 0; }
.kid .grow .badge { white-space: normal; }
@media (max-width: 600px) { .kid .marks { width: 100%; justify-content: flex-end; } }


/* Compact workspace: primary navigation + contextual sections. */
.layout > div { min-width: 0; }
.side { overflow-y: auto; }
.nav { display: grid; gap: 6px; }
.side-brief { display: grid; gap: 8px; margin: 10px 2px 0; }
.side-brief section { background: rgba(255, 255, 255, .55); border-radius: 12px; padding: 8px 10px; box-shadow: inset 0 0 0 1px rgba(234, 220, 203, .75); }
.side-brief h2 { margin: 0 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.side-brief ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-brief-item { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 4px 2px; border-radius: 8px; color: var(--ink); font-weight: 700; font-size: 13px; line-height: 1.3; }
a.side-brief-item:hover { background: rgba(255, 255, 255, .75); }
.side-brief-item .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-brief-item .meta { flex: none; color: var(--blue-dark); font-size: 12px; font-weight: 800; }
.header-brief { flex: none; }
.topbar > .header-brief { margin-left: auto; }
.brief-menu > summary { display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0; border-radius: 8px; cursor: pointer; list-style: none; }
.brief-menu > summary::-webkit-details-marker { display: none; }
.brief-menu > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.brief-count { display: inline-flex; align-items: center; gap: 3px; padding: 4px 3px; border-radius: 8px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.brief-birthday { color: #765A20; background: var(--gold-soft); box-shadow: inset 0 0 0 1px #DDCDA7; }
.brief-task { color: #A9452C; background: var(--coral-soft); box-shadow: inset 0 0 0 1px #E8B2A4; }
.brief-panel { position: absolute; top: 100%; left: 8px; right: 8px; z-index: 31; margin: 4px 0 0; padding: 8px; max-height: min(60vh, 420px); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.brief-panel .side-brief-item { align-items: flex-start; min-height: 44px; padding: 8px 2px; }
.brief-panel .who { white-space: normal; overflow-wrap: anywhere; }
.topbar .brief-panel { left: 14px; right: 14px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: #fff; border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
@media (min-width: 901px) { .tabbar, .sheet-bg { display: none !important; } }
.tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; color: var(--ink-2); font-size: 11px; font-weight: 800; padding: 4px 0 2px; position: relative; min-height: 48px; }
.tabbar a.on, .tabbar button.on { color: var(--blue-dark); }
.tabbar .nbadge { position: absolute; top: 0; right: 18%; margin: 0; min-width: 16px; height: 16px; font-size: 10px; }
.sheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(38, 48, 47, .35); display: flex; align-items: flex-end; }
.sheet { width: 100%; background: #fff; border-radius: 18px 18px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); max-height: min(80vh, 640px); overflow: auto; }
.sheet-grab { width: 40px; height: 4px; border-radius: 99px; background: var(--line); margin: 4px auto 10px; }
.sheet section { padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.sheet h3 { margin: 8px 0 2px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.sheet a { display: block; padding: 9px 2px; font-weight: 800; color: var(--ink); }
.sheet-user { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; }
.sheet-user .btn { margin-left: auto; }
.crm-search { position: relative; margin: 0 0 14px; }
.crm-search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.crm-search input { max-width: 420px; background: #fff; }
.crm-search-list { position: absolute; z-index: 20; left: 0; right: 0; max-width: 420px; top: 46px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 4px; max-height: 280px; overflow: auto; }
.crm-hit { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
a.crm-hit:hover { background: var(--beige-soft); }
.quick-actions { margin: 0 0 8px; }
.task-search { margin-bottom: 10px; }
.task-search input { max-width: 420px; }
.task-meta { display: flex; gap: 8px; align-items: center; }
@media (max-width: 700px) {
  .task-search input { max-width: none; }
  .task-row { flex-wrap: wrap; align-items: flex-start; }
  .task-row .grow { flex: 1 1 calc(100% - 36px); }
  .task-meta { width: 100%; justify-content: space-between; flex-wrap: wrap; }
}
.nav .ico { display: flex; align-items: center; justify-content: center; }
.settings-link { display: block; padding: 12px 0; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.section-nav { display: flex; gap: 22px; margin: -4px 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.section-nav:empty { display: none; }
.section-nav a { padding: 8px 0 11px; white-space: nowrap; color: var(--ink-2); font-size: 14px; border-bottom: 2px solid transparent; }
.section-nav a.on { color: var(--blue); border-bottom-color: var(--blue); font-weight: 800; }
.table-scroll { overflow-x: auto; }
.client-toolbar { margin-bottom: 14px; }
.client-toolbar #q { max-width: 420px; }
.client-age-filter { margin-bottom: 14px; }
.client-age-filter label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; flex: 0 1 160px; }
.client-age-filter .row { align-items: flex-end; }
.client-age-filter .link { margin-bottom: 10px; }
.client-age-filter p { margin: 6px 0 0; }
.status-filters { margin-bottom: 18px; gap: 6px; }
.status-filters .chip { border-radius: 7px; box-shadow: none; background: #f5f5f2; font-weight: 600; }
.status-filters .chip.on { background: var(--blue-soft); color: var(--blue-dark); }
.status-filters [data-count] { margin-left: 5px; opacity: .7; font-size: 12px; }
.direction-filter { position: relative; }
.direction-filter summary { cursor: pointer; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }
.filter-options { position: absolute; right: 0; z-index: 20; width: 310px; max-height: 380px; overflow: auto; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 12px; padding: 14px; }
.filter-options label, .check-line { display: flex; align-items: center; gap: 9px; margin: 8px 0; font-size: 14px; }
.filter-options input, .check-line input { width: 17px; min-height: 17px; flex: 0 0 17px; accent-color: var(--blue); }
.clients-table td { padding-top: 10px; padding-bottom: 10px; }
.clients-table .family-open { color: var(--ink); text-align: left; font-weight: 700; }
.clients-table .family-open:hover { color: var(--blue); text-decoration: underline; }
.clients-table td:first-child { min-width: 180px; }
.clients-table td:nth-child(4) { max-width: 260px; }
.list-pagination { margin-top: 15px; }
.spacer { flex: 1; }
.overdue { color: #ac4934; }
.client-drawer-bg { position: fixed; inset: 0; z-index: 45; background: rgba(25,40,40,.25); display: flex; justify-content: flex-end; }
.client-drawer { width: min(1060px, 93vw); height: 100%; overflow: auto; background: var(--bg); box-shadow: -12px 0 40px #26302f20; padding: 20px 24px; }
.drawer-tools { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.client-drawer .page-head h1 { font-size: 22px; }
.client-drawer .page-head { gap: 8px; }
.ad-period { margin-bottom: 20px; gap: 12px; }
.ad-period label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.ad-period input { width: 155px; min-height: 36px; padding: 6px 8px; }
.ad-stats { gap: 12px; }
.ad-stats .stat { border: 1px solid var(--line); box-shadow: none; padding: 18px; }
.ad-stats .v { margin-top: 8px; font-size: 27px; }
.ad-table-tools { margin-bottom: 12px; }
.ad-table-tools input { max-width: 240px; }
.ad-table td { padding: 14px 9px; }
.ad-table td:first-child { min-width: 200px; }
.ad-help { margin-top: 18px; max-width: 1000px; font-size: 13px; color: var(--ink-2); }
.ad-help summary { cursor: pointer; }
@media(min-width: 901px) { .layout { grid-template-columns: 210px minmax(0, 1fr); } .main { padding: 24px 24px 50px; } }
@media(max-width: 900px) { .ad-stats { grid-template-columns: repeat(2,minmax(0,1fr)); } .client-drawer { width: 100%; padding: 16px; } }
@media(max-width: 560px) { .section-nav { gap: 18px; margin-bottom: 18px; } .client-toolbar #q { max-width: none; } .filter-options { right: auto; left: 0; width: min(310px,80vw); } .ad-stats .v { font-size: 23px; } .ad-period { gap: 8px; } .ad-period input { width: 140px; } .clients-table td:first-child { min-width: 0; } .ad-table-tools input { max-width: none; } }


/* SunCity CRM: stage 4 — quicker daily work, no changes to business data. */
.dashboard-section-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 12px; }
.dashboard-section-title h2 { margin: 0; font-size: 18px; }
.dashboard-section-title p { margin: 3px 0 0; }
.dashboard-focus { margin-bottom: 22px; }
.dashboard-action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dashboard-action { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); color: var(--ink); font: inherit; }
button.dashboard-action, a.dashboard-action { cursor: pointer; }
button.dashboard-action:hover, a.dashboard-action:hover { border-color: var(--blue); background: var(--beige-soft); }
.dashboard-action span { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.dashboard-action strong { font-size: 29px; line-height: 1.2; font-variant-numeric: tabular-nums; margin: 8px 0 3px; }
.dashboard-action small { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.dashboard-action-alert { border-left: 3px solid var(--coral); }
.dashboard-action:focus-visible, .schedule-filters .chip:focus-visible,
.client-list button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
#dashboard-unpaid, #dashboard-close { scroll-margin-top: 90px; }

.schedule-intro { margin: 0 0 13px; }
.schedule-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; }
.schedule-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; }
.schedule-summary span { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.schedule-summary b { font-size: 21px; font-variant-numeric: tabular-nums; color: var(--blue-dark); }
.schedule-help { font-size: 13px; color: var(--ink-2); margin: 9px 0 0; }
.schedule-help summary { display: inline-block; cursor: pointer; color: var(--blue); font-weight: 800; }
.schedule-help p { margin: 8px 0; max-width: 820px; line-height: 1.5; }
.schedule-filters { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 10px 0 16px; }
.schedule-filters .chip { box-shadow: inset 0 0 0 1px var(--line); }
.schedule-filters .chip.on { box-shadow: none; }
.schedule-filters .chip span { opacity: .75; margin-left: 4px; font-size: 12px; }
.schedule-lesson { border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 16px; }
.schedule-lesson .lesson-head { align-items: center; gap: 8px; margin-bottom: 10px; }
.schedule-lesson .lesson-head .time { font-size: 14px; white-space: nowrap; }
.schedule-lesson .kid { gap: 12px; padding: 12px 0; }
.schedule-lesson .marks .mark { min-height: 38px; }
.schedule-lesson .pay-row { margin-top: 8px; }
.schedule-lesson .pay-row .btn.sm { min-height: 32px; }

.client-list-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.client-list-heading h2 { font-size: 18px; margin: 0 0 3px; }
.client-list-heading p { margin: 0; }
.client-list-heading .btn { flex: none; }
.client-list .client-toolbar #q { max-width: none; min-width: 230px; }
.client-list .client-toolbar { gap: 10px; }
.client-list .status-filters { margin-bottom: 11px; }
#clients-result-count { margin-bottom: 10px; }
.clients-table .client-row .family-open { font-size: 15px; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.clients-table .client-row:hover .family-open { text-decoration-color: var(--blue); }
.clients-table .client-kids { margin-top: 3px; line-height: 1.4; }
.clients-table tbody tr { transition: background .14s ease; }
.clients-table tbody tr:hover { background: var(--beige-soft); }

@media (max-width: 1100px) { .dashboard-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .dashboard-action-grid { gap: 9px; }
  .dashboard-action { padding: 13px; min-height: 110px; }
  .dashboard-action strong { font-size: 26px; margin-top: 5px; }
  .dashboard-action small { font-size: 11px; }
  .schedule-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-summary > div { padding: 9px; flex-direction: column; align-items: flex-start; gap: 2px; }
  .schedule-summary b { font-size: 20px; }
  .schedule-lesson { padding: 13px 14px; }
  .schedule-lesson .marks { justify-content: stretch; }
  .schedule-lesson .marks .mark { flex: 1; min-height: 44px; }
  .schedule-filters { overflow-x: auto; flex-wrap: nowrap; margin-right: -14px; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .schedule-filters .chip { flex: none; }
  .schedule-filters::-webkit-scrollbar { display: none; }
  .client-list-heading { align-items: center; }
  .client-list-heading .btn { margin-left: auto; }
  .client-list .client-toolbar #q { min-width: 100%; }
  .client-list .direction-filter { width: 100%; }
  .client-list .direction-filter summary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .clients-table tbody tr { transition: none; }
}


/* Quick family summary — same payment data, faster access to the right tab. */
.client-quick-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 0 0 16px; }
.client-quick-info button { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.client-quick-info button:hover { border-color: var(--blue); background: var(--beige-soft); }
.client-quick-info button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.client-quick-info span { color: var(--ink-2); font-size: 12px; font-weight: 700; }
.client-quick-info b { color: var(--blue-dark); font-size: 22px; font-variant-numeric: tabular-nums; }
.client-quick-info .client-info-alert { border-left: 3px solid var(--coral); }
.client-quick-info .client-info-alert b { color: #a9452c; }
.client-tabs-card { min-height: 240px; }
.client-delete { opacity: .8; }
.client-delete:hover { opacity: 1; }
@media (max-width: 700px) {
  .client-quick-info { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .client-quick-info button { padding: 10px 12px; }
  .client-quick-info b { font-size: 20px; }
  .client-tabs-card { padding: 14px; }
}

/* Более заметные действия в расписании: индивидуальное занятие и адаптация. */
#day-individual,
#day-adapt {
  font-weight: 900;
  font-size: 15px;
  line-height: 1.25;
}

/* Компактный минималистичный вид: меньше отступов, контент не растягивается на всю ширину. */
@media (min-width: 901px) {
  .main { padding: 18px 22px 40px; }
  .main > * { max-width: 1280px; }
}
.page-head { margin-bottom: 12px; gap: 10px; }
h1 { font-size: 22px; }
h2 { font-size: 16px; margin-bottom: 8px; }
.card { padding: 12px 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); border: 1px solid var(--line); }
.grid { gap: 12px; }
.stat { padding: 10px 14px; box-shadow: none; border: 1px solid var(--line); }
.stat .v { font-size: 22px; }
.list .it { padding: 8px 2px; }
.dashboard-focus { margin-bottom: 14px; }
.dashboard-action-grid { gap: 10px; }
.dashboard-action { padding: 10px 14px; border-radius: 12px; box-shadow: none; }
.dashboard-action strong { font-size: 24px; margin: 4px 0 2px; }
.btn { min-height: 36px; padding: 7px 12px; }
input, select { min-height: 38px; padding: 7px 10px; }
label.f { margin-bottom: 10px; }

/* A client card is clickable without aiming at the name; controls remain independent. */
.clients-table .client-row { cursor: pointer; }
.clients-table .client-row:focus-within { outline: 2px solid var(--blue); outline-offset: -2px; }

/* Кейтана: отдельный формат дня и запись на несколько дат. */
.camp-modal { width: min(720px, 100%); }
.camp-child-fixed { margin-top: 0; }
.camp-formats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border: 0; padding: 0; margin: 14px 0 18px; min-width: 0; }
.camp-formats legend { padding: 0 0 6px; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.camp-format { display: flex; align-items: flex-start; gap: 8px; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px; cursor: pointer; min-width: 0; }
.camp-format:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.camp-format-closed { opacity: .6; cursor: default; }
.camp-format input { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; margin: 3px 0 0; accent-color: var(--blue); }
.camp-format > span { display: grid; gap: 3px; font-size: 13px; min-width: 0; }
.camp-format b { font-size: 14px; }
.camp-format strong { color: var(--blue-dark); }
.camp-calendar-head, .camp-selected-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 5px; }
.camp-calendar-head h3, .camp-selected-head h3 { margin: 0 auto 0 0; }
.camp-help { margin: 6px 0 10px; }
.camp-month-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 12px 0 7px; }
.camp-month-nav strong { text-transform: capitalize; }
.camp-weekdays, .camp-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.camp-weekdays { margin-bottom: 5px; text-align: center; font-size: 12px; color: var(--ink-2); }
.camp-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 49px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; padding: 4px 2px; color: var(--ink); }
.camp-day b { font-size: 15px; }
.camp-day small { font-size: 11px; line-height: 13px; min-height: 13px; }
.camp-day.camp-holiday { background: var(--gold-soft); border-color: #D8BC7E; }
.camp-day.camp-selected { background: var(--blue); color: white; border-color: var(--blue); box-shadow: inset 0 0 0 1px white; }
.camp-day.camp-booked { background: var(--green-soft); border-color: var(--green); color: var(--ink); cursor: default; opacity: 1; }
.camp-day[aria-current="date"] b { text-decoration: underline; text-underline-offset: 3px; }
.camp-day:focus-visible, .camp-format:focus-within, .camp-search-result:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.camp-day:not(:disabled):hover { outline: 2px solid var(--blue); outline-offset: -2px; }
.camp-legend { display: flex; gap: 8px 14px; flex-wrap: wrap; margin-top: 9px; font-size: 12px; color: var(--ink-2); }
.camp-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.camp-swatch { width: 12px; height: 12px; display: inline-block; border-radius: 3px; }
.camp-swatch.camp-holiday { background: var(--gold-soft); border: 1px solid #D8BC7E; }
.camp-swatch.camp-selected { background: var(--blue); }
.camp-swatch.camp-booked { background: var(--green-soft); border: 1px solid var(--green); }
.camp-existing { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.camp-existing:empty { display: none; }
.camp-days { display: grid; gap: 7px; }
.camp-day-row { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(0, 1.6fr) auto; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.camp-day-row > b { font-size: 13px; }
.camp-day-row select { font-size: 13px; min-width: 0; }
.camp-day-row button { min-width: 32px; }
.camp-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); margin-top: 12px; color: var(--blue-dark); }
.camp-total strong { font-size: 19px; text-align: right; }
.camp-search-results { max-height: 180px; overflow: auto; }
.camp-search-result { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
@media (max-width: 480px) {
  .camp-modal { padding: 17px 14px; }
  .camp-formats { gap: 7px; }
  .camp-format { padding: 9px 7px; gap: 5px; }
  .camp-format b { font-size: 13px; }
  .camp-weekdays, .camp-calendar { gap: 4px; }
  .camp-day { min-height: 45px; }
  .camp-day-row { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; }
  .camp-day-row > b { grid-column: 1; }
  .camp-day-row select { grid-row: 2; grid-column: 1 / -1; }
  .camp-day-row button { grid-row: 1; grid-column: 2; }
}

.day-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.day-actions .btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 8px; white-space: nowrap; overflow: hidden; font-size: 14px; }
.day-actions .btn span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .day-actions .btn { font-size: 13px; gap: 4px; padding: 6px 4px; } }

/* Юлианна: компактное расписание, крупные действия и ясные оплаты. */
.schedule-kid { display: grid; grid-template-columns: minmax(0,1fr) auto 44px; gap: 8px 12px; padding: 12px 0; align-items: center; }
.kid-info { min-width: 0; }
.kid-identity { display: flex; align-items: center; gap: 6px; font-size: 17px; line-height: 1.3; }
.kid-pin { font-size: 13px; }
.kid-parent { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 2px 0; }
.kid-parent a { color: inherit; }
.kid-payment { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; }
.payment-status { border: 0; background: transparent; padding: 4px 0; color: var(--ink-2); font-size: 13px; line-height: 1.4; text-align: left; cursor: pointer; min-height: 32px; }
.payment-status.payment-attention { color: #8B4C21; font-weight: 700; }
.payment-status.payment-paid { color: #3E6240; }
.schedule-kid .marks { display: flex; gap: 8px; width: auto; }
.schedule-kid .mark { min-height: 44px; min-width: 100px; padding: 9px 12px; font-size: 14px; }
.kid-menu { position: relative; flex: none; margin-left: auto; }
.kid-menu > summary { display: flex; justify-content: center; align-items: center; width: 44px; height: 44px; padding: 0; list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-2); background: var(--card); font-size: 24px; line-height: 1; }
.kid-menu > summary::-webkit-details-marker { display: none; }
.kid-menu[open] > summary { color: var(--blue-dark); background: var(--blue-soft); }
.kid-menu > div { position: absolute; right: 0; top: calc(100% + 5px); z-index: 25; width: min(260px,75vw); padding: 5px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.kid-menu > div > button { display: block; width: 100%; min-height: 44px; text-align: left; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; font-size: 14px; white-space: normal; }
.kid-menu > div > button:hover { background: var(--beige-soft); }
.payment-review { display: grid; grid-template-columns: 86px minmax(0,1fr); gap: 8px 12px; padding: 14px; margin-bottom: 18px; border-radius: 12px; background: var(--beige-soft); align-items: baseline; overflow-wrap: anywhere; }
.payment-amount { font-size: 23px; color: var(--blue-dark); }
.child-overviews { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); gap: 12px; margin: 0 0 16px; }
.child-overview { padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.child-overview h2 { margin: 0 0 8px; font-size: 18px; color: var(--blue-dark); }
.child-overview-sub { display: grid; gap: 3px; margin-bottom: 12px; font-size: 14px; }
.child-overview-sub + .child-overview-sub { border-top: 1px solid var(--line); padding-top: 10px; }
.child-overview-sub > span { overflow-wrap: anywhere; }
.overview-paid { color: #3E6240; font-weight: 700; }
.overview-unpaid { color: #8B4C21; font-weight: 700; }
.chat-quick-actions { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 8px 2px 4px; }
.chat-quick-actions button { min-height: 36px; }
.draft-hint { display: block; min-height: 16px; padding: 3px 2px; color: var(--ink-2); font-size: 12px; }
.template-choice { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; padding: 12px; color: var(--ink); }
.payment-status:focus-visible, .kid-menu > summary:focus-visible, .kid-menu button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.kid-menu:has(button:focus-visible) > div { outline: 1px solid var(--blue); }
@media (max-width: 900px) {
  .schedule-kid { grid-template-columns: minmax(0,1fr) 44px; grid-template-areas: 'info menu' 'marks marks'; gap: 7px 8px; padding: 12px 0; }
  .schedule-kid .kid-info { grid-area: info; }
  .schedule-kid > .kid-menu { grid-area: menu; align-self: start; }
  .schedule-kid .marks { grid-area: marks; width: 100%; }
  .schedule-kid .mark { flex: 1; min-width: 0; min-height: 44px; }
  .kid-payment .btn { min-height: 40px; padding: 7px 10px; }
  .child-overviews { grid-template-columns: 1fr; gap: 8px; }
  .child-overview { padding: 12px 14px; }
  .modal select, .modal input, .modal textarea { font-size: 16px; min-height: 44px; }
  .modal .actions .btn { min-height: 44px; }
  .chat-quick-actions { gap: 6px 16px; }
}


.record-menu { display: inline-block; vertical-align: middle; margin-left: 6px; text-align: left; }
.record-menu > summary { width: 36px; height: 36px; }
.schedule-kid .kid-info > .small { margin-top: 3px; }
.child-overview > .link { min-height: 36px; }
.kid-menu > div > button:focus-visible { outline-offset: -2px; }
@media (max-width: 900px) {
  .schedule-kid:not(:has(> .kid-menu)) .kid-info { grid-column: 1 / -1; }
  .record-menu > summary { width: 44px; height: 44px; }
}


/* Compact working views: keep controls readable, reduce repeated panels. */
.compact-section { border-top: 1px solid var(--line); margin-top: 12px; }
.compact-section > summary { cursor: pointer; padding: 12px 2px; min-height: 44px; font-weight: 700; color: var(--blue-dark); overflow-wrap: anywhere; }
.compact-section > div { padding: 2px 0 12px; }
.compact-section > summary:focus-visible, .kid-extra > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.kid-extra { margin-top: 3px; }
.kid-extra > summary { color: var(--ink-2); font-size: 13px; cursor: pointer; padding: 5px 0; }
.kid-extra > div { padding: 4px 0; }
.schedule-lesson { padding: 12px 14px; margin-bottom: 12px; }
.schedule-lesson .lesson-head { gap: 6px 10px; margin-bottom: 4px; }
.schedule-kid { padding-top: 9px; padding-bottom: 9px; }
.schedule-kid .kid-identity { font-size: 16px; }
.schedule-kid .payment-status { text-align: left; }
.attendance-notice { color: var(--blue-dark); margin-top: 4px; }
.payment-review .f { margin: 4px 0 8px; }
.payment-amount { font-variant-numeric: tabular-nums; }
.dashboard-work > .card { margin-bottom: 12px; }
.dashboard-work > .compact-section { margin-bottom: 12px; }
.renewal-reasons { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.dashboard-metrics .dashboard-section-title { margin-top: 0; }
.dashboard-metrics .dashboard-section-title h2 { display: none; }
@media (max-width: 600px) {
  .schedule-lesson { padding: 10px; }
  .schedule-kid { gap: 6px 8px; }
  .kid-extra > summary { min-height: 36px; display: inline-flex; align-items: center; }
  .renewal-reasons { max-width: 45%; }
}
.payment-review > .f { grid-column: 1 / -1; }
@media (min-width: 1100px) {
  .schedule-lesson .kid-extra { display: inline-block; }
}

/* Набор в ещё не запущенную группу. Не относится к оплатам и посещениям. */
.lesson-recruiting { border-color: #e7c66d; background: #fffbef; }
.b-waitlist { background: #fff0bf; color: #705316; }
.waitlist-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 12px 0; }
.waitlist-row { flex-wrap: wrap; gap: 10px; }
.waitlist-row .grow { min-width: 180px; }
.waitlist-contacts { overflow-wrap: anywhere; }
.child-waitlist { margin: 10px 0; padding: 10px; border: 1px solid #e7c66d; border-radius: 10px; background: #fffbef; }
.child-waitlist .it {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.child-waitlist .it > .grow {
  flex: 1 0 100%;
  min-width: 0;
  overflow-wrap: break-word;
}
.list .it:has(> .grow > .child-waitlist) {
  flex-wrap: wrap;
  align-items: flex-start;
}
.list .it:has(> .grow > .child-waitlist) > .grow {
  flex: 1 1 24rem;
  min-width: min(100%, 18rem);
}
