/* Кабинет персонала «Моравии». Палитра сайта, системные шрифты, крупные элементы для планшета на кассе */

:root {
  --bg: #fff5ea;
  --surface: #ffe7cf;
  --card: #fffbf6;
  --text: #231a18;
  --muted: #6b5d55;
  --line: rgba(35, 26, 24, .12);
  --accent: #be2223;
  --accent-dark: #9b1a1b;
  --accent-soft: #fbe0dc;
  --green: #0f6652;
  --green-soft: #dcefe6;
  --gold: #ffa633;
  --gold-soft: #ffeccc;
  --focus: #0f6652;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(35, 26, 24, .06), 0 6px 20px rgba(35, 26, 24, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 130px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  min-height: 100vh;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.75rem; font-weight: 750; letter-spacing: -.01em; margin-bottom: 16px; }
p { margin: 0 0 10px; }
a { color: var(--accent); }
code { font: .92em ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--surface); padding: 1px 6px; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ── Шапка ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 245, 234, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  max-width: 1200px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand__logo { display: block; height: 24px; width: auto; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav__link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap;
}
.nav__link:hover { background: var(--surface); }
.nav__link[aria-current="page"] { background: var(--text); color: #fff; }
.nav__link--fresh { box-shadow: inset 0 0 0 2px var(--gold); }
.badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: .78rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.badge--fresh { animation: pulse 1.6s ease-in-out 4; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(190, 34, 35, .45); }
  50% { box-shadow: 0 0 0 7px rgba(190, 34, 35, 0); }
}
.who { display: flex; align-items: center; gap: 10px; flex: none; }
.who__name { font-weight: 600; }
.who__role { color: var(--muted); font-size: .88rem; }

/* ── Раскладка ── */
.main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; outline: none; }
.view { display: flex; flex-direction: column; gap: 16px; }
.view > h1 { margin-bottom: 0; }
.view--narrow { max-width: 760px; }
.lead { color: var(--muted); max-width: 70ch; margin: -6px 0 0; }
.loading { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 18px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.back { margin: 0; }
.back a { text-decoration: none; font-weight: 600; }

/* ── Карточки ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.card__title { font-size: 1.12rem; font-weight: 700; margin-bottom: 12px; }
.card--attention { background: var(--gold-soft); border-color: rgba(255, 166, 51, .55); }
.card--ok { background: var(--green-soft); border-color: rgba(15, 102, 82, .3); }
.card--empty { text-align: left; }
.sub { font-size: .95rem; color: var(--muted); font-weight: 600; margin: 12px 0 8px; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }

.notice {
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 12px 16px; margin: 0;
}
.notice--warn { background: var(--gold-soft); }
.notice--ok { background: var(--green-soft); color: #0b4a3c; font-weight: 600; }
.notice--fresh { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--gold-soft); }

/* ── Кнопки ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--text);
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn--ghost { background: transparent; }
.btn--danger { background: #8f1415; border-color: #8f1415; color: #fff; }
.btn--danger:hover { background: #6f0f10; }
.btn--danger-ghost { background: transparent; color: var(--accent); border-color: rgba(190, 34, 35, .35); }
.btn--danger-ghost:hover { background: var(--accent-soft); }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: .92rem; }
.btn--lg { min-height: 54px; padding: 0 26px; font-size: 1.08rem; }
.btn--block { width: 100%; }
.is-busy button[type=submit] { cursor: progress; }

/* ── Поля ── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field--grow { flex: 1; }
.field__label { font-weight: 600; font-size: .95rem; }
.field__hint { color: var(--muted); font-size: .85rem; }
.field__err { color: var(--accent); font-size: .88rem; font-weight: 600; }
.form-error {
  color: var(--accent-dark); background: var(--accent-soft);
  border-radius: var(--radius-sm); padding: 10px 14px; margin: 10px 0; font-weight: 600;
}
input, select, textarea {
  font: inherit; color: var(--text);
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: #fff; border: 1px solid rgba(35, 26, 24, .22); border-radius: var(--radius-sm);
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: 3px solid rgba(15, 102, 82, .25); outline-offset: 0; }
input:disabled, select:disabled { background: #f4ece4; color: var(--muted); }
[aria-invalid="true"] { border-color: var(--accent); background: #fff8f7; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
.input--big { font-size: 1.25rem; min-height: 56px; font-variant-numeric: tabular-nums; }
.input--code { font-size: 1.5rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

.check, .switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; min-height: 44px; padding: 8px 0; }
.check input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--green); }
.switch input {
  appearance: none; flex: none; margin: 0;
  width: 48px; height: 28px; border-radius: 999px; padding: 0;
  background: #d8cbc0; border: 0; position: relative; cursor: pointer; transition: background-color .15s;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s;
}
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(20px); }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
.switch span, .check span { padding-top: 2px; }
.checks { border: 0; padding: 0; margin: 16px 0 0; }
.checks legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.consent-box { margin-top: 12px; padding: 6px 14px; border-radius: var(--radius-sm); background: var(--surface); }

/* Сегментный переключатель на радиокнопках */
.seg { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg__legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: 6px; }
.seg__row { display: flex; gap: 4px; background: var(--surface); border-radius: 999px; padding: 4px; width: fit-content; max-width: 100%; }
.seg__opt { position: relative; cursor: pointer; flex: 1 1 auto; min-width: 0; }
.seg__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg__opt span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 40px; padding: 2px 14px; border-radius: 999px; font-weight: 600; line-height: 1.15; }
.seg__opt input:checked + span { background: #fff; box-shadow: 0 1px 3px rgba(35, 26, 24, .15); }
.seg__opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }

