/*
 * Base styles. Colours come only from tokens.css via var(--x); components are added in T0.7.
 * Type scale per design/Oblik-Design-System.md (Typography).
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Layout measures shared by both roles (owner review 2026-10-16). The page gutter lives with the shells below. */
:root {
  --row-inset: 16px; /* a row's text from its hairline's start: the record rows and the first table column */
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  /* Same as Tailwind's `antialiased` (crm): thinner glyphs on macOS, so 14 px table text does not read bold (T4.37). */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Text for screen readers only. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: inherit;
}

/* Keyboard focus. Not drawn on the boards; needed for accessibility (T0.7 design question 3). */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--body);
}

.note {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--body);
}

/* ---------------------------------------------------------------------------------------------
 * Components (T0.7). Values are measured from design/ui-round-2; the plan lists them per board.
 * ------------------------------------------------------------------------------------------- */

/* Buttons: pills. Tabs and toggles are buttons with aria-pressed or aria-current. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--soft);
  color: var(--ink);
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn--primary,
.btn[aria-pressed="true"],
.btn[aria-current="page"] {
  background: var(--primary);
  color: var(--on-primary);
}

.btn--md {
  height: 48px;
  padding: 0 20px;
}

.btn--lg {
  height: 56px;
  padding: 0 20px;
}

.btn--sm {
  height: 40px;
  font-size: 14px;
  line-height: 16px;
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--danger {
  color: var(--danger);
}

/* The large submit of the phone record form (button-large-rounded: radius 16, not a pill); also a link (ErrorPage). */
.btn-submit:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  border: none;
  border-radius: var(--radius-xl);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.icon-btn {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.icon-btn--sm {
  width: 40px;
  height: 40px;
}

/* T4.4: the 40 px controls keep their drawn size; an invisible ::after 2 px outside makes the touch target 44 px. */
.icon-btn--sm,
.btn--sm,
button.avatar {
  position: relative;
}

.icon-btn--sm::after,
.btn--sm::after,
button.avatar::after {
  content: "";
  position: absolute;
  inset: -2px;
}

.icon-btn--ghost {
  background: transparent;
  color: var(--body);
}

.icon-btn:disabled,
.icon-btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
}

.avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
}

button.avatar {
  cursor: pointer;
}

.avatar--lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
  line-height: 24px;
}

/* Status chips. */
.chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--soft);
  color: var(--ink);
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
}

.chip--success {
  background: var(--success-soft);
  color: var(--on-success-soft);
}

.chip--warn {
  background: var(--warn-soft);
  color: var(--on-warn-soft);
}

.chip--muted {
  color: var(--body);
}

/* Form fields: label, control, hint, error. */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row > .field {
  flex: 1 1 0;
}

/* Main: the date column is a little wider than the duration column. */
.field-row--date > .field:first-child {
  flex: 1.2 1 0;
}

.field__label {
  padding: 0;
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
}

.field__hint {
  font-size: 14px;
  line-height: 20px;
  color: var(--body);
}

.field__error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  color: var(--danger);
}

.field__error svg {
  flex: none;
}

.input,
.picker {
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--soft);
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
}

.input::placeholder {
  color: var(--hint);
  opacity: 1;
}

.input--amount {
  font-size: 24px;
  line-height: 32px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

textarea.input {
  padding: 16px;
  resize: none;
}

/* A field in use has a 2 px ink border, as drawn (MainNameSuggest, MainRoomNew), instead of the outer ring;
 * an invalid field keeps its danger border (the rule below wins). */
/* focus-within, not focus: a date field keeps its border while the calendar button inside it has focus. */
.input:focus-within,
.input-group:has(input:focus) {
  outline: none;
  border: 2px solid var(--ink);
}

.input[aria-invalid="true"],
.picker[aria-invalid="true"],
.input-group:has([aria-invalid="true"]) {
  border: 2px solid var(--danger);
}

/* A field-looking button that opens a picker (date, duration, position). */
.picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.picker__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker svg {
  flex: none;
}

/* A control with a trailing icon (select, room combobox). */
.with-icon {
  position: relative;
}

.with-icon .input {
  padding-right: 44px;
}

.with-icon__icon {
  position: absolute;
  top: 17px;
  right: 14px;
  display: flex;
  color: var(--body);
  pointer-events: none;
}

select.input {
  appearance: none;
  cursor: pointer;
}

/* A select is drawn as a picker: its chevron sits 16 px from the edge (Main, Должность). */
.with-icon--select .with-icon__icon {
  right: 16px;
}

/* Password with a show/hide button (Login). */
.input-group {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 4px 0 16px;
  border-radius: var(--radius-md);
  background: var(--soft);
}

.input-group input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
}

/* Segmented choice (currency, theme): radio inputs, so it works without JavaScript. */
.segmented {
  display: flex;
  gap: 8px;
}

.segmented__option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--soft);
  color: var(--ink);
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
  cursor: pointer;
}

.segmented__option:has(input:checked) {
  background: var(--primary);
  color: var(--on-primary);
}

.segmented__option:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Banners: a status line with an icon. */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--soft);
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
}

.banner svg {
  flex: none;
  margin-top: 1px;
}

.banner--warn {
  background: var(--warn-soft);
  color: var(--on-warn-soft);
}

.banner--success {
  background: var(--success-soft);
  color: var(--on-success-soft);
}

.banner--danger {
  background: var(--danger-soft);
  color: var(--on-danger-soft);
}

/* Tables: ARIA-role grids as on the boards (role=table/row/columnheader/cell), a grey header strip and
 * 60 px rows with a hairline above each. Each table sets its columns with a modifier that defines
 * --table-cols (the grid-template-columns drawn on its board) and, when it scrolls on a phone, --table-min. */
.table-scroll {
  position: relative; /* contains the visually-hidden header labels, which would otherwise widen the page */
  overflow-x: auto;
}

.table {
  min-width: var(--table-min, 0);
}

.table__head,
.table__row {
  display: grid;
  grid-template-columns: var(--table-cols);
  align-items: center;
}

.table__head {
  min-height: 44px;
  border-radius: var(--radius-md);
  background: var(--soft);
  color: var(--body);
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
}

.table__row {
  box-sizing: content-box; /* 60 px plus the 1 px border, as drawn */
  min-height: 60px;
  border-top: 1px solid var(--line);
}

.table__cell {
  min-width: 0;
  padding: 0 12px;
  text-align: left;
}

.table__cell:first-child {
  padding-left: var(--row-inset);
}

.table__cell.num {
  text-align: right;
}

.table__name {
  font-weight: 500;
}

.table__row.is-off .table__name {
  color: var(--body);
}

/* Staff table (AdminStaff). */
.table--staff {
  --table-cols: minmax(130px, 1.2fr) minmax(100px, 1fr) 112px minmax(110px, 1fr) 64px 48px;
  --table-min: 580px;
}

/* Dictionaries (AdminDictionaries, AdminDictionariesPositions); currencies and categories are not drawn. */
.table--dict-rooms {
  --table-cols: minmax(150px, 2fr) 100px minmax(150px, 1.6fr) 130px 96px;
  --table-min: 640px;
}

.table--dict-positions,
.table--dict-categories {
  --table-cols: 48px minmax(200px, 2fr) 110px 120px 200px;
  --table-min: 640px;
}

.table--dict-test-types {
  --table-cols: 48px minmax(200px, 2fr) 110px 110px 120px 200px;
  --table-min: 740px;
}

.table--dict-currencies {
  --table-cols: 48px 100px minmax(160px, 2fr) 110px 120px 200px;
  --table-min: 740px;
}

a.icon-btn {
  color: var(--ink);
  text-decoration: none;
}

.report-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-xl);
  background: var(--soft);
}

.report-card__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.report-card__meta {
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.report-card__text {
  font-size: 14px;
  line-height: 20px;
}

.dialog__form {
  display: contents;
}

/* Empty state (PhoneMyWeekEmpty). */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 16px 0;
  text-align: center;
}

.empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--soft);
}

.empty__title {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
}

