/* Кабинет куратора */

:root {
  --navy: #17294a;
  --blue: #2f62a0;
  --pale: #eef2f8;
  --gold: #a9853a;
  --text: #1f2630;
  --muted: #5d6776;
  --rule: #d3d9e2;
  --serif: "PT Serif", Georgia, serif;
  --sans: "PT Sans", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--text); background: #fff; line-height: 1.45; }
a { color: var(--blue); }
h1, h2 { font-family: var(--serif); color: var(--navy); margin: 0; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }

.wrap { max-width: 78rem; margin: 0 auto; padding: 0 1.25rem; }

.cab-head { background: var(--navy); color: #fff; }
.cab-head .wrap { display: flex; align-items: stretch; gap: 2rem; min-height: 3.2rem; }
.cab-brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--serif); font-weight: 700; white-space: nowrap; color: #fff; text-decoration: none; }
.cab-brand img { width: 2.1rem; filter: brightness(0) invert(1); }
.tabs { display: flex; flex: 1; flex-wrap: wrap; }
.tabs button { font: inherit; color: #c9d2e3; background: none; border: 0; padding: 0 0.9rem; cursor: pointer; min-height: 3.2rem; }
.tabs button:hover { color: #fff; }
.tabs button[aria-current] { color: #fff; font-weight: 700; box-shadow: inset 0 -3px 0 var(--gold); }
.who { display: flex; align-items: center; gap: 0.9rem; font-size: 0.9rem; color: #c9d2e3; white-space: nowrap; }
.who button { font: inherit; color: #fff; background: none; border: 1px solid #5f6f8c; padding: 0.25rem 0.7rem; cursor: pointer; }

.demo-flag { background: #fff6d8; border-bottom: 1px solid #d9c27a; font-size: 0.88rem; padding: 0.45rem 0; }

main { padding: 1.6rem 0 3rem; }
.view-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }

.btn { display: inline-block; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--blue); color: #fff; border: 1px solid var(--blue); padding: 0.5rem 1rem; border-radius: 2px; }
.btn:hover { background: #244d80; }
.btn.plain { background: #fff; color: var(--blue); }
.btn.plain:hover { background: var(--pale); }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; cursor: pointer; }

/* Счётчики одной строкой */
.figures { display: flex; flex-wrap: wrap; margin: 0 0 1.4rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.figures div { padding: 0.7rem 2rem 0.7rem 0; margin-right: 2rem; border-right: 1px solid var(--rule); }
.figures div:last-child { border: 0; }
.figures dt { font-size: 0.82rem; color: var(--muted); }
.figures dd { margin: 0; font-family: var(--serif); font-size: 1.7rem; line-height: 1.1; color: var(--navy); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0 1.2rem; }
.filters button { font: inherit; background: none; border: 0; padding: 0.4rem 0; cursor: pointer; color: var(--muted); }
.filters button[aria-pressed="true"] { color: var(--navy); font-weight: 700; box-shadow: inset 0 -2px 0 var(--gold); }
.filters small { font-weight: 400; color: var(--muted); }
.search { font: inherit; width: 17rem; max-width: 100%; padding: 0.4rem 0.6rem; border: 1px solid #8a94a3; border-radius: 2px; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th { text-align: left; font-weight: 400; font-size: 0.8rem; color: var(--muted); padding: 0.5rem 0.8rem 0.5rem 0; border-bottom: 1px solid var(--navy); white-space: nowrap; }
td { padding: 0.6rem 0.8rem 0.6rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr.row { cursor: pointer; }
tbody tr.row:hover { background: var(--pale); }
td.num { font-variant-numeric: tabular-nums; color: var(--muted); }
.empty { color: var(--muted); padding: 1.5rem 0; }
.table-scroll { overflow-x: auto; }

.status { white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; margin-right: 0.45rem; background: #9aa3b0; }
.status.new::before { background: var(--gold); }
.status.work::before { background: var(--blue); }
.status.meeting::before { background: var(--navy); }
.status.done::before { background: #4c8a5b; }
.status.declined::before { background: none; border: 1px solid #9aa3b0; }

/* Карточка заявки */
.back-link { display: inline-block; margin-bottom: 0.9rem; }
.card-cols { display: grid; grid-template-columns: 1fr 22rem; gap: 3rem; align-items: start; }
.data { margin: 0; }
.data div { display: grid; grid-template-columns: 10rem 1fr; gap: 1rem; padding: 0.55rem 0; border-top: 1px solid var(--rule); }
.data dt { color: var(--muted); font-size: 0.9rem; }
.data dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.side { border-top: 3px solid var(--navy); background: var(--pale); padding: 1rem 1.1rem 1.2rem; }
.side h2 { margin-bottom: 0.8rem; }

.field { margin-bottom: 0.9rem; }
.field label { display: block; font-size: 0.88rem; font-weight: 700; margin-bottom: 0.25rem; }
.field input, .field select, .field textarea { width: 100%; font: inherit; color: inherit; background: #fff; border: 1px solid #8a94a3; border-radius: 2px; padding: 0.4rem 0.55rem; }
.field textarea { min-height: 5.5rem; resize: vertical; }
.field .pair { display: grid; grid-template-columns: 1fr 7rem; gap: 0.5rem; }
.field .hint { font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1.1rem; }
.msg { font-size: 0.88rem; color: #2c6b3d; }
.msg.bad { color: #a32020; }
.narrow { max-width: 34rem; }

/* Календарь недели */
.week-nav { display: flex; align-items: center; gap: 1rem; }
.week { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--navy); }
.week > div { border-right: 1px solid var(--rule); padding: 0.6rem 0.7rem 1.2rem; min-height: 12rem; }
.week > div:last-child { border-right: 0; }
.week h2 { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); font-weight: 400; margin-bottom: 0.6rem; }
.week h2 b { display: block; font-family: var(--serif); font-size: 1.25rem; color: var(--navy); }
.week .today h2 b { box-shadow: inset 0 -3px 0 var(--gold); display: inline-block; }
.meet { display: block; width: 100%; text-align: left; font: inherit; font-size: 0.9rem; background: #fff; border: 1px solid var(--rule); border-left: 3px solid var(--blue); padding: 0.4rem 0.5rem; margin-bottom: 0.4rem; cursor: pointer; }
.meet:hover { background: var(--pale); }
.meet b { display: block; }
.meet span { color: var(--muted); }
.week .none { color: var(--muted); font-size: 0.88rem; }

.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 1.6rem; }
.report-cols h2 { margin-bottom: 0.4rem; }
td.r, th.r { text-align: right; padding-right: 0; }

/* Вход */
.login { max-width: 21rem; margin: 4rem auto; padding: 0 1.25rem; }
.login img { width: 5rem; display: block; margin-bottom: 1rem; }
.login h1 { margin-bottom: 0.3rem; }
.login p { color: var(--muted); font-size: 0.92rem; margin: 0 0 1.4rem; }
.login .btn { width: 100%; padding: 0.6rem; }
.login .demo-note { margin-top: 1.4rem; border-top: 1px solid var(--rule); padding-top: 0.9rem; }

@media (max-width: 56rem) {
  .cab-head .wrap { flex-wrap: wrap; gap: 0 1rem; }
  .tabs { order: 3; width: 100%; flex: none; overflow-x: auto; flex-wrap: nowrap; }
  .tabs button { min-height: 2.6rem; white-space: nowrap; padding: 0 0.9rem 0 0; }
  .who { margin-left: auto; }
  .cab-brand { min-height: 3rem; }
  .card-cols, .report-cols { grid-template-columns: 1fr; gap: 1.6rem; }
  .week { grid-template-columns: 1fr; }
  .week > div { border-right: 0; border-bottom: 1px solid var(--rule); min-height: 0; }
  .data div { grid-template-columns: 1fr; gap: 0.1rem; }
  .figures div { padding-right: 1.2rem; margin-right: 1.2rem; }
}

@media print {
  .cab-head, .demo-flag, .no-print { display: none !important; }
  main { padding: 0; }
}

/* Дело: материалы и обсуждение */
.dim { color: var(--muted); }
.small { font-size: 0.85rem; }
.tools { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.mine { font-size: 0.92rem; white-space: nowrap; cursor: pointer; }
.block { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--navy); }
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.8rem; }
.block .hint { font-size: 0.82rem; color: var(--muted); margin: 0.5rem 0 0; }
.block.drag { background: var(--pale); outline: 2px dashed var(--blue); outline-offset: 6px; }
.small-btn { padding: 0.3rem 0.8rem; font-size: 0.9rem; }
.files ul { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.files li a { font-weight: 700; overflow-wrap: anywhere; }
.files li button { margin-left: auto; color: var(--muted); }
.files p, .chat > p { margin: 0.3rem 0; }
.chat { max-height: 24rem; overflow-y: auto; padding-right: 0.3rem; }
.say { padding: 0.6rem 0.8rem; margin-bottom: 0.5rem; border-left: 3px solid var(--rule); background: #f7f8fa; max-width: 40rem; }
.say.own { border-left-color: var(--gold); background: var(--pale); }
.say-head { display: flex; gap: 0.7rem; align-items: baseline; margin-bottom: 0.15rem; }
.say p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.chat-form { display: flex; gap: 0.6rem; align-items: flex-end; margin-top: 0.8rem; max-width: 40rem; }
.chat-form textarea { flex: 1; font: inherit; color: inherit; border: 1px solid #8a94a3; border-radius: 2px; padding: 0.45rem 0.6rem; resize: vertical; min-height: 2.6rem; }
.side { position: sticky; top: 1rem; }
@media (max-width: 56rem) { .side { position: static; } .chat-form { flex-direction: column; align-items: stretch; } }

/* Практика */
.lead-note { max-width: 46rem; color: var(--muted); margin: 0 0 1.2rem; }
.nowrap { white-space: nowrap; }
.narrow.wide { max-width: 44rem; }
.p-back { display: inline-block; margin-bottom: 0.9rem; }
.link.danger { color: #a32020; margin-left: auto; }
.field .pair input { width: 100%; }
.tabs a.tab-link { display: flex; align-items: center; color: #c9d2e3; text-decoration: none; padding: 0 0.9rem; min-height: 3.2rem; }
.tabs a.tab-link:hover { color: #fff; }
@media (max-width: 56rem) { .tabs a.tab-link { min-height: 2.6rem; white-space: nowrap; padding: 0 0.9rem 0 0; } }
.who #change-pass { margin-right: 0.3rem; }
.danger-zone { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.danger-zone .link.danger { margin: 0; }
.danger-zone .hint { font-size: 0.82rem; color: var(--muted); margin-top: 0.35rem; }

/* Общий чат и помощник */
.chat.big { max-height: none; height: 58vh; min-height: 18rem; border: 1px solid var(--rule); padding: 0.8rem; background: #fff; max-width: 52rem; }
.chat.big .say { max-width: 46rem; }
.chat-form { max-width: 52rem; }
.say.bot { border-left-color: var(--navy); background: #f4f6fa; }
.ai-warn { max-width: 52rem; background: #fff6d8; border-left: 3px solid #c9a227; padding: 0.7rem 0.9rem; font-size: 0.9rem; margin-bottom: 1rem; }
.tabs .dot { display: inline-block; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--gold); margin-left: 0.35rem; vertical-align: super; }
.tabs .dot[hidden] { display: none; }
@media (max-width: 56rem) { .chat.big { height: 55vh; } }
.tabs button, .tabs a.tab-link { padding: 0 0.65rem; font-size: 0.93rem; }
.cab-head .wrap { gap: 1.2rem; }

/* Расход токенов помощника */
.ai-usage { max-width: 52rem; border: 1px solid var(--rule); border-top: 3px solid var(--navy); padding: 0.9rem 1rem 0.6rem; margin-bottom: 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 2rem; }
.ai-usage h2 { grid-column: 1 / -1; font-size: 1rem; margin: 0 0 0.3rem; }
.ai-usage > p { grid-column: 1 / -1; margin: 0.4rem 0 0; }
.ai-model-head { display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }
.meter { height: 0.45rem; background: #e3e7ee; margin: 0.45rem 0 0.4rem; }
.meter span { display: block; height: 100%; background: var(--blue); }
.ai-model.main .meter span { background: var(--navy); }
.ai-nums { margin: 0; display: grid; grid-template-columns: repeat(3, auto); gap: 0 1.2rem; justify-content: start; }
.ai-nums dt { font-size: 0.75rem; color: var(--muted); }
.ai-nums dd { margin: 0; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
@media (max-width: 56rem) { .ai-usage { grid-template-columns: 1fr; } .ai-nums { grid-template-columns: 1fr 1fr; } }