/* ── Вход ── */
.login-wrap { min-height: calc(100vh - 120px); display: grid; place-items: center; }
.login { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.login__brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 4px; }
.login__logo { display: block; height: 50px; width: auto; }
.login__title { font-size: 1.5rem; }

/* ── Поиск и карта гостя ── */
.search { display: flex; flex-direction: column; gap: 14px; }
.search__row { display: flex; align-items: flex-end; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 2px 12px;
  border-radius: 999px; background: var(--surface); font-size: .85rem; font-weight: 650;
  border: 0; color: var(--text); font-family: inherit; text-decoration: none;
}
button.chip, a.chip { cursor: pointer; min-height: 36px; }
.chip--active, .chip--r-done { background: var(--green-soft); color: #0b4a3c; }
.chip--pending, .chip--r-new { background: var(--gold-soft); color: #7a4a00; }
.chip--blocked, .chip--erased, .chip--r-cancelled { background: var(--accent-soft); color: var(--accent-dark); }
.chip--r-confirmed { background: #e2ecf8; color: #1d4370; }
.chip--gold { background: var(--gold); color: #3d2400; }
.chip--muted { background: #eee5dd; color: var(--muted); }
.chip--member { background: var(--green); color: #fff; }
.chip--fav { background: #fff; border: 1px solid var(--line); }

.cust { display: flex; flex-direction: column; gap: 14px; }
.cust__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.cust__who { min-width: 0; }
.cust__name { font-size: 1.6rem; font-weight: 750; overflow-wrap: anywhere; }
.cust__phone { margin: 4px 0 0; color: var(--muted); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.cust__card { text-align: right; flex: none; }
.cust__card span { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.cust__card strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.stat { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; min-width: 0; }
.stat dt { color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat dd { margin: 2px 0 0; font-size: 1.3rem; font-weight: 750; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat dd.stat__sub { font-size: .82rem; font-weight: 500; color: var(--muted); }
.stat--accent { background: var(--accent); color: #fff; }
.stat--accent dt, .stat--accent dd.stat__sub { color: rgba(255, 255, 255, .85); }
.stat--accent dd { font-size: 1.7rem; }

.checkout { display: flex; flex-direction: column; gap: 14px; }
.op-retry { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 10px 0; }
.op-retry p { margin: 0; font-weight: 600; }
.preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.preview > div { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; }
.preview dt { color: var(--muted); font-size: .85rem; font-weight: 600; }
.preview dd { margin: 2px 0 0; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.preview--result { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.preview--result > div { background: rgba(255, 255, 255, .7); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.kv > div { display: contents; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.kv--inline { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 14px; font-size: .92rem; }
.kv--inline > div { display: flex; gap: 6px; }

/* ── Операции ── */
.tx-list { list-style: none; margin: 0; padding: 0; }
.tx { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.tx:first-child { border-top: 0; }
.tx--reversed .tx__kind, .tx--reversed .tx__pts { text-decoration: line-through; color: var(--muted); }
.tx__main { min-width: 0; }
.tx__kind { font-weight: 650; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tx--reversed .tx__kind .chip { text-decoration: none; }
.tx__meta { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.tx__reason { font-size: .9rem; margin-top: 2px; font-style: italic; overflow-wrap: anywhere; }
.tx__side { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tx__pts { font-size: 1.15rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.tx__pts.is-plus { color: var(--green); }
.tx__pts.is-minus { color: var(--accent); }
.tx__bal { color: var(--muted); font-size: .82rem; }
.notes .field { margin-bottom: 4px; }

/* ── Заявки ── */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
}
.tab[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.tab__n { font-size: .82rem; opacity: .75; font-variant-numeric: tabular-nums; }
.req-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 14px; }
.req { display: flex; flex-direction: column; gap: 12px; border-left: 5px solid var(--line); }
.req--new { border-left-color: var(--gold); }
.req--confirmed { border-left-color: #4a7ab5; }
.req--done { border-left-color: var(--green); }
.req--cancelled { border-left-color: var(--accent); opacity: .85; }
.req__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.req__title { font-size: 1.1rem; font-weight: 750; }
.req__time { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.req__body { display: flex; flex-direction: column; gap: 10px; }
.req__contact { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; overflow-wrap: anywhere; }
.req__phone { font-weight: 650; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.req__addr, .req__comment { margin: 4px 0 0; }
.req__comment { white-space: pre-wrap; font-style: italic; }
.req__purged { margin: 0; font-style: italic; }
.req__masked { margin: 4px 0 0; font-size: .85rem; }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--line); }
.lines li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.lines__sum { flex: none; font-variant-numeric: tabular-nums; }
.req__member { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.req__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.req__actions .btn { flex: 1 1 auto; }

/* ── Анкеты ── */
.club-list { display: flex; flex-direction: column; gap: 10px; }
.club-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; text-decoration: none; color: var(--text); }
.club-row:hover { border-color: rgba(35, 26, 24, .3); }
.club-row__main, .club-row__side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.club-row__side { align-items: flex-end; text-align: right; flex: none; }
.club-row__name { font-size: 1.08rem; overflow-wrap: anywhere; }
.club-row__phone { font-variant-numeric: tabular-nums; }

/* ── Опасная зона ── */
.danger { border-color: rgba(190, 34, 35, .35); }
.danger__sum { cursor: pointer; font-weight: 700; color: var(--accent-dark); min-height: 32px; display: flex; align-items: center; }
.danger__form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.danger__warn { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; }

/* ── Правила ── */
.tiers { display: flex; flex-direction: column; gap: 10px; }
.tier {
  display: grid; grid-template-columns: 1.2fr .7fr .9fr 2fr auto auto; gap: 10px; align-items: end;
  padding: 12px; border-radius: var(--radius-sm); background: var(--surface);
}
.tier__cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tier__label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tier__active { padding: 0; min-height: 48px; align-items: center; }
.tier .form-error { grid-column: 1 / -1; margin: 0; }

/* ── Сайт: меню, тексты, фото ── */
.counts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0; }
.counts > div { background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.counts dt { color: var(--muted); font-size: .82rem; font-weight: 600; }
.counts dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.steps { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.steps li::marker { font-weight: 700; color: var(--accent); }
.steps__hint { display: block; margin-top: 6px; }
.group__hint { margin: -4px 0 12px; }
.file-input { min-height: 0; padding: 10px; cursor: pointer; }
.diff-plus { color: var(--green); font-weight: 650; }
.diff-minus { color: var(--accent); font-weight: 650; }
.table th[scope="row"] { background: transparent; font-size: .93rem; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 600; }

.versions { list-style: none; margin: 0; padding: 0; }
.versions li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.versions li:first-child { border-top: 0; }
.versions__main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.versions__main .chip { min-height: 24px; vertical-align: middle; }
.versions__meta { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }

.rep-wrap { display: flex; flex-direction: column; gap: 10px; }
.rep { display: flex; flex-direction: column; gap: 12px; }
.rep:empty { display: none; }
.rep__row { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; }
.rep__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.rep__title { font-size: .95rem; font-weight: 700; }
.rep__empty { margin: 0; }
.gallery-rows { display: flex; flex-direction: column; gap: 10px; }
.gallery-row { display: grid; grid-template-columns: 2rem minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px 14px; align-items: end; }
.gallery-row__n { font-weight: 750; color: var(--muted); min-height: 48px; display: flex; align-items: center; justify-content: center; }
.publish-bar {
  position: sticky; bottom: 12px; z-index: 5;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(35, 26, 24, .14);
  padding: 12px 16px;
}
.publish-bar .form-error { margin: 0 0 10px; }
.publish-bar__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.media-item { margin: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.media-item__thumb { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface); }
.media-item__thumb--video { display: flex; align-items: center; justify-content: center; font-size: 2.4rem; color: var(--muted); }
.media-item__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.media-item__name { font: 600 .9rem ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.media-item__meta { color: var(--muted); font-size: .82rem; }
.media-item .btn { margin-top: auto; align-self: flex-start; }
.uploads { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.uploads:empty { display: none; }
.upload { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.upload--done { background: var(--green-soft); }
.upload--bad { background: var(--accent-soft); }
.upload__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.upload__file { font-weight: 650; overflow-wrap: anywhere; }
.upload__meta { color: var(--muted); font-size: .85rem; }
.upload__status { font-size: .9rem; font-weight: 600; }
.upload__status:empty { display: none; }
.upload .form-error { margin: 0; }
progress { width: 100%; height: 10px; accent-color: var(--green); }

/* ── Таблицы ── */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface); }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-off td { color: var(--muted); }
.audit__details { color: var(--muted); min-width: 220px; overflow-wrap: anywhere; }

/* ── Диалоги и уведомления ── */
.dialog {
  border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 32px));
  background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(35, 26, 24, .3);
}
.dialog::backdrop { background: rgba(35, 26, 24, .45); }
.dialog__form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dialog__title { font-size: 1.25rem; }
.dialog__text { margin: 0; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.toasts { position: fixed; z-index: 50; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px;
  border-radius: var(--radius-sm); background: var(--text); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  animation: toast-in .2s ease-out;
}
.toast span { flex: 1; }
.toast--ok { background: var(--green); }
.toast--error { background: var(--accent-dark); }
.toast--warn { background: #7d4a0a; }
.toast__btn { flex: none; border: 1px solid rgba(255, 255, 255, .6); background: transparent; color: #fff; border-radius: 999px; min-height: 36px; padding: 0 12px; font: inherit; font-weight: 650; cursor: pointer; }
.toast__close { flex: none; border: 0; background: transparent; color: #fff; font-size: 1.4rem; width: 36px; height: 36px; cursor: pointer; border-radius: 50%; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.noscript { padding: 24px 16px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Планшет ── */
@media (max-width: 980px) {
  .topbar__in { flex-wrap: wrap; gap: 6px 12px; }
  .nav { order: 3; flex-basis: 100%; }
  .who { margin-left: auto; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tier { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tier__cell--wide { grid-column: span 3; }
  .counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Телефон ── */
@media (max-width: 600px) {
  .main { padding: 16px 16px 48px; }
  h1 { font-size: 1.45rem; }
  .card { padding: 16px; border-radius: 16px; }
  .who__role { display: none; }
  .brand__logo { height: 20px; }
  .grid2, .grid3, .preview, .preview--result { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px; }
  .cust__head { flex-direction: column; gap: 6px; }
  .cust__card { text-align: left; }
  .cust__name { font-size: 1.35rem; }
  .search__row { flex-direction: column; align-items: stretch; }
  .tx { flex-direction: column; gap: 6px; }
  .tx__side { flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
  .club-row { flex-direction: column; gap: 8px; }
  .club-row__side { align-items: flex-start; text-align: left; }
  .tier { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tier__cell:first-child, .tier__cell--wide { grid-column: 1 / -1; }
  .seg__row { width: 100%; }
  .seg__opt span { padding: 2px 8px; }
  .login { padding: 22px 18px; }
  .toasts { left: 16px; right: 16px; max-width: none; }
  .dialog__actions .btn { flex: 1 1 auto; }
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .gallery-row__n { display: none; }
  .versions li { flex-direction: column; align-items: flex-start; }
  .publish-bar { bottom: 8px; }
  .publish-bar__row .btn { flex: 1 1 auto; }
}