.empty__text {
  margin: 0;
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

/* A page header with tools on the right: the week picker and buttons (ExpensesBalance, «Мои записи»). */
.page-header__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

/* «Расходы» (board ExpensesBalance, T4.22, T4.25): the hryvnia balance cards, then the expenses, salaries and payouts tables. */
.spends {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Figure cards, shared by «Расходы» (board ExpensesCards) and «Отчёты» (board ReportsCards): equal cards in one row; narrower
   content wraps, a phone takes two to a row (--lead: the first card takes the whole row). */
.section.balance {
  gap: 12px;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 12px;
}

.stat-card {
  min-width: 0;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-card__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--body);
  font-size: 13px;
  line-height: 18px;
}

.stat-card__label > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card__label svg {
  flex: none;
}

.stat-card__figure {
  font-variant-numeric: tabular-nums;
}

.stat-card__value {
  font-family: Manrope, "Golos Text", system-ui, sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
  color: var(--ink);
  white-space: nowrap; /* the number is never broken; the unit may drop to its own line on a narrow card */
}

.stat-card__unit {
  white-space: nowrap;
  font-size: 13px;
  color: var(--body);
}

/* «Отчёты» (board ReportsCardsUsd, spec 2026-10-30): the hryvnia figure under the USD one. «Расходы» has none. */
.stat-card:has(.stat-card__sub) {
  gap: 4px;
}

.stat-card__sub {
  font-size: 13px;
  line-height: 18px;
  color: var(--body);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-note {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--body);
}

@media (max-width: 599px) {
  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-cards--lead > .stat-card:first-child {
    grid-column: 1 / -1;
  }
}

.spends__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.spend-total {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.spends-empty {
  margin: 0;
  color: var(--body);
}

/* The date field's status line, empty here (no status URL): it must not add a gap above the hint. */
.field__status:empty {
  display: none;
}

.spend-date {
  color: var(--body);
  font-size: 14px;
}

/* As the records table (board CompactRows): one line per row, 40 px (compact tables, T4.37), columns shared by every row (subgrid) and sized
 * by the longest value; date and amount always whole, a cut category or comment shows whole in a popup ([data-tip]). */
/* «Расходы» tables: the amount in its currency, then its USD (T4.44). */
.table--expenses {
  --table-cols: auto minmax(180px, 1.2fr) minmax(200px, 2fr) auto auto 56px;
  --table-min: 720px;
}

.table--salaries {
  --table-cols: auto auto minmax(200px, 1fr) auto auto 56px;
  --table-min: 640px;
}

.table--payouts {
  --table-cols: auto minmax(200px, 1fr) auto auto 56px;
  --table-min: 560px;
}

@media (min-width: 600px) {
  .table--spends {
    display: grid;
    grid-template-columns: var(--table-cols);
  }

  .table--spends > .table__head,
  .table--spends > .table__row {
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
  }

  .table--spends > .table__row {
    min-height: 40px;
  }

  .table--spends .table__cell {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .table--spends .table__cell--actions {
    overflow: visible;
  }
}

/* The panel's one-line explanation under its title (ExpenseNew, PayoutNew): 4 px under the title, as drawn. */
.panel__lead {
  margin: -28px 0 0;
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

/* Record history (AdminRecordHistory). */
.history {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.history-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: var(--radius-xl);
  background: var(--soft);
}

.history-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
}

.history-card__meta {
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.history__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history__entry {
  position: relative;
  padding-left: 22px;
}

.history__entry::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
}

.history__when {
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.history__line--quiet {
  color: var(--body);
}

/* A replaced or removed result file, still the admin's to download (RecordFile, D6). */
.history__download {
  margin-top: 8px;
}

/* The records table (record/table.html), the admin's (AdminRecords) and the manager's own (owner review 2026-10-16).
 * The date stays on one line. A day heading (.table__group) is for the phone form only. */
/* Board CompactRows (owner 2026-10-19): one line per record, 40 px (compact tables, T4.37). The columns are the table's, shared by every row
 * (subgrid), and sized by the longest value in the table: date, time, amount and status always whole; the client
 * first (at least 160 px, T4.37), the manager 90-140 px, room · position 120-240 px and the test type 100-150 px; date, time,
 * amount and pay (the admin's) stay whole; the comment takes the rest (T4.23). Cut text shows whole in a
 * popup ([data-tip], js/app.js). The phone keeps its PhoneMyWeek rows (below 600 px). */
.table--records {
  --table-cols: max-content fit-content(140px) minmax(160px, 1fr) fit-content(240px) fit-content(150px) minmax(32px, 1fr) max-content max-content max-content fit-content(150px) max-content 56px;
  --table-min: 800px;
}

/* No deleted row on the page: the status column (chips only) is left out and its room goes to the text. */
.table--records.table--no-status {
  --table-cols: max-content fit-content(140px) minmax(160px, 1fr) fit-content(240px) fit-content(150px) minmax(32px, 1fr) max-content max-content max-content fit-content(150px) 56px;
}

.table--own {
  --table-cols: max-content minmax(160px, 1.2fr) fit-content(220px) fit-content(150px) minmax(100px, 1fr) max-content max-content 56px;
  --table-min: 760px;
}

@media (min-width: 600px) {
  .table--records {
    display: grid;
    grid-template-columns: var(--table-cols);
  }

  .table--records > .table__head,
  .table--records > .table__row {
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
  }

  .table--records > .table__row {
    min-height: 40px;
  }

  .table--records .table__cell {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .table--records .table__cell--actions {
    overflow: visible;
  }

  /* The test type and the pay made the table one column wider each (T4.23): a little less padding keeps the date,
   * time, amount and pay whole at 1280 px; the profit (T4.29) took 6 px each side more. */
  .table--records .table__cell {
    padding-inline: 6px;
  }

  .table--records .table__cell:first-child {
    padding-left: var(--row-inset);
  }

  .table--records .table__cell--staff {
    min-width: 96px; /* a manager's name stays whole while the client takes its 160 px (T4.37) */
  }

  .table--records .table__cell--place {
    min-width: 90px;
  }

  .table--records .table__cell--client {
    min-width: 160px; /* the client comes first (US-6.1): room, position and type give way before it */
  }

  .table--records .table__cell--type {
    min-width: 84px;
  }

  /* The pay keeps its width: it is a sum. A USDT profit ("X USDT / Y грн") may break after the slash (each amount stays whole). */
  .table--records .table__cell--pay {
    white-space: nowrap;
  }

  .table--records .table__nb {
    white-space: nowrap;
  }

  /* The profit column is capped (150 px), so a "X USDT / Y грн" cell wraps after the slash in its own box. */
  .table--records .table__cell--profit {
    min-width: 124px; /* the longest amount ("57 421,25 грн") stays whole */
    overflow: visible;
    white-space: normal;
    line-height: 19px; /* two lines (a USDT profit) stay inside the 40 px row, hairline included */
    padding-block: 0;
  }

  .table__cut,
  .table--records .table__name {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .table--records .table__client {
    min-width: 0;
  }
}

/* A record's comment, one line; a cut one can take focus and shows its whole text (js/app.js, .comment-tip). */
.record-comment {
  display: block;
  overflow: hidden;
  color: var(--body);
  white-space: nowrap;
  text-overflow: ellipsis;
}

[data-tip][tabindex] {
  cursor: default;
}

[data-tip]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.comment-tip {
  position: fixed;
  z-index: 50;
  box-sizing: border-box;
  max-width: min(340px, calc(100vw - 16px));
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--canvas);
  font-size: 14px;
  line-height: 20px;
  white-space: pre-line;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.comment-tip[hidden] {
  display: none;
}

.table__cell--date {
  white-space: nowrap;
}

.table--records .table__group {
  display: none;
}

/* A row with a current result file (RecordFile): a paperclip after the client's name, which still shortens first. */
.table__client {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.table__client .table__name {
  min-width: 0;
}

.record-file {
  display: inline-flex;
  flex: none;
  color: var(--body);
}

/* A submitted week's row (RecordFile): the lock stands before the time; the menu stays and opens the record read-only. */
.table--records .table__cell--time {
  white-space: nowrap;
}

.table__lock {
  display: inline-flex;
  margin-right: 4px;
  vertical-align: -2px;
  color: var(--body);
}

/* A part of a page that is swapped as a whole (#records-page); its children sit in the page's own flow and gaps. */
.page-part {
  display: contents;
}

.is-deleted .strike {
  color: var(--body);
  text-decoration: line-through;
}

.record-place__none {
  color: var(--body);
}

.chip--danger {
  background: var(--danger-soft);
  color: var(--on-danger-soft);
}

/* Filters drawn as pill buttons with a chevron: styled native selects, and a pill toggle. */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-wrap {
  position: relative;
}

.filter {
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--soft);
  color: var(--ink);
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
  cursor: pointer;
}

select.filter {
  padding-right: 42px;
  appearance: none;
}

.filter-wrap__icon {
  position: absolute;
  top: 13px;
  right: 16px;
  display: flex;
  pointer-events: none;
}

/* A text filter (the client name on AdminRecords): the pill holds the input and, once it has text, a 44 px clear button
   next to it (not on top of it, so the two never share a touch area). */
.filter--search {
  display: inline-flex;
  align-items: center;
  width: 220px;
  padding: 0 0 0 16px;
  cursor: text;
}

.filter--search:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.filter__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  outline: none;
}

.filter__input::placeholder {
  color: var(--hint);
  opacity: 1;
}

.filter__clear {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.filter__input:placeholder-shown + .filter__clear {
  display: none;
}

.filter--search:has(.filter__input:placeholder-shown) {
  padding-right: 16px;
}

.filter__clear:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -4px;
}

.filter--toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.filter--toggle:has(input:checked) {
  background: var(--primary);
  color: var(--on-primary);
}

.filter--toggle:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Reports (AdminReports). Every currency's sum shares one amount column (owner 2026-10-30; it may break after a
   slash), followed by one USD column (spec 2026-10-30). */

.week-picker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.week-picker__label {
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
}

/* «Отчёты» as a list of weeks (board ReportsWeeks, spec 2026-11-06, T4.49). The title has hint lines under it (the
   rate rule, the missing rates, C5). One row per week, «Итого» on top under a 2 px rule; every figure cell is USD large
   with its unit and the hryvnia under it (R5). An open week, manager or room is a grey card around its white inner box
   (js/app.js adds is-open); the whole row toggles (data-row-toggle), the chevron button is the keyboard target. */

/* After .page-header in the cascade's eyes: the modifier is doubled to win over it, which comes later in the file. */
.page-header.page-header--lead {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.page-header--lead .page-title {
  margin-bottom: 4px;
}

.page-lead {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--body);
}

.weeks {
  --weeks-cols: 36px minmax(184px, 1.3fr) 68px repeat(7, minmax(112px, 1fr));
  min-width: 1072px;
}

.weeks__head,
.weeks__total,
.weeks__row {
  display: grid;
  grid-template-columns: var(--weeks-cols);
  align-items: center;
}

.weeks__head,
.week-table__head {
  min-height: 40px;
  border-radius: var(--radius-md);
  background: var(--soft);
  color: var(--body);
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
}

.weeks__head > *,
.week-table__head > * {
  padding: 0 8px;
}

.weeks__total,
.weeks__row {
  min-height: 56px;
}

.weeks__total {
  border-bottom: 2px solid var(--ink);
}

.weeks__label {
  padding: 0 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
}

.weeks__cell {
  padding: 8px;
}

.weeks__figure,
.weeks__usd {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 20px;
  color: var(--ink);
}

.weeks__money {
  white-space: nowrap;
}

.weeks__unit {
  font-size: 12px;
  line-height: 20px;
  color: var(--body);
}

.weeks__dash {
  font-size: 15px;
  line-height: 20px;
  color: var(--body);
}

.weeks__uah,
.weeks__count {
  font-size: 13px;
  line-height: 16px;
  color: var(--body);
  white-space: nowrap;
}

/* R15: a week not everyone submitted stands out in a long list. */
.weeks__count--warn {
  color: var(--warn);
  font-weight: 500;
}

.weeks__toggle,
.week-table__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 52px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--body);
  cursor: pointer;
}

.weeks__toggle[aria-expanded="true"] svg,
.week-table__toggle[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

[data-row-toggle] {
  cursor: pointer;
}

.weeks__week.is-open {
  margin: 4px 0;
  padding-bottom: 16px;
  border-radius: var(--radius-xl);
  background: var(--soft);
}

.week-open {
  margin: 0 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--canvas);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.week-open__title {
  font-size: 20px;
  line-height: 28px;
}

.week-open__title--rooms,
.week-open__title--spends {
  margin-top: 12px;
}

/* The week's spends (R16): read-only, no toggle column, so the first cell keeps the row's padding. */
.week-table--spends {
  --week-cols: 104px 96px minmax(140px, 1fr) minmax(200px, 2fr) minmax(130px, 1fr) 96px;
  min-width: 860px;
}

.week-table--spends .week-table__row {
  min-height: 40px;
}

.week-table--spends .week-table__row > :first-child {
  padding: 0 8px;
}

.week-spends__comment {
  overflow-wrap: anywhere;
}

.week-spends__empty {
  color: var(--body);
}

/* «Менеджеры» and «Комнаты» (R13, R14). */
.week-table--managers {
  --week-cols: 36px minmax(150px, 1.2fr) 72px 64px minmax(190px, 1.6fr) 96px 120px 236px;
  min-width: 964px;
}

.week-table--rooms {
  --week-cols: 36px minmax(180px, 1.2fr) 72px minmax(190px, 1.6fr) 96px;
  min-width: 574px;
}

.week-table__head,
.week-table__row {
  display: grid;
  grid-template-columns: var(--week-cols);
  align-items: center;
}

.week-table__row {
  min-height: 52px;
  font-size: 14px;
  line-height: 20px;
}

.week-table__row > [role="rowheader"],
.week-table__row > [role="cell"]:not(:first-child) {
  padding: 0 8px;
}

.week-table--rooms .week-table__row {
  min-height: 40px;
}

.week-table--rooms .week-table__toggle {
  height: 40px;
}

.week-table > .week-table__group,
.week-table > .week-table__row {
  border-top: 1px solid var(--line);
}

.week-table > .week-table__head + *,
.week-table > .is-open,
.week-table > .is-open + * {
  border-top: none;
}

.week-table__group.is-open {
  margin: 4px 0;
  padding-bottom: 12px;
  border-radius: var(--radius-lg);
  background: var(--soft);
}

.week-table__name,
.week-table__strong {
  font-weight: 500;
}

/* A manager who has not submitted (R13): muted, «Не сдан» in the warning tone. */
.week-table__row--missing {
  color: var(--body);
}

.week-table__row--missing .week-table__name {
  font-weight: 400;
}

/* C4: «2 без типа» under the test count; the touch target reaches 44 px with an invisible ::after (T4.4). */
.week-untyped {
  position: relative;
  font-size: 13px;
  line-height: 16px;
  color: var(--ink);
  text-decoration: underline;
  white-space: nowrap;
}

.week-untyped::after {
  content: "";
  position: absolute;
  inset: -14px -4px;
}

/* The pay (ЗП): the week's figure cell at the table's size. */
.week-table .weeks__cell {
  padding: 4px 8px;
}

.week-table .weeks__usd {
  font-size: 14px;
}

.week-table .weeks__dash {
  font-size: 14px;
}

.week-table__report {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.week-status {
  color: var(--body);
  white-space: nowrap;
}

.week-status--missing {
  color: var(--warn);
  font-weight: 500;
}

.week-table .btn--sm {
  padding: 0 14px;
  white-space: nowrap;
}

.week-table__group.is-open .btn--sm {
  background: var(--canvas);
}

/* A manager's clients and a room's lines: a white box inside the grey card. */
.week-table__detail {
  margin: 0 12px;
  padding: 4px 16px 12px;
  border-radius: 10px;
  background: var(--canvas);
}

.week-table__detail--room {
  padding: 12px 16px;
}

.week-table__detail--room > [role="cell"] {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.week-room__title {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

.week-room__title--records {
  margin-top: 12px;
}

.week-positions__row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 72px minmax(190px, 1.6fr) 96px;
  align-items: center;
  min-height: 40px;
  font-size: 14px;
  line-height: 20px;
}

.week-positions__row + .week-positions__row {
  border-top: 1px solid var(--line);
}

.week-positions__row > [role="cell"] {
  padding: 0 8px;
}

.report-strong {
  font-weight: 500;
}

.report-detail__table {
  min-width: 840px;
}

.report-detail__head,
.report-detail__row {
  display: grid;
  grid-template-columns: 96px minmax(150px, 1.4fr) minmax(90px, 1fr) minmax(130px, 1fr) 56px minmax(150px, 1fr) 96px;
  align-items: center;
  column-gap: 12px;
}

.report-detail__head {
  min-height: 32px;
  color: var(--body);
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
}

.report-detail__row {
  min-height: 40px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 20px;
}

/* A room's records (board RoomTotals): the manager after the date, no room column. */
.report-detail__table--room .report-detail__head,
.report-detail__table--room .report-detail__row {
  grid-template-columns: 96px minmax(100px, 1fr) minmax(150px, 1.4fr) minmax(130px, 1fr) 56px minmax(150px, 1fr) 96px;
}

.report-detail__table .num {
  font-variant-numeric: tabular-nums;
}

.report-detail__date {
  color: var(--body);
}

/* Board AdminReportsEmpty. */
.report-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 64px 32px;
  border-radius: var(--radius-xl);
  background: var(--soft);
  text-align: center;
}

.report-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--canvas);
}

.report-empty__title {
  margin: 0;
  font-size: 24px;
  line-height: 32px;
}

.report-empty__text {
  max-width: 420px;
  margin: 0;
  color: var(--body);
}

.report-empty__missing {
  margin: 8px 0 0;
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

/* Combobox: the option list opens under the field (or under the whole row, as for the room). */
.combobox {
  position: relative;
}

.combobox__list {
  position: absolute;
  z-index: 2;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
}

/* Duration sheet (DurationPicker). */
.duration__display {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 52px;
  line-height: 56px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.duration__steppers {
  display: flex;
  gap: 16px;
}

.stepper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stepper__label {
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.stepper__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stepper__value {
  min-width: 48px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 40px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.duration__presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.duration__hint {
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.btn--num {
  font-variant-numeric: tabular-nums;
}

.icon-btn--lg {
  width: 48px;
  height: 48px;
}

/* App-styled select (owner decision 2026-10-16; js/app.js): the hidden select stays the form field, a button with
 * the field's look shows the choice and opens the listbox below. */
.select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.select-button {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.select-button.filter {
  width: auto;
  padding-right: 42px;
}

.select-button:disabled {
  opacity: 0.4;
  cursor: default;
}

.select-button__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listbox.select-list {
  position: absolute;
  z-index: 3;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(420px, calc(100vw - 32px));
  max-height: 320px;
  overflow-y: auto;
}

/* In a panel the list never outgrows its field, so the panel never scrolls sideways: a long option wraps (T4.27). */
.panel .listbox.select-list {
  max-width: 100%;
}

.panel .select-list .listbox__option {
  overflow-wrap: anywhere;
}

/* As specific as `.listbox.select-list`, or its `top` wins, the list gets both top and bottom and is squeezed to its
   borders: an empty strip under the field whenever there is no room below (T4.32). */
.listbox.select-list.select-list--up {
  top: auto;
  bottom: calc(100% + 4px);
}

.select-list .listbox__option.is-active {
  background: var(--soft);
}

.select-list .listbox__option[aria-selected="true"] {
  font-weight: 500;
}

/* Option list of a combobox (MainNameSuggest, MainRoomNew). */
.listbox {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--canvas);
}

.listbox__option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: none;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
  text-align: left;
  cursor: pointer;
}

.listbox > :first-child {
  border-top: none;
}

/* With a mouse the drawn 56 px phone rows are needlessly tall; 44 px keeps the touch-target minimum. */
@media (pointer: fine) and (min-width: 600px) {
  .listbox__option:not(.listbox__option--rich) {
    min-height: 44px;
  }
}

.listbox__option[aria-selected="true"] {
  background: var(--soft);
}

.listbox__option--rich {
  min-height: 64px;
  padding: 8px 16px;
}

.listbox__option--name {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  padding: 8px 16px;
}

.listbox__name {
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
}

.listbox__badge {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
}

.listbox__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.listbox__title {
  font-weight: 500;
}

.listbox__meta {
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.listbox__note {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--softer);
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.listbox mark {
  margin: 0 -2px;
  padding: 0 2px;
  border-radius: 4px;
  background: var(--pressed);
  color: var(--ink);
}

/* Icon buttons at the end of a row. The rooms board squeezes two 40 px buttons into 72 px (they shrink to
 * 34 px there); a narrower cell padding keeps them 40 px wide instead. */
.table--dict-rooms .table__cell--actions {
  padding: 0 6px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.row-actions--tight {
  gap: 0;
}

/* T4.4: on a phone the drawn 0 gap would let the 44 px hit areas overlap; 4 px keeps each one whole. */
@media (max-width: 599px) {
  .row-actions--tight {
    gap: 4px;
  }
}

/* Overlays: native <dialog> opened with showModal() (js/app.js). */
dialog {
  max-width: none;
  max-height: none;
  padding: 0;
  border: none;
  background: var(--canvas);
  color: var(--ink);
}

dialog::backdrop {
  background: var(--scrim);
}

html:has(dialog[open]) {
  overflow: hidden;
}

.overlay__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
}

.overlay__text {
  margin: 0;
  color: var(--body);
}

/* Confirmation dialog: phone (WeekSubmit) and desktop (AdminReportsUnlock). */
.dialog {
  width: calc(100% - 32px);
  margin: auto;
  border-radius: var(--radius-xl);
}

.dialog__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

/* A dialog with a form (AdminRoomMerge): 520 px on a desktop, more room between parts. */
.dialog__inner--roomy {
  gap: 20px;
}

.overlay__lead {
  margin: 4px 0 0;
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.merge-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--soft);
}

.merge-source__name {
  font-weight: 500;
}

.merge-source__meta {
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.dialog__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dialog__actions .btn {
  width: 100%;
}

@media (min-width: 600px) {
  .dialog {
    width: 480px;
  }

  .dialog--wide {
    width: 520px;
  }

  .dialog__inner {
    padding: 32px;
  }

  .dialog__actions {
    flex-direction: row-reverse;
    justify-content: flex-start;
  }

  .dialog__actions .btn {
    width: auto;
  }
}

/* A secret shown once, such as a temporary password (AdminStaffPassword). */
.secret {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  background: var(--soft);
  font-size: 24px;
  line-height: 32px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  user-select: all;
}

/* Bottom sheet (RecordActions, ProfileMenu). */
.sheet {
  width: 100%;
  margin: auto 0 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.sheet__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px 16px 24px;
}

.sheet__handle {
  align-self: center;
  width: 40px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--pressed);
}

.sheet__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sheet__head > div {
  flex: 1;
  min-width: 0;
}

.sheet__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
}

.sheet__meta {
  font-size: 14px;
  line-height: 20px;
  color: var(--body);
}

.sheet__hint {
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.sheet__amount {
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--soft);
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.action-row--danger {
  color: var(--danger);
}

/* Side panel for create and edit forms (AdminStaffNew); a full-screen sheet on a phone. A third of the window, never
 * narrower than the drawn 440 px (T4.30, owner 2026-10-23). */
.panel {
  width: max(440px, 33.333vw);
  max-width: 100%;
  height: 100%;
  margin: 0 0 0 auto;
  border-left: 1px solid var(--line);
  overflow: auto;
}

.panel__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100%;
  padding: 32px;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel__form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* The record's fields in the panel; disabled as a whole for a submitted week (RecordFile, read-only panel). */
.panel__fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
}

.panel__fields:disabled :is(.input, .picker, .select-button, .segmented__option:not(:has(input:checked))) {
  color: var(--body);
  cursor: default;
  opacity: 1;
}

/* Hints explain how to fill a field; a locked record is not filled, so they go (as drawn). */
.panel__fields:disabled .field__hint {
  display: none;
}

/* The result-file block (board RecordFile): the record's result file below the comment, in both roles' panels. */
.file-block,
.file-block__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-block__file,
.file-block__progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--soft);
}

.file-block__file > svg,
.file-block__progress > svg {
  flex: none;
}

.file-block__text {
  flex: 1 1 auto;
  min-width: 0;
}

.file-block__name {
  overflow: hidden;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-block__meta {
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.file-block__bar {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--line);
}

.file-block__bar-fill {
  width: 0;
  height: 100%;
  background: var(--ink);
}

.file-block__actions {
  display: flex;
  gap: 8px;
}

.file-block__actions .btn {
  flex: 1 1 0;
  padding: 0 12px;
}

/* While a file uploads, the progress row stands in for the block's body. */
.file-block.is-uploading .file-block__body,
.file-block__progress[hidden],
.file-block__error[hidden] {
  display: none;
}

.panel__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

@media (max-width: 599px) {
  .panel {
    width: 100%;
    border-left: none;
  }

  .panel__inner {
    padding: 24px 16px;
  }
}

/* Admin shell: sidebar and main (AdminStaff, AdminReports). */
.app {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  min-height: 100vh;
}

/* The page gutter of the one shell, defined only here (owner review 2026-10-16). The title, cards and forms start
 * at it. The records table draws its hairlines across the content box on a desktop and runs to the screen edge on a
 * phone, as drawn in PhoneMyWeek (--bleed); its text keeps the 16 px row inset either way. */
.app__main {
  --gutter: 32px;
  --bleed: 0px;
}

@media (max-width: 599px) {
  .app__main {
    --gutter: 16px;
    --bleed: var(--gutter);
  }
}

/* The sidebar on a desktop. It stays put while the page scrolls, so the account block is always in view. */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  flex: none;
  width: 240px;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
}

.sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -6px 0; /* the 44 px toggle beside the 32 px wordmark keeps the drawn rhythm */
}

.sidebar__brand {
  padding: 0 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
}

.sidebar__monogram,
.sidebar__toggle-expand {
  display: none;
}

.sidebar__toggle svg {
  display: block;
}

/* Expanded, the links are text only, as drawn (AdminStaff); the icons belong to the strip. */
.sidebar__link > svg {
  display: none;
}

/* Today's NBU rate under the wordmark (T4.29), the admin's only; the drawer carries it on a phone. */
.sidebar__rate,
.drawer__rate {
  margin-top: 4px;
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}

.sidebar__rate {
  padding: 0 16px;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
  text-decoration: none;
}

.sidebar__link[aria-current="page"] {
  background: var(--primary);
  color: var(--on-primary);
}

/* The account block at the bottom of the sidebar (AdminAccount): the user, then sign-out. */
.sidebar__account {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* The user: a button that opens the profile sheet (theme, password, sign-out). */
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sidebar__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar__actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.sidebar__action {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.sidebar__action--danger {
  color: var(--danger);
}

.sidebar__name {
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
}

.sidebar__role {
  font-size: 14px;
  line-height: 20px;
  color: var(--body);
}

/* T4.30 (owner 2026-10-23): on a desktop the sidebar is a 72 px strip unless <html data-sidebar="expanded"> (js/theme.js,
 * js/app.js). The strip: the monogram and the toggle, one 44 px icon per page with the current one filled, the avatar,
 * password and sign-out; no rate. A link's label stays its text: visually hidden, shown as a tip on hover or focus. */
@media (min-width: 600px) {
  :root:not([data-sidebar="expanded"]) .sidebar {
    width: 72px;
    padding: 24px 14px;
    gap: 24px;
    overflow-x: hidden; /* a short window scrolls the strip; the labels show as a fixed popup (js/app.js) */
    overflow-y: auto;
    scrollbar-width: none;
    z-index: 4;
  }

  :root:not([data-sidebar="expanded"]) .sidebar__top {
    flex-direction: column;
    margin: 0;
  }

  :root:not([data-sidebar="expanded"]) .sidebar__brand {
    padding: 0;
    text-align: center;
  }

  :root:not([data-sidebar="expanded"]) .sidebar__monogram,
  :root:not([data-sidebar="expanded"]) .sidebar__toggle-expand {
    display: flex;
    justify-content: center;
  }

  :root:not([data-sidebar="expanded"]) .sidebar__toggle-collapse,
  :root:not([data-sidebar="expanded"]) .sidebar__rate,
  :root:not([data-sidebar="expanded"]) .sidebar__who {
    display: none;
  }

  :root:not([data-sidebar="expanded"]) .sidebar__wordmark,
  :root:not([data-sidebar="expanded"]) .sidebar__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  :root:not([data-sidebar="expanded"]) .sidebar__link,
  :root:not([data-sidebar="expanded"]) .sidebar__action {
    position: relative;
    justify-content: center;
    width: 44px;
    padding: 0;
  }

  :root:not([data-sidebar="expanded"]) .sidebar__link > svg {
    display: block;
  }

  :root:not([data-sidebar="expanded"]) .sidebar__user {
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 2px;
    border-radius: 50%;
  }
}

.app__main {
  flex: 999 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px var(--gutter);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  font-size: 36px;
  line-height: 44px;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section__title {
  font-size: 24px;
  line-height: 32px;
}

.section__lead {
  margin: 4px 0 0;
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* The day tabs of the records pages (T4.31): the same pills, each with its count; a day without records is muted. On a
   phone the row scrolls sideways inside its own box (the page does not). */
.tabs__count {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

.tabs .btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
}

@media (max-width: 599px) {
  .tabs--days {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs--days > .btn {
    flex: none;
  }
}

/* On a desktop (owner decision 2026-10-16). */
@media (min-width: 600px) {
  /* The report status: status on the left, the button on the right. */
  .report-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .report-card .btn--block {
    width: auto;
    padding: 0 24px;
  }

  /* Bottom sheets (profile, record actions) become centred dialogs. */
  .sheet {
    width: 440px;
    margin: auto;
    border-radius: var(--radius-xl);
  }

  .sheet__handle {
    display: none;
  }
}

/* A page of its own without a shell (ChangePassword): brand, title, fields, buttons at the bottom. */
.solo {
  display: flex;
  flex-direction: column;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
}

.solo__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 24px 0;
}

.solo__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
}

.solo__intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.solo__title {
  margin: 0;
  font-size: 32px;
  line-height: 40px;
}

.solo__lead {
  margin: 0;
  color: var(--body);
}

.solo__fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.solo__footer {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 24px 24px;
}

/* A secret field with its show button beside it (ChangePassword). */
.field-row--secret {
  align-items: center;
  gap: 8px;
}

.field-row--secret > .input {
  flex: 1 1 0;
  min-width: 0;
}

.icon-btn--xl {
  width: 56px;
  height: 56px;
}

/* Login page (board Login): a phone column, centred on wider windows (not drawn). */
.login {
  display: flex;
  flex-direction: column;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
}

.login__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  padding: 0 24px;
}

.login__intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  line-height: 44px;
}

.login__title {
  font-size: 24px;
  line-height: 32px;
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.login__fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login__footer {
  flex: none;
  padding: 0 24px 24px;
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

/* ---------------------------------------------------------------------------------------------
 * T4.13 · The admin area on a phone (boards AdminPhoneMenu, AdminPhoneReports). Below 600 px the sidebar gives way
 * to a bar (menu, page title, avatar) and a drawer; the reports show cards; other tables scroll sideways.
 * ------------------------------------------------------------------------------------------- */
.app-bar {
  display: none;
}

.app-bar__menu {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.app-bar__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 24px;
  line-height: 32px;
}

.drawer {
  inset: 0 auto 0 0;
  width: 300px;
  height: 100%;
  margin: 0;
}

.drawer__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100%;
  padding: 24px 16px;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 16px;
}

.drawer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 32px;
}

.drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer__link {
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  text-decoration: none;
}

.drawer__link[aria-current="page"] {
  background: var(--primary);
  color: var(--on-primary);
}

.drawer__account {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.drawer__user {
  padding: 0 8px;
  font-weight: 500;
}

.drawer__role {
  color: var(--body);
  font-weight: 400;
}

.drawer__action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--soft);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.drawer__action--danger {
  color: var(--danger);
}

/* AdminPhoneReports: manager cards, inside an opened week on a phone (board PhoneReportsWeeks, C10): white cards on the
   week's grey panel, grey chips and buttons. «Клиенты» opens the records inside the card. */
.staff-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.staff-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-xl);
  background: var(--canvas);
}

/* A manager who has not submitted: one short line, the name muted and «Не сдан» in the warning tone. */
.staff-card--missing {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 16px;
}

.staff-card__missing-name {
  color: var(--body);
}

.staff-card__status {
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.staff-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.staff-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
}

.staff-card__meta {
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
  white-space: nowrap;
}

.staff-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.staff-card__chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--soft);
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.staff-card__actions {
  display: flex;
  gap: 8px;
}

