/* Стилі кабінету поверх спільного app/static/style.css. */

.user-name { font-size: 0.9rem; font-weight: 600; }
.logout-form { margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-size: 0.9rem; cursor: pointer; text-decoration: underline; }

.login-card { max-width: 28rem; margin: 2rem auto; }
.login-card .btn { text-align: center; text-decoration: none; }
.dev-login { margin-top: 1.25rem; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.dev-login p { flex-basis: 100%; margin: 0; }
.dev-login input { flex: 1 1 12rem; min-height: 2.25rem; font: inherit; padding: 0.3rem 0.5rem; }
.legal { max-width: 42rem; }
.legal-links { margin-top: 1rem; font-size: 0.9rem; }

.job progress { width: 100%; height: 1.25rem; }
.job-messages, .job-errors { padding-left: 1.25rem; font-size: 0.9rem; }

/* ── звіт за місяць ─────────────────────────────────── */

.layout { grid-template-rows: auto auto auto auto 1fr; grid-template-areas: "add summary" "add report" "add expenses" "add pending" "add side"; }
.layout .report { grid-area: report; }
.layout .expenses { grid-area: expenses; }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "summary" "report" "add" "expenses" "pending" "side"; }
}

.report .card-head { flex-wrap: wrap; }
.report select { width: auto; min-height: 2.4rem; padding: 0.3rem 0.6rem; }
.report-status { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.5rem; }
.status-badge { display: inline-block; border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.85rem; font-weight: 700; }
.st-not_submitted { background: var(--surface-2); color: var(--muted); }
.st-submitted { background: var(--green-soft); color: var(--green); }
.st-late { background: var(--yellow-soft); color: #8a6100; border: 1px solid #e0a800; }
.st-needs_changes { background: var(--red-soft); color: var(--red); }
.changed-flag { background: var(--blue-soft); color: var(--blue); }
.stipend-line { margin: 0.25rem 0 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.comment { border-left: 4px solid var(--red); background: var(--red-soft); border-radius: 10px; padding: 0.5rem 0.75rem; margin: 0.5rem 0; overflow-wrap: anywhere; }
.comment p { margin: 0; }
.comment .small { margin-top: 0.2rem; }
#report-submit { margin-top: 0.75rem; }

/* ── мої витрати ────────────────────────────────────── */

.expense-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; align-items: start; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.expense-row:last-child { border-bottom: 0; }
.expense-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.expense-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.expense-flag { color: #8a6100; }

#edit-dialog { width: min(520px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow-y: auto; }
#edit-dialog form { display: grid; gap: 0.75rem; }
#edit-dialog h3 { margin: 0; }
.edit-receipt { display: grid; gap: 0.5rem; }
.edit-receipt input[type=file] { border: 0; padding: 0; min-height: 0; }
.edit-receipt p { margin: 0; overflow-wrap: anywhere; }

/* ── кабінет координатора ───────────────────────────── */

.manager-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.75rem; font-size: 0.9rem; }
.manager-nav a { font-weight: 600; }
.manager-nav span { color: var(--muted); }
.overview-head .card-head { flex-wrap: wrap; }
.overview-head h1, .card-head h1 { margin: 0; font-size: 1.35rem; }
.as-of { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.inline-form { margin: 0; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.inline-label { flex-direction: row; align-items: center; }
.inline-form select { width: auto; min-height: 2.4rem; padding: 0.3rem 0.6rem; }
.overview-filter { display: flex; gap: 0.75rem; align-items: end; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.overview-filter select { width: auto; min-height: 2.4rem; padding: 0.3rem 0.6rem; }
.overview-filter .check { flex-direction: row; align-items: center; font-weight: 500; color: var(--text); }
.overview-filter .check input { width: auto; min-height: 0; }
.counters { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.counters li { background: var(--surface-2); border-radius: 10px; padding: 0.5rem 0.75rem; display: flex; flex-direction: column; }
.counters strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.counters span { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 520px) { .counters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Таблиця прокручується горизонтально лише всередині обгортки, а не вся сторінка. */
.table-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 44rem; }
.overview-table th.num, .table-scroll th.num { text-align: right; }
.overview-table td.warn { color: #8a6100; font-weight: 700; }
.overview-table td.negative, .negative { color: var(--red); }
.row-error { color: var(--red); overflow-wrap: anywhere; }
.card-links { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0 0; }
.card-links .btn { text-decoration: none; }
.card + .card { margin-top: 1rem; }
.plain-list { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.comment-form { display: grid; gap: 0.75rem; }
.comment-form textarea { resize: vertical; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.history-item { border-left: 4px solid var(--line); padding: 0.35rem 0.75rem; overflow-wrap: anywhere; }
.history-item.history-коментар { border-left-color: var(--red); background: var(--red-soft); border-radius: 0 10px 10px 0; }
.history-item.history-подано { border-left-color: var(--green); }
.history-item.history-зміна { border-left-color: var(--blue); }
.history-head { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: baseline; }
.history-item p { margin: 0.2rem 0 0; white-space: pre-line; }

/* ── нарахування і список стипендіатів ──────────────── */

.payout-form { display: flex; gap: 0.75rem; align-items: end; flex-wrap: wrap; }
.payout-form label { flex: 1 1 10rem; }
.payout-form .btn { flex: 0 0 auto; }
.payout-confirm { margin-top: 1rem; }
.table-scroll .payout-table { min-width: 34rem; }
.cabinet-error { color: var(--red); font-weight: 600; }

/* ── демо ───────────────────────────────────────────── */

.demo-banner { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; justify-content: center; padding: 0.5rem 1rem; background: var(--yellow-soft); color: var(--text); border-bottom: 1px solid var(--yellow); font-size: 0.9rem; text-align: center; }
.demo-banner .link-button { color: var(--blue); font-weight: 600; }
.demo-login h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.demo-roles { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.demo-role { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; width: 100%; box-sizing: border-box; text-align: left; }
.demo-role-name { font-weight: 700; }
.demo-role-note { color: var(--muted); font-size: 0.85rem; }