.staff-card__button {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--soft);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  cursor: pointer;
}

.staff-card__record {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.staff-card__text {
  flex: 1;
  min-width: 0;
}

.staff-card__client {
  font-weight: 500;
}

.staff-card__line {
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.staff-card__amount {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 599px) {
  .app {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .app-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 64px;
    padding: 0 8px 0 4px;
  }

  .app__main {
    gap: 16px;
    padding: 0 var(--gutter) 24px;
  }

  /* The bar holds the page title on a phone. */
  .app__main .page-title {
    display: none;
  }

  .app__main .week-picker {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  /* A header's week picker and button (ExpensesBalance, «Мои записи»): the picker, then the buttons below it. */
  .page-header__tools {
    flex: 1 1 100%;
  }

  .page-header__tools > .btn {
    flex: 1 1 100%;
  }

  /* The records table as the phone rows of PhoneMyWeek (owner decision 2026-10-16): under a heading for each day,
   * the name; the manager, room and position, time; the amount and currency; the menu or the lock. The rows run
   * to the screen edge; the column heads stay for screen readers only. */
  .table-scroll:has(> .table--records) {
    margin-inline: calc(-1 * var(--bleed));
    overflow: visible;
  }

  .table--records {
    min-width: 0;
  }

  .table--records .table__head {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .table--records .table__group {
    display: flex;
    align-items: flex-end;
    height: 40px;
    padding: 0 var(--row-inset) 6px;
    color: var(--body);
    font-size: 14px;
    line-height: 16px;
    font-weight: 500;
  }

  .table--records .table__group .table__cell {
    display: flex;
    justify-content: space-between;
    flex: 1;
    padding: 0;
  }

  .table__group-count {
    font-variant-numeric: tabular-nums;
  }

  .table--records .table__row {
    box-sizing: border-box;
    /* The second line takes only its text (the place shrinks first); the free space goes after it. */
    grid-template-columns: auto minmax(0, max-content) auto minmax(0, max-content) minmax(0, 1fr) auto 44px;
    grid-template-areas:
      "client client client client client amount actions"
      "staff place time type status amount actions"
      "comment comment comment comment comment comment actions";
    align-items: center;
    min-height: 64px;
    padding: 8px 4px 8px var(--row-inset);
  }

  .table--own .table__row {
    grid-template-columns: minmax(0, max-content) auto minmax(0, max-content) minmax(0, 1fr) auto 44px;
    grid-template-areas:
      "client client client client amount actions"
      "place time type . amount actions"
      "comment comment comment comment comment actions";
  }

  .table--records .table__cell {
    min-width: 0;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* The phone rows have no room for the pay and the profit (the desktop table shows them). The test type (T4.34) is
   * the second line's last item, muted and cut with an ellipsis. */
  .table--records .table__cell--date,
  .table--records .table__cell--pay,
  .table--records .table__cell--profit {
    display: none;
  }

  .table--records .table__cell--client {
    grid-area: client;
    font-size: 16px;
    line-height: 20px;
    font-weight: 500;
  }

  .table--records .table__cell--client .table__name {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .table--records .table__cell--staff,
  .table--records .table__cell--place,
  .table--records .table__cell--time {
    margin-top: 2px;
    color: var(--body);
    font-size: 14px;
    line-height: 20px;
    text-align: left;
  }

  .table--records .table__cell--staff {
    grid-area: staff;
  }

  .table--records .table__cell--staff::after,
  .table--records .table__cell--time::before {
    content: "\00a0\00b7\00a0";
  }

  .table--records .table__cell--place {
    grid-area: place;
  }

  .table--records .table__cell--time {
    grid-area: time;
    overflow: visible;
  }

  .table--records .table__cell--type {
    grid-area: type;
    display: flex;
    margin-top: 2px;
    color: var(--hint);
    font-size: 14px;
    line-height: 20px;
    text-align: left;
  }

  .table--records .table__cell--type::before {
    content: "\00a0\00b7\00a0";
    flex: none;
  }

  .table--records .table__cell--type .table__cut {
    flex: 0 1 auto;
    min-width: 0;
  }

  /* The comment as the row's third line (board RecordComment); a row without one keeps two. */
  .table--records .table__cell--comment {
    grid-area: comment;
    margin-top: 2px;
    font-size: 14px;
    line-height: 20px;
  }

  .table--records .table__cell--comment:not(:has(.record-comment)) {
    display: none;
  }

  .table--records .table__cell--status {
    grid-area: status;
    padding-left: 8px;
    margin-top: 2px;
  }

  .table--records .table__cell--amount {
    grid-area: amount;
    padding-left: 8px;
    font-size: 18px;
    line-height: 24px;
    font-weight: 500;
  }

  /* The currency beside the amount, small and grey (PhoneMyWeek). */
  .table--records .table__currency {
    padding-left: 2px;
    color: var(--body);
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
  }

  .table--records .table__cell--actions {
    grid-area: actions;
    display: flex;
    justify-content: center;
    overflow: visible;
  }

}

/* «Отчёты» on a phone (board PhoneReportsWeeks, C10, T4.49). The week table bleeds to the right edge and scrolls
   sideways; the chevron and the week stay fixed at the left (sticky), so a row is always named. An opened week's blocks
   sit under its row at screen width (sticky at the left of the scrolled box), not inside the scrolled columns. The whole
   row is the toggle (data-row-toggle); the 22 px chevron reaches 44 px with an invisible ::after over the week cell. */
@media (max-width: 599px) {
  .weeks-scroll {
    margin-right: calc(-1 * var(--gutter));
  }

  .weeks {
    --weeks-cols: 22px 98px 64px repeat(7, 112px);
    min-width: 968px;
  }

  .weeks__head {
    border-radius: 0;
  }

  .weeks__total,
  .weeks__row {
    background: var(--canvas);
  }

  .weeks__head > :nth-child(-n + 2),
  .weeks__total > :nth-child(-n + 2),
  .weeks__row > :nth-child(-n + 2) {
    position: sticky;
    z-index: 1;
    align-self: stretch;
    display: flex;
    align-items: center;
    background: inherit;
  }

  .weeks__head > :first-child,
  .weeks__total > :first-child,
  .weeks__row > :first-child {
    left: 0;
    padding: 0;
  }

  .weeks__head > :nth-child(2),
  .weeks__total > :nth-child(2),
  .weeks__row > :nth-child(2) {
    left: 22px;
    padding: 8px 8px 8px 0;
    border-right: 1px solid var(--line);
  }

  .weeks__label {
    font-size: 13px;
    line-height: 18px;
    white-space: normal;
  }

  .weeks__toggle {
    position: relative;
    width: 22px;
    height: 100%;
    min-height: 52px;
  }

  .weeks__toggle svg {
    width: 14px;
    height: 14px;
  }

  .weeks__toggle::after {
    content: "";
    position: absolute;
    inset: 0 -22px 0 0;
  }

  .weeks__week + .weeks__week {
    border-top: 1px solid var(--line);
  }

  .weeks__week.is-open {
    margin: 0;
    padding-bottom: 0;
    border-radius: 0;
    background: transparent;
  }

  .weeks__week.is-open .weeks__row {
    background: var(--soft);
  }

  .weeks__detail > [role="cell"] {
    position: sticky;
    left: 0;
    width: calc(100vw - 2 * var(--gutter));
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    background: var(--soft);
  }

  .week-open {
    margin: 0;
    padding: 16px 12px;
    border-radius: 0;
    background: transparent;
  }

  /* The rooms table runs to the panel's right edge, as drawn. */
  .week-open .table-scroll {
    margin-right: -12px;
  }

  .week-open .week-table__head {
    border-radius: var(--radius-md);
    background: var(--canvas);
  }

  .week-table--rooms {
    --week-cols: 44px minmax(112px, 1fr) 56px 176px 80px;
    min-width: 468px;
  }

  .week-table--rooms .week-table__row {
    min-height: 48px;
  }

  .week-table--rooms .week-table__toggle {
    width: 44px;
    height: 48px;
  }

  .week-table__group.is-open {
    background: var(--canvas);
  }

  .week-table__detail {
    margin: 0 8px;
    padding: 4px 8px 8px;
    background: var(--soft);
  }

  .week-positions__row {
    grid-template-columns: minmax(112px, 1fr) 56px 176px 80px;
  }
}

/* Layout switches, last so that they win over a component's own display. */
@media (min-width: 600px) {
  .phone-only {
    display: none;
  }
}

@media (max-width: 599px) {
  .desktop-only {
    display: none;
  }
}

/* The dev gallery's result-file states side by side, each as wide as a side panel. */
.gallery-files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 390px));
  gap: 32px;
  align-items: start;
}

/* The test schedule (boards AdminScheduleWeek, AdminScheduleMonth, AdminScheduleDay, PhoneScheduleDay; T4.40):
 * the toolbar, the filter and the grid of one view, swapped as one element (#schedule-grid). */
.schedule {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.schedule__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  grid-template-areas:
    "title today picker add"
    "views filter filter filter";
  align-items: center;
  gap: 24px 16px;
}

.schedule__title { grid-area: title; }
.schedule__today { grid-area: today; }
.schedule__picker { grid-area: picker; }
.schedule__add { grid-area: add; }

.schedule__views {
  grid-area: views;
  display: flex;
  gap: 8px;
}

.schedule__views .btn {
  padding: 0 20px;
}

.schedule__picker .week-picker__label {
  white-space: nowrap;
}

.schedule__label-short {
  display: none;
}

.schedule__section .section__title + .section__lead {
  margin-top: 4px;
}

/* A manager's name in a row or a column; a disabled one is muted and carries the chip (spec C5). */
.schedule-name {
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
  overflow-wrap: break-word;
  hyphens: auto; /* a long name breaks at a syllable, not after any letter (layout check 2026-10-24) */
}

.schedule-name.is-off {
  color: var(--body);
}

.schedule-name__chip {
  margin-top: 6px;
}

/* One booking: a 44 px line in the week (time, then the comment cut to the cell), a block in the day. */
.schedule-booking {
  position: relative; /* above the cell's add area */
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
}

.schedule-booking:hover {
  background: var(--soft);
}

.schedule-booking__text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-booking__time {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.schedule-booking__comment {
  color: var(--body);
}

/* The empty area of a manager's day: the whole cell under its bookings opens a new booking (spec, empty cell click). */
.schedule-cell__add {
  position: absolute;
  inset: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

/* Week: manager rows x Mon-Sun, the week's count. */
.schedule-week__head,
.schedule-week__row {
  display: grid;
  grid-template-columns: 140px repeat(7, minmax(0, 1fr)) 64px;
}

.schedule-week__head {
  align-items: center;
  min-height: 52px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--body);
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
}

.schedule-week__corner {
  padding: 0 12px 0 16px;
}

.schedule-week__day {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 12px;
}

.schedule-week__date {
  display: inline-flex;
  align-items: center;
  min-width: 28px;
  height: 28px;
  color: var(--ink);
  font-size: 16px;
  line-height: 20px;
}

.schedule-week__day.is-today .schedule-week__date {
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  line-height: 16px;
}

.schedule-week__sum {
  padding: 0 16px 0 8px;
  text-align: right;
}

.schedule-week__row {
  min-height: 56px;
  border-top: 1px solid var(--line);
}

.schedule-week__name {
  min-width: 0;
  padding: 12px 12px 12px 16px;
}

.schedule-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 4px;
  border-left: 1px solid var(--line);
}

.schedule-cell.is-today {
  background: var(--softer);
}

.schedule-week__total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 16px 12px 8px;
  border-left: 1px solid var(--line);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Month: a count per day, shaded by load (C9). Cells 44 px tall and about 28 px wide (accepted exception, D15). */
.schedule-month--28 { --schedule-days: 28; }
.schedule-month--29 { --schedule-days: 29; }
.schedule-month--30 { --schedule-days: 30; }
.schedule-month--31 { --schedule-days: 31; }

.schedule-month__head,
.schedule-month__row {
  display: grid;
  grid-template-columns: 140px repeat(var(--schedule-days, 31), minmax(0, 1fr)) 64px;
  column-gap: 2px;
}

.schedule-month__head {
  min-height: 56px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--body);
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
}

.schedule-month__corner {
  align-self: center;
  padding: 0 8px 0 16px;
}

.schedule-month__day {
  display: flex;
  border-radius: 6px;
  color: var(--body);
  font-variant-numeric: tabular-nums;
}

/* The link fills its role="cell" / role="columnheader" wrapper, so the wrapper keeps the grid cell and its fill. */
.schedule-month__day > a,
.schedule-month__cell > a {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 100%;
  border-radius: inherit;
  color: inherit;
  text-decoration: none;
}

.schedule-month__day > a {
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
}

.schedule-month__day.is-weekend {
  background: var(--pressed);
}

.schedule-month__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  color: var(--ink);
}

.schedule-month__day.is-today .schedule-month__number {
  width: 22px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
}

.schedule-month__weekday {
  font-size: 12px;
  line-height: 14px;
  font-weight: 400;
}

.schedule-month__sum {
  align-self: center;
  padding: 0 16px 0 4px;
  text-align: right;
}

.schedule-month__row {
  align-items: center;
  min-height: 60px;
  border-top: 1px solid var(--line);
}

.schedule-month__name {
  min-width: 0;
  padding: 10px 8px 10px 16px;
}

.schedule-month__name .schedule-name {
  font-size: 14px;
}

.schedule-month__cell {
  display: flex;
  height: 44px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.schedule-month__total {
  padding: 0 16px 0 4px;
  text-align: right;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* The load steps (C9, tokens --load-1..3, D16): 0 empty, 1, 2, 3, 4+ the text colour. */
.schedule-load--0 { background: transparent; }
.schedule-load--1 { background: var(--load-1); }
.schedule-load--2 { background: var(--load-2); }
.schedule-load--3 { background: var(--load-3); }
.schedule-load--4 { background: var(--primary); color: var(--on-primary); }

.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--body);
  font-size: 14px;
  line-height: 20px;
}

.schedule-legend > :first-child {
  margin-right: 4px;
}

.schedule-legend__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
}

.schedule-legend__chip.schedule-load--0 {
  box-shadow: inset 0 0 0 1px var(--line);
}

.schedule-legend__chip.schedule-load--4 {
  color: var(--on-primary);
}

/* Day: a column per manager, bookings by time with the whole comment (D7). */
.schedule-day__head,
.schedule-day__body {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
}

.schedule-day__head {
  border-radius: 8px;
  background: var(--soft);
  color: var(--body);
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
}

.schedule-day__head > * {
  min-width: 0;
  padding: 14px 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.schedule-day__head .chip {
  margin-left: 4px;
  padding: 0 8px;
}

.schedule-day__body {
  border-top: 1px solid var(--line);
}

.schedule-day__column {
  position: relative;
  min-width: 0;
  min-height: 420px;
}

.schedule-day__column + .schedule-day__column {
  border-left: 1px solid var(--line);
}

.schedule-day__name {
  display: none;
}

.schedule-booking--day {
  display: block;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 0;
}

.schedule-booking--day + .schedule-booking--day {
  border-top: 1px solid var(--line);
}

.schedule-booking--day .schedule-booking__time {
  display: block;
  font-size: 16px;
  line-height: 20px;
}

.schedule-booking--day .schedule-booking__comment {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.schedule-day__empty {
  padding: 14px 16px;
  color: var(--hint);
  font-size: 14px;
  line-height: 20px;
}

/* The manager filter (component ScheduleFilter): a pill <summary> over a list of check boxes. */
.staff-filter {
  grid-area: filter;
  justify-self: end;
}

.staff-filter__details {
  position: relative;
}

.staff-filter__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--soft);
  color: var(--ink);
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
}

.staff-filter__button::-webkit-details-marker {
  display: none;
}

.staff-filter__details[open] .staff-filter__button svg {
  transform: rotate(180deg);
}

.staff-filter__list {
  position: absolute;
  z-index: 3;
  top: calc(100% + 4px);
  right: 0;
  width: 300px;
  max-height: min(70vh, 480px);
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
}

.staff-filter__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
}

.staff-filter__option + .staff-filter__option {
  border-top: 1px solid var(--line);
}

.staff-filter__option--all {
  font-weight: 500;
}

/* The native check box stays the control (focus, keyboard, form value); the drawn box shows its state. */
.staff-filter__check {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.staff-filter__box {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--body);
  border-radius: 6px;
  color: var(--on-primary);
}

.staff-filter__box svg {
  visibility: hidden;
}

.staff-filter__check:checked + .staff-filter__box {
  border-color: var(--primary);
  background: var(--primary);
}

.staff-filter__check:checked + .staff-filter__box svg {
  visibility: visible;
}

.staff-filter__check:focus-visible + .staff-filter__box {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.staff-filter__name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.staff-filter__option .chip {
  margin-left: auto;
}

.staff-filter__apply {
  margin: 8px 16px;
}

/* The booking panel (AdminScheduleNew, AdminScheduleClash). */
.booking-form textarea.input {
  min-height: 104px;
  resize: none;
}

.schedule-clash .banner {
  margin-bottom: 8px;
}

/* The usual buttons wait under the clash warning (.panel__actions is a flex box, which would override [hidden]). */
.booking-form .panel__actions[hidden] {
  display: none;
}

/* Phone (PhoneScheduleDay): views, then the period, then today, the filter and a round plus; the week and the month
 * scroll sideways under a fixed name column, the day stacks the managers. */
@media (max-width: 599px) {
  .schedule {
    gap: 16px;
  }

  .schedule__bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "views views views"
      "picker picker picker"
      "today filter add";
    gap: 12px 8px;
  }

  .schedule__views .btn {
    flex: 1;
    padding: 0 8px;
  }

  .staff-filter {
    justify-self: start;
    min-width: 0;
  }

  /* The button sits in the middle column (after «Сегодня»), so a list hung from it would pass the screen's right edge
   * (the e2e audit found a page 422 px wide): the list hangs from the toolbar instead, at its left edge. */
  .schedule__bar {
    position: relative;
  }

  /* The list's top (calc(100% + 4px)) is then the bar's bottom, which is the filter's own row only because the filter
   * sits in the bar's last grid row ("today filter add"). */
  .staff-filter__details {
    position: static;
  }

  .staff-filter__list {
    right: auto;
    left: 0;
    width: min(300px, 100%);
  }

  .schedule__add {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
  }

  .schedule__add-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .week-picker__label:has(.schedule__label-short) .schedule__label {
    display: none;
  }

  .schedule__label-short {
    display: inline;
  }

  /* As drawn (PhoneScheduleDay): the list follows the toolbar; the title with the count stays for screen readers. */
  .schedule__section > div:first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table-scroll:has(> .schedule-week),
  .table-scroll:has(> .schedule-month),
  .table-scroll:has(> .schedule-day) {
    margin-inline: calc(-1 * var(--bleed));
  }

  .schedule-week__head,
  .schedule-week__row {
    grid-template-columns: 104px repeat(7, 124px) 56px;
  }

  .schedule-week__head {
    border-radius: 0;
  }

  .schedule-month__head,
  .schedule-month__row {
    grid-template-columns: 104px repeat(var(--schedule-days, 31), 32px) 56px;
  }

  .schedule-month__head {
    border-radius: 0;
  }

  /* The name column stays while the days scroll. */
  .schedule-week__corner,
  .schedule-week__name,
  .schedule-month__corner,
  .schedule-month__name {
    position: sticky;
    left: 0;
    z-index: 2;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--line);
  }

  .schedule-week__corner,
  .schedule-month__corner {
    background: var(--soft);
  }

  .schedule-week__name,
  .schedule-month__name {
    justify-content: flex-start;
    background: var(--canvas);
  }

  .schedule-week__name .schedule-name,
  .schedule-month__name .schedule-name {
    font-size: 14px;
  }

  .schedule-day__head {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .schedule-day__body {
    display: block;
    border-top: none;
  }

  .schedule-day__column {
    min-height: 0;
  }

  .schedule-day__column + .schedule-day__column {
    border-left: none;
  }

  .schedule-day__name {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px var(--gutter) 8px;
    border-bottom: 1px solid var(--line);
    color: var(--body);
    font-size: 14px;
    line-height: 16px;
    font-weight: 500;
  }

  .schedule-day__name .schedule-name {
    font-size: 14px;
    line-height: 16px;
  }

  .schedule-booking--day {
    display: flex;
    align-items: baseline;
    gap: 16px;
    min-height: 52px;
    padding: 14px var(--gutter);
    border-bottom: 1px solid var(--line);
  }

  .schedule-booking--day + .schedule-booking--day {
    border-top: none;
  }

  .schedule-booking--day .schedule-booking__time {
    flex: none;
    min-width: 44px;
  }

  .schedule-booking--day .schedule-booking__comment {
    margin-top: 0;
    font-size: 16px;
    line-height: 22px;
  }

  .schedule-day__empty {
    padding: 14px var(--gutter);
  }
}

/* The manager's own schedule (board MyScheduleWeek, PhoneScheduleDay; T4.41, D17): the same grids without the name
 * column, no filter and no add button. Placed after the phone rules; two classes win over their single-class rules. */
.schedule--mine .schedule__bar {
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "title today picker"
    "views views views";
}

.schedule--mine .schedule-week__head,
.schedule--mine .schedule-week__row {
  grid-template-columns: repeat(7, minmax(0, 1fr)) 64px;
}

.schedule--mine .schedule-month__head,
.schedule--mine .schedule-month__row {
  grid-template-columns: repeat(var(--schedule-days, 31), minmax(0, 1fr)) 64px;
}

.schedule--mine .schedule-day__body {
  display: block;
}

/* The read-only booking panel: a label over its value, as the form fields are drawn. */
.booking-view__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.booking-view__value {
  font-size: 16px;
  line-height: 22px;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

@media (max-width: 599px) {
  .schedule--mine .schedule__bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "views views views"
      "picker picker picker"
      "today . .";
  }

  .schedule--mine .schedule-week__head,
  .schedule--mine .schedule-week__row {
    grid-template-columns: repeat(7, 124px) 56px;
  }

  .schedule--mine .schedule-month__head,
  .schedule--mine .schedule-month__row {
    grid-template-columns: repeat(var(--schedule-days, 31), 32px) 56px;
  }
}

/* Compact tables (T4.37, owner 2026-10-23): on a desktop every table has 14 px / 20 px text, a 40 px header and 40 px
 * rows (the hairline included). Last, so it wins over each table's own sizes; a phone keeps its rows and cards. The
 * small row buttons are drawn 32 px; their invisible ::after reaches 44 px (T4.4), and a row's buttons are 12 px apart
 * so the hit areas never overlap. */
@media (min-width: 600px) {
  .table__head {
    min-height: 40px;
    line-height: 20px;
  }

  .table__row {
    box-sizing: border-box;
    min-height: 40px;
    font-size: 14px;
    line-height: 20px;
  }

  .table__cell {
    font-size: 14px;
    line-height: 20px;
  }

  .report-detail__row {
    box-sizing: border-box;
  }

  .table .icon-btn--sm {
    width: 32px;
    height: 32px;
  }

  .table .btn--sm,
  .week-table .btn--sm {
    height: 32px;
    padding-block: 0;
  }

  .table .icon-btn--sm::after,
  .table .btn--sm::after,
  .week-table .btn--sm::after {
    inset: -6px -2px;
  }

  .table .icon-btn--sm::after {
    inset: -6px;
  }

  .table .row-actions,
  .table .row-actions--tight {
    gap: 12px;
  }

  .table .table__lock svg,
  .table .record-file svg {
    width: 14px;
    height: 14px;
  }
}
