/* SUMMY · Кабинет мастера — дизайн-токены из концепта */
:root {
  --bg: #ffffff;             /* белый фон */
  --card: #f4f5f1;           /* «окошки» — слегка серый */
  --plum: #50603a;           /* акцент — болотный/оливковый (имя legacy) */
  --plum-dark: #404d2e;
  --plum-deep: #323d24;
  --ink: #23271f;
  --muted: #5c6155;
  --line: #e8eae3;
  --chip-bg: #eceee3;
  --pill-bg: #eef0e8;
  --ok-bg: #e6efe0;
  --ok-text: #46662e;
  --warn-bg: #f4eeda;
  --warn-text: #87692a;
  --gold: #c79a34;
  --radius: 20px;
  --radius-lg: 24px;
  --radius-sm: 14px;
  --radius-xs: 12px;
  /* Единая шкала теней — оливковый ink-тон (раньше тени были магентовыми, legacy #4a1b36) */
  --shadow-ink: 50 61 36;
  --shadow-1: 0 1px 2px rgb(var(--shadow-ink) / .06);
  --shadow-2: 0 6px 18px -6px rgb(var(--shadow-ink) / .16);
  --shadow-3: 0 16px 34px -14px rgb(var(--shadow-ink) / .34);
  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Всегда резервируем место под вертикальный скроллбар — иначе при переходе между
   страницами с/без скролла вьюпорт меняет ширину и центрированный контент + фиксированный
   навбар «уезжают» вбок. */
html { scrollbar-gutter: stable; overflow-y: scroll; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 104px;
}

/* ── Шапка мастера ─────────────────────────────── */
.master-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--plum-deep);
  color: #f5e9df;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  object-fit: cover;
}

.master-name {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.master-meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 4px;
}
/* Бейджи услуг в шапке — чуть компактнее */
.master-meta .badge { padding: 4px 10px; font-size: 12px; }

.rating { font-size: 14px; }

/* Шапка: рейтинг → категория-звёзды → кольцо уровня в один ряд.
   Рейтинг и категория жмутся к имени, кольцо — к правому краю. */
.master-head-info { flex: 1; min-width: 0; }
.head-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; flex-shrink: 0; }
.head-stat-val {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;                 /* общая высота строки-значения для рейтинга и звёзд */
  font-weight: 800;
  font-size: 16.5px;
  line-height: 1;
  letter-spacing: -0.2px;
  color: var(--ink);
}
.head-star { width: 14px; height: 14px; }
/* Индикатор перехода к грейду: стопка шевронов (N засвечены) или галочка */
.head-promo {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  background: var(--chip-bg);
  border-radius: 12px;
  padding: 4px 6px;
}
.head-promo--chev { flex-direction: column; gap: 1.5px; }
.head-promo--chev .chev { width: 14px; height: 7px; color: #b9bdb0; }   /* невыполненные — серые */
.head-promo--up .chev.is-on { color: #5b8f3f; }    /* зелёный — движение вверх */
.head-promo--down .chev.is-on { color: #c0504e; }  /* красный — вниз */
.head-promo--ok svg { width: 18px; height: 18px; color: var(--ok-text); }
.head-stat-lbl { color: var(--muted); font-size: 12px; line-height: 1; white-space: nowrap; }
/* Рейтинг на фоне — чип со скруглением */
.head-chip {
  background: var(--chip-bg);
  border-radius: 14px;
  padding: 5px 9px;
}
.head-stat--link { text-decoration: none; color: inherit; cursor: pointer; transition: transform .16s cubic-bezier(.16,1,.3,1); }
@media (hover: hover) { .head-stat--link:hover { transform: scale(1.04); } }
.head-stat--link:active { transform: scale(.96); }

/* Категория-звёзды = уровень мастера (без слов), та же высота строки, что у рейтинга */
.head-cat-stars {
  display: inline-flex;
  align-items: center;
  height: 20px;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--line);
  white-space: nowrap;
}
.head-cat-stars .is-on { color: var(--gold); }

/* Категория + кольцо = схема оплаты: единый блок, уезжает вправо */
.head-pay {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}
.head-ring { width: 52px; height: 52px; flex-shrink: 0; }
.head-ring .ring-num { font-size: 14px; }
.head-ring .ring-num small { font-size: 9.5px; }
.head-ring--link { text-decoration: none; color: inherit; cursor: pointer; transition: transform .16s cubic-bezier(.16,1,.3,1); }
@media (hover: hover) { .head-ring--link:hover { transform: scale(1.05); } }
.head-ring--link:active { transform: scale(.96); }

/* Узкие экраны: шапка в две строки — имя не жмётся, ничего не обрезается.
   Строка 1: аватар + имя + рейтинг. Строка 2: категория-звёзды + кольцо + шеврон справа. */
@media (max-width: 430px) {
  .master-header { flex-wrap: wrap; column-gap: 12px; row-gap: 10px; }
  .master-head-info { flex: 1 1 auto; }
  .head-pay { flex-basis: 100%; margin-left: 0; justify-content: flex-end; }
}

/* ── Отзывы клиентов ─────────────────────────────── */
.reviews-summary { display: flex; align-items: center; gap: 16px; }
.reviews-avg {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.reviews-stars { color: var(--gold); font-size: 17px; letter-spacing: 1px; }
.reviews-stars .is-on { color: var(--gold); }
.reviews-count { color: var(--muted); font-size: 13px; margin-top: 3px; }

.review-item { display: flex; flex-direction: column; gap: 6px; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-name { font-weight: 700; }
.review-stars { font-size: 13px; letter-spacing: 1px; color: var(--line); white-space: nowrap; }
.review-stars .is-on { color: var(--gold); }
.review-text { font-size: 14px; line-height: 1.45; }
.review-date { color: var(--muted); font-size: 12.5px; }

/* Кнопка «Выйти из профиля» (на экране Профиль) */
.profile-logout { margin-top: 18px; }
.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--card);
  color: var(--muted);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.btn-logout svg { width: 18px; height: 18px; }
.btn-logout:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) {
  .btn-logout { transition: none; }
  .btn-logout:active { transform: none; }
}

/* ── Карточки ──────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-1);
}

/* ── Карточка смены ────────────────────────────── */
.shift-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.shift-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}
.dot-open { background: #4caf6e; }

.shift-time {
  font-weight: 700;
  font-size: 18px;
  margin: 6px 0;
}

.shift-hint {
  color: var(--muted);
  font-size: 13.5px;
  max-width: 220px;
}

/* ── Кнопки ────────────────────────────────────── */
.btn {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  border: none;
  border-radius: 16px;
  padding: 12px 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: var(--plum);
  color: #fff;
  padding: 16px 24px;
}
.btn-primary:hover { background: var(--plum-dark); }

.btn-outline {
  background: none;
  border: 1.5px solid var(--plum);
  color: var(--plum);
  padding: 14px 22px;
}
.btn-outline:hover { background: var(--chip-bg); }

.btn-pill {
  background: var(--pill-bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13.5px;
}
.btn-pill:hover:not(:disabled) { background: #e2d8cf; }
.btn-pill:disabled {
  color: var(--muted);
  cursor: default;
}

.btn-light {
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  font-size: 14px;
  box-shadow: 0 1px 2px rgb(34 39 31 / .12);
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 160ms ease;
}
.btn-light:active:not(:disabled) { transform: scale(0.97); }
.btn-light:disabled { opacity: 0.6; cursor: default; box-shadow: none; }

.btn-wide { width: 100%; }

/* ── Заголовки секций ──────────────────────────── */
.section-head {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-transform: none;
  margin: 24px 4px 11px;
}

.section-head-split {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

/* Статус грейда (слот): доступен новый / риск понижения / стабильно */
.grade-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.grade-status svg { width: 13px; height: 13px; }
.grade-status--stable { background: var(--pill-bg); color: var(--muted); }
.grade-status--up { background: var(--ok-bg); color: var(--ok-text); }
.grade-status--down { background: #f4dddd; color: #8b3434; }
/* Шевроны-«ёлочки» стопкой: кол-во = насколько движется грейд */
.grade-status--arrows { flex-direction: column; gap: 1px; padding: 4px 12px; }
.grade-status--arrows svg { width: 16px; height: 8px; }

.messages {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.message {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 600;
}

.message-success {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.message-error {
  background: #f4dddd;
  color: #8b3434;
}

.add-link {
  color: var(--plum);
  font-weight: 700;
  text-decoration: none;
  text-transform: none;
  font-size: 14px;
  letter-spacing: 0;
}

/* ── Бейджи и чипы ─────────────────────────────── */
.badge {
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-grade { background: var(--chip-bg); color: var(--ink); }
.badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); }
.badge-muted { background: var(--pill-bg); color: var(--muted); }

/* ── Прогресс-бар показателей (Финансы) ───────────── */
.metric-card {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;            /* компактнее дефолтных 18px */
  /* акценты по состоянию (дефолт — бренд) */
  --metric-fill: var(--plum);
  --metric-track: var(--pill-bg);
  --metric-accent: var(--muted);
  transition: transform .18s cubic-bezier(.16, 1, .3, 1), box-shadow .2s ease;
}
/* Цвета баров по позиции — 3 оттенка, производные оливковой палитры --plum:
   первые 2 бара зелёные (c1), последние 2 — охра (c2) и бронза (c3). */
.metric--c1 { --metric-fill: #7A9456; --metric-accent: #4f6a33; }   /* зелёный — Повторные/Активность */
.metric--c2 { --metric-fill: #F7E7B4; --metric-accent: #9a7b2e; }   /* бледно-жёлтый — Лояльность */
.metric--c3 { --metric-fill: #D0E1F4; --metric-accent: #4674a3; }   /* бледно-голубой — Командный бонус */

/* Наведение — лёгкое увеличение с подъёмом тени (как у вкладок навбара) */
@media (hover: hover) {
  .metric-card:hover { transform: scale(1.02); box-shadow: var(--shadow-2); }
}
.metric-card:active { transform: scale(.99); }

.metric-head { display: flex; align-items: baseline; gap: 8px; }
.metric-title { font-weight: 600; color: var(--ink); }
.metric-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--metric-accent);
  font-variant-numeric: tabular-nums;
}
.metric-value {
  margin-left: auto;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.metric-goal { color: var(--muted); font-weight: 500; font-size: 13.5px; }
.metric-card .progress { margin-top: 11px; }

/* Круговые метрики (Активность / Повторные) — две рядом */
.metric-rings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.ring-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 20px 10px 18px;
  text-decoration: none;
  color: inherit;
  min-width: 0;   /* позволяем grid-колонке 1fr сжимать карточку (иначе SVG распирает её до 184px+) */
}
/* Кольцо подстраивается под ширину карточки, но не больше 184px (как в референсе).
   aspect-ratio держит круг, viewBox 36×36 масштабируется без потерь. */
.ring.ring-metric-circle { width: 100%; max-width: 184px; height: auto; aspect-ratio: 1; }
.ring-metric .ring-track {
  stroke: #e6ebdd;                                            /* фолбэк — бледный оттенок */
  stroke: color-mix(in srgb, var(--metric-fill) 16%, #fff);  /* бледная производная цвета дуги */
  stroke-width: 2.1;
}
.ring-metric .ring-fill {
  stroke: var(--metric-fill);
  stroke-width: 2.1;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--metric-fill) 45%, transparent));
  animation: ring-grow 1.1s cubic-bezier(.16, 1, .3, 1) both;
}
.metric-rings .ring-metric:nth-child(2) .ring-fill { animation-delay: .12s; }
@keyframes ring-grow { from { stroke-dasharray: 0, 100; } }
@media (prefers-reduced-motion: reduce) { .ring-metric .ring-fill { animation: none; } }
.ring-metric .ring-num { flex-direction: column; gap: 3px; }
.ring-metric .ring-pct { font-size: clamp(17px, 5vw, 21px); font-weight: 800; letter-spacing: -0.4px; color: var(--ink); line-height: 1; }
.ring-metric .ring-pct small { font-size: 0.62em; font-weight: 700; opacity: 0.7; margin-left: 1px; }
.ring-metric-sub { font-size: clamp(11.5px, 3.3vw, 13px); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1; }
.ring-metric-title { font-weight: 700; font-size: 16px; }
.ring-metric--link { transition: transform .16s cubic-bezier(.16,1,.3,1); }
@media (hover: hover) { .ring-metric--link:hover { transform: scale(1.02); } }
.ring-metric--link:active { transform: scale(.98); }
.returning-lead { color: var(--muted); font-size: 13.5px; margin: 0 4px 12px; line-height: 1.4; }

/* Примечание показателя.
   На тач (по умолчанию) — видно всегда, чтобы инфо не терялась.
   На устройствах с мышью — скрыто, раскрывается по наведению (компактнее). */
.metric-note { color: var(--muted); font-size: 12.5px; margin-top: 8px; line-height: 1.35; }
@media (hover: hover) {
  .metric-note {
    margin-top: 0;
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition:
      grid-template-rows .28s cubic-bezier(.16, 1, .3, 1),
      opacity .2s ease,
      margin-top .28s ease;
  }
  .metric-note > span { overflow: hidden; }
  .metric-card:hover .metric-note { grid-template-rows: 1fr; opacity: 1; margin-top: 8px; }
}

.progress {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--metric-track);
}
/* Декоративные точки-чекпоинты вдоль бара (чтобы не выглядел скучно) */
.progress::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: radial-gradient(circle, rgb(35 39 31 / .16) 1.7px, transparent 2px);
  background-size: 25% 100%;
  background-position: center;
}
.progress-fill {
  position: relative;
  height: 100%;
  border-radius: 999px;
  background: var(--metric-fill);
  width: var(--target, 0%);
  /* разовая анимация при первом показе экрана — сильная ease-out + стаггер */
  animation: progress-grow 820ms cubic-bezier(0.23, 1, 0.32, 1) var(--fill-delay, 0ms) both;
}
/* «бегунок» на ведущем крае заливки */
.progress-fill::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--metric-fill);
  transform: translate(50%, -50%);
  box-shadow: 0 0 0 3px var(--card), 0 1px 3px rgb(34 39 31 / .22);
}
@keyframes progress-grow {
  from { width: 0%; }
  to   { width: var(--target, 0%); }
}
@media (prefers-reduced-motion: reduce) {
  .progress-fill { animation: none; }
}

/* ── Календарь расписания (заполненность дня) ─────── */
.cal-month-block { margin-bottom: 24px; scroll-margin-top: 14px; }
.cal-month {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
  text-transform: capitalize;
}
.cal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
}
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-weekdays { margin-bottom: 8px; }
.cal-weekdays span { text-align: center; font-size: 11px; color: var(--muted); }
.cal-grid { row-gap: 8px; }
.cal-blank { aspect-ratio: 1 / 1; }
.cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
}
.cal-ring {
  --pct: 0;
  --track: #e3e5dd;
  --c: var(--track);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--c) calc(var(--pct) * 1%), var(--track) 0);
}
.cal-ring .cal-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--ink);
}
.cal-num-bare {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
}
.tier-low { --c: #3fae5a; }   /* зелёный — мало записей */
.tier-mid { --c: #e8a72e; }   /* жёлтый — наполовину */
.tier-high { --c: #d6453b; }  /* красный — заполнен */
.tier-empty { --c: var(--track); }  /* смена открыта, записей нет */
.cal-day.is-today .cal-num { color: var(--plum); font-weight: 700; }
.cal-day.is-past { opacity: .5; }
.badge-new { background: var(--warn-bg); color: var(--warn-text); }

.chip {
  background: var(--chip-bg);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12.5px;
  font-weight: 600;
}

/* ── Записи (Сегодня) ──────────────────────────── */
.appointment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.appointment:has(.appointment-link:hover),
.appointment:has(.appointment-link:focus-visible) {
  background: #fffaf5;
  box-shadow: 0 8px 22px rgba(74, 27, 54, 0.12);
  transform: translateY(-1px);
}

.appt-main { min-width: 0; }

.appointment-link {
  flex: 1;
  color: inherit;
  text-decoration: none;
  border-radius: 14px;
  cursor: pointer;
  outline: none;
  padding: 2px 0;
}

.appointment-link:hover .appt-client {
  color: var(--plum);
}

.appointment-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(122, 46, 88, 0.18);
}

.appt-time {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
}

.appt-client {
  font-weight: 700;
  margin-top: 6px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.appt-services {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 2px;
}

.appt-action { flex-shrink: 0; }

.appointment-detail {
  display: grid;
  gap: 14px;
  position: relative;
  padding-right: 54px;
}

.detail-close-link {
  white-space: nowrap;
}

.detail-close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pill-bg);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
}

.detail-close-button:hover {
  background: #e2d8cf;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.detail-list span,
.detail-comment span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.detail-list strong {
  text-align: right;
  font-size: 14px;
}

.detail-comment {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.detail-comment div {
  margin-top: 4px;
}

.detail-actions {
  margin-top: 0;
}

.closure-details {
  padding: 0;
  overflow: hidden;
}

.closure-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}

.closure-details summary::-webkit-details-marker {
  display: none;
}

.closure-details summary:hover {
  background: #fffaf5;
}

.closure-details .notes-title {
  display: block;
  margin-bottom: 3px;
}

.closure-summary {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.closure-toggle {
  color: var(--plum);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.closure-details[open] .closure-toggle {
  font-size: 0;
}

.closure-details[open] .closure-toggle::after {
  content: "Свернуть";
  font-size: 13px;
}

.closure-detail-list {
  padding: 0 18px 18px;
}

.notes-title {
  font-weight: 800;
  margin-bottom: 12px;
}

.notes-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.client-note {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.client-note:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.note-text {
  white-space: normal;
}

.hint-center {
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 18px;
}

/* ── Рабочие дни ───────────────────────────────── */
.work-schedule-page { padding-top: 10px; }

.schedule-title {
  margin-top: 26px;
  margin-bottom: 16px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.work-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.work-day-placeholder {
  min-height: 86px;
}

.work-day {
  min-height: 86px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(74, 27, 54, 0.04);
}

.work-day-weekday,
.work-day-month {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.work-day strong {
  font-size: 22px;
  line-height: 1;
}

.work-day-slots {
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  min-height: 18px;
  max-width: 34px;
  margin-top: 2px;
}

.work-day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2f7d58;
}

.slot-data { display: none; }

.work-day.selected {
  background: #2f7d58;
  border-color: #2f7d58;
  color: #fff;
  box-shadow: 0 10px 22px rgba(47, 125, 88, 0.22);
}

.work-day.past {
  background: #eee9e3;
  border-color: #e1d8ce;
  color: #aaa0a5;
  cursor: default;
  box-shadow: none;
}

.work-day.past .work-day-weekday,
.work-day.past .work-day-month {
  color: #b8afb4;
}

.work-day.past .work-day-dot {
  background: #b8afb4;
}

.work-day.past.selected {
  background: #e5ded6;
  border-color: #d8cec4;
  color: #9f969b;
}

.work-day.active {
  outline: 3px solid rgba(122, 46, 88, 0.22);
  outline-offset: 2px;
}

.work-day.selected .work-day-weekday,
.work-day.selected .work-day-month {
  color: rgba(255, 255, 255, 0.78);
}

.work-day.selected .work-day-dot {
  background: rgba(255, 255, 255, 0.92);
}

.schedule-editor {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
  box-shadow: 0 1px 3px rgba(74, 27, 54, 0.05);
}

.schedule-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.schedule-editor-head strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.schedule-add-slot {
  border: none;
  border-radius: 12px;
  background: var(--chip-bg);
  color: var(--plum-dark);
  font-weight: 800;
  padding: 11px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.schedule-slot-list {
  display: grid;
  gap: 10px;
}

.schedule-slot-row {
  display: grid;
  grid-template-columns: 1fr 1fr 40px;
  gap: 8px;
  align-items: end;
}

.schedule-slot-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.schedule-slot-row select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbf8f4;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 0 10px;
}

.slot-remove {
  width: 40px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: #f7e6e6;
  color: #9a3c3c;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.schedule-empty {
  min-height: 42px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
}

.schedule-hint {
  color: var(--muted);
  font-size: 15px;
  margin: 18px 4px 24px;
}

.schedule-actions {
  display: grid;
  gap: 12px;
}

.schedule-save {
  background: #2f7d58;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(47, 125, 88, 0.22);
}

.schedule-save:hover { background: #286c4c; }

.schedule-back {
  color: #2f7d58;
  background: #eaf4ef;
  padding: 16px 24px;
  font-weight: 800;
}

/* ── Строчные карточки (профиль, операции) ─────── */
.row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.row-title { font-weight: 700; }
.row-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 3px;
}

.empty-card {
  color: var(--muted);
  text-align: center;
}

.master-profile-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.master-photo {
  width: 96px;
  height: 112px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--plum-deep);
  color: #f5e9df;
}

.master-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
}

.master-profile-info {
  min-width: 0;
}

/* ── Портфолио ─────────────────────────────────── */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.work {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 9 / 10;
}

.work img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work figcaption {
  position: absolute;
  inset: auto 0 0 0;
  background: rgba(40, 25, 35, 0.65);
  color: #fff;
  font-size: 12px;
  padding: 6px 8px;
}

.add-form .field { margin-bottom: 12px; }
.form-actions { display: flex; gap: 10px; }

/* ── Финансы ───────────────────────────────────── */
.balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, var(--plum) 0%, var(--plum-dark) 100%);
  color: #fff;
  padding: 16px 20px;
  box-shadow: var(--shadow-3);
}

.balance-main { min-width: 0; }
.balance-label { font-size: 13px; opacity: 0.85; }

.balance-amount {
  font-size: 28px;
  font-weight: 800;
  margin-top: 3px;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.balance-action { flex-shrink: 0; margin: 0; }
.balance-action .btn-light { padding: 15px 30px; font-size: 15.5px; font-weight: 700; min-width: 168px; }
/* «Вывести» — всегда чистый белый фон с читаемым текстом, даже при нулевом балансе */
.balance-action .btn-light:disabled {
  opacity: 1;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 1px 2px rgb(34 39 31 / .12);
}

.amount { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount-plus { color: var(--ok-text); }
.amount-minus { color: var(--ink); }

.amount { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount-plus { color: var(--ok-text); }
.amount-minus { color: var(--ink); }

/* ── Детализация операций ──────────────────────────── */
.op-card { display: flex; flex-direction: column; gap: 8px; }
.op-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.op-title { font-weight: 700; }
.op-meta { display: flex; align-items: center; gap: 10px; }
.op-date { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ── Верхние стат-карточки (Рейтинг / Категория / Достижения) ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  padding: 12px 12px 11px;
  min-height: 74px;
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

.stat-value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-stars {
  display: flex;
  gap: 1px;
  font-size: 15px;
  line-height: 1;
  color: var(--line);
}
.stat-stars .is-on { color: var(--gold); }

.stat-label {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 3px;
}

.stat-icon {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
}
.stat-icon svg { width: 100%; height: 100%; }

/* Ряд из двух карточек (Категория + Уровень) */
.stat-row--2 { grid-template-columns: repeat(2, 1fr); }

/* «Уровень» — кольцевой прогресс по 5 уровням */
.stat-card--ring { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ring { position: relative; width: 46px; height: 46px; }
.ring-svg { width: 100%; height: 100%; }
.ring-track { fill: none; stroke: var(--pill-bg); stroke-width: 3.4; }
.ring-fill {
  fill: none;
  stroke: var(--plum);
  stroke-width: 3.4;
  stroke-linecap: round;
  transition: stroke-dasharray .7s cubic-bezier(.16, 1, .3, 1);
}
.ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
}
.ring-num small { font-weight: 600; font-size: 10px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .ring-fill { transition: none; }
}

/* ── Строка-ссылка «Мой тариф» ───────────────────── */
.tariff-link {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  margin-top: 4px;
  padding: 13px 16px;            /* компактнее дефолтных 18px */
  transition:
    transform 160ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow .2s ease;
}
/* Наведение — увеличение + инверсия цвета иконки (как акцент капсулы навбара) */
@media (hover: hover) {
  .tariff-link:hover { transform: scale(1.02); box-shadow: var(--shadow-2); }
  .tariff-link:hover .tariff-ic { background: var(--plum); color: #fff; }
}
.tariff-link:active { transform: scale(0.97); }

.tariff-ic {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--chip-bg);
  color: var(--plum);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  transition: background .2s ease, color .2s ease;
}
.tariff-ic svg { width: 20px; height: 20px; }

.tariff-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tariff-title { font-weight: 700; }
.tariff-sub {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.tariff-link .setting-chevron { margin-left: auto; }

/* ── Страница тарифа ─────────────────────────────── */
.tariff-hero {
  background: linear-gradient(135deg, var(--plum) 0%, var(--plum-dark) 100%);
  color: #fff;
  padding: 18px 20px;
  box-shadow: 0 10px 30px -10px rgb(50 61 36 / .45);
}
.tariff-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hero-income-pick { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hero-income-label { font-size: 15px; opacity: 0.88; }
.hero-month-select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background-color: rgb(255 255 255 / .14);
  border: 1px solid rgb(255 255 255 / .3);
  border-radius: 999px;
  padding: 5px 30px 5px 12px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 14px;
}
.hero-month-select option { color: #23271f; background: #fff; }
.tariff-hero-income-val {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hero-chart[hidden] { display: none; }

/* Доход по дням — отдельная белая карточка с горизонтальной прокруткой */
.income-card { padding: 0; overflow: hidden; }
.income-scroll {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  overflow-x: auto;
  padding: 30px 16px 12px;
  -webkit-overflow-scrolling: touch;
}
.income-col { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.income-col-track { height: 100px; display: flex; align-items: flex-end; }
.income-col-bar {
  position: relative;
  width: 22px;
  height: var(--h, 8%);
  min-height: 4px;
  background: #7A9456;
  border-radius: 5px 5px 3px 3px;
}
.income-col-amt {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.income-col-day {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  text-align: center;
  line-height: 1.3;
}
.income-col-day b { display: block; font-size: 13px; color: var(--ink); }

.income-days {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 84px;
  padding: 10px 0 6px;
}
.income-day {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
}
.income-bar {
  width: 100%;
  height: var(--h, 10%);
  background: rgb(255 255 255 / .5);
  border-radius: 3px 3px 2px 2px;
  transition: background .15s ease;
}
@media (hover: hover) {
  .income-day:hover .income-bar { background: #fff; }
}

/* Аккордеоны «Категории» / «Уровни» */
.accordion { padding: 0; overflow: hidden; }
.accordion-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.accordion-sum::-webkit-details-marker { display: none; }
.accordion-title { font-weight: 700; font-size: 15.5px; flex: 1; }
.accordion-caret { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); transition: transform .22s cubic-bezier(.16, 1, .3, 1); }
.accordion[open] .accordion-caret { transform: rotate(180deg); }
@media (hover: hover) { .accordion-sum:hover { background: rgb(80 96 58 / .04); } }
.accordion-body { padding: 0 0 8px; }

/* Грейды внутри аккордеона «Категории» — строки, без отдельных карточек */
.accordion-body .grade-item { background: transparent; border-radius: 12px; margin: 0; box-shadow: none; }
.accordion-body .grade-item + .grade-item { border-top: 1px solid var(--line); }
.accordion-body .grade-item--current { box-shadow: inset 0 0 0 1.5px var(--plum); }
.accordion-body .grade-item--next { box-shadow: inset 0 0 0 1.5px var(--ok-text); }

/* «Уровни»: счётчик выполнено/всего в заголовке (формат как у кольца) */
.level-plus {
  flex-shrink: 0;
  background: var(--ok-bg);
  color: var(--ok-text);
  font-size: 12.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.level-plus small { font-weight: 600; opacity: 0.7; }
.level-plus--plum { background: var(--chip-bg); color: var(--plum); }
.level-plus--pink { background: #f6dfe4; color: #9a4f60; }
.level-plus--over { background: #f4dddd; color: #8b3434; }   /* превышен лимит баллов */

/* Подзаголовок вида баллов (Брак / Сервис / Стандарты) */
.claim-cat {
  padding: 12px 18px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #9a4f60;
}

/* Рекламации (Финансы) и «Баллы» (Тариф) — бледно-розовая палитра */
.claims-card { padding: 4px 18px; }
.claim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.claim-row:last-child { border-bottom: none; }
.claim-count {
  flex-shrink: 0;
  min-width: 26px;
  text-align: center;
  font-weight: 800;
  font-size: 12.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.claim-count.is-bad { background: #f6dfe4; color: #9a4f60; }
.accordion-body .claim-item { background: transparent; box-shadow: none; }
.accordion-body .claim-item + .claim-item { border-top: 1px solid var(--line); }
.claim-sub-name { min-width: 0; flex: 1; }
.claim-sub-count { margin-right: 30px; flex-shrink: 0; }   /* колонка вровень с суммой категории */

/* Бар баллов: середина (50%) = лимит; перебор за серединой — красным */
.claims-bar-card { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; }
.claims-over-txt { color: #c0504e; }
.claims-progress {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--pill-bg);
  overflow: hidden;
}
.claims-fill { position: absolute; top: 0; height: 100%; }
.claims-fill--free { left: 0; background: #d49fb0; border-radius: 999px; }
.claims-fill--over { left: 50%; background: #cf5b5b; }
.claims-mid {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgb(255 255 255 / .85);
  transform: translateX(-50%);
  z-index: 2;
}

/* Индикатор выполнено/нет за прошлый месяц у опции */
.level-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.level-check.is-done { background: var(--ok-bg); color: var(--ok-text); }
.level-check.is-miss { background: #f4dddd; color: #8b3434; }

/* Помесячный список внутри опции */
.level-months { display: flex; flex-direction: column; }
.level-month {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.level-month:last-child { border-bottom: none; }
.level-month-name { min-width: 72px; }   /* фикс. колонка месяца — значения выровнены */
.level-month-status { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.level-month-status.is-done { color: var(--ok-text); }
.level-month-status.is-miss { color: #8b3434; }
.level-month-goal { font-weight: 500; color: var(--muted); }
.level-month-mark {
  margin-left: auto;
  margin-right: 30px;          /* колонка вровень с галочкой опции (ширина каретки + gap) */
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
}
.level-month-mark.is-done { color: var(--ok-text); }
.level-month-mark.is-miss { color: #8b3434; }

/* Уровни тарифа — раскрывающиеся карточки (native <details>) */
.grade-item { padding: 0; overflow: hidden; transition: box-shadow .2s ease, opacity .2s ease; }
.grade-sum {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.grade-sum::-webkit-details-marker { display: none; }
.grade-info { min-width: 0; flex: 1; }
.grade-name { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grade-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* Состояния уровней */
.grade-item--passed { opacity: .5; }                 /* пройден — неактивный */
.grade-item--current {                               /* текущий — выделен */
  box-shadow: inset 0 0 0 1.5px var(--plum), 0 4px 14px -6px rgb(80 96 58 / .3);
}
.grade-item--current .grade-name { color: var(--plum); }
.grade-item--next { box-shadow: inset 0 0 0 1.5px var(--ok-text); }  /* следующий — обведён */

.grade-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 8px;
  border-radius: 999px;
}
.grade-tag--cur { background: var(--plum); color: #fff; }
.grade-tag--next { background: var(--ok-bg); color: var(--ok-text); }

.grade-caret {
  width: 18px; height: 18px; flex-shrink: 0;
  color: var(--muted);
  transition: transform .22s cubic-bezier(.16, 1, .3, 1);
}
.grade-item[open] .grade-caret { transform: rotate(180deg); }
@media (hover: hover) {
  .grade-sum:hover { background: rgb(80 96 58 / .04); }
}

/* Таблица цен услуг уровня */
.grade-prices { padding: 0 18px 14px; }
.price-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.price-tbl th {
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--line);
}
.price-tbl th:first-child { text-align: left; }
.price-cat td {
  padding: 10px 0 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--plum);
}
.price-tbl tbody tr:not(.price-cat) td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.price-tbl tbody tr:last-child td { border-bottom: none; }
.price-name { color: var(--ink); padding-right: 10px; }
.price-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.price-pay { color: var(--ink); font-weight: 700; }
.grade-prices-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

.tariff-note { text-align: left; font-size: 13px; line-height: 1.5; }

/* Страница «Убрать смену» */
.remove-shift-lead { font-weight: 600; margin-bottom: 12px; }
.remove-shift-rules { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.remove-shift-rules li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}
.remove-shift-rules li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--plum);
}
.remove-shift-cancel { margin-top: 10px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .tariff-link, .metric-card { transition: none; }
  .tariff-link:active, .tariff-link:hover,
  .metric-card:active, .metric-card:hover { transform: none; }
  .metric-note { transition: none; }
}

.setting-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
}

/* ── Нижняя навигация: liquid-glass approximation ──── */
/* «Liquid glass» — это веб-аппроксимация (backdrop-filter + слои/блики),
   не нативный Apple-материал. Есть твёрдый фолбэк ниже. */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 532px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(2, 1fr) auto repeat(2, 1fr);
  align-items: center;
  padding: 6px 10px;
  border-radius: 24px;
  border: 1px solid rgb(255 255 255 / .55);
  background:
    linear-gradient(135deg, rgb(255 255 255 / .72), rgb(255 255 255 / .40)),
    rgb(255 255 255 / .55);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .7),
    0 12px 34px rgb(34 39 31 / .14);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 2px;
  /* лёгкий инсет внутрь ячейки — чтобы капсула активной вкладки не доезжала до «+» */
  margin: 0 4px;
  border-radius: 16px;
  transition:
    color .2s ease,
    background .25s cubic-bezier(.16, 1, .3, 1),
    transform .2s cubic-bezier(.16, 1, .3, 1),
    box-shadow .25s ease;
}

.tab-icon {
  width: 20px;
  height: 20px;
  transition: transform .2s cubic-bezier(.16, 1, .3, 1);
}

/* Наведение курсора — лёгкое увеличение + мягкая подсветка (на устройствах с мышью) */
@media (hover: hover) {
  .tab:hover { transform: scale(1.04); }
  .tab:hover:not(.active) { color: var(--plum); background: rgb(80 96 58 / .08); }
}
/* Тач/нажатие — короткий «вдавливающий» отклик */
.tab:active { transform: scale(.94); }

/* Расписание (2-я) и Профиль (4-я) — чуть ближе к внешним краям, дальше от «+»
   (суммарный отступ остаётся 8px — это сдвиг, а не изменение ширины) */
.tabbar .tab:nth-child(2) { margin: 0 8px 0 0; }
.tabbar .tab:nth-child(4) { margin: 0 0 0 8px; }

/* Активная вкладка — капсула с инверсией цвета (заливка бренда, светлые иконка/подпись, как у «+»).
   Без анимации появления — спокойно, статично; анимируется только нажатие. */
.tab.active {
  color: #fff;
  font-weight: 700;
  background: var(--plum);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .2),
    0 5px 14px -4px rgb(80 96 58 / .55);
}

@media (prefers-reduced-motion: reduce) {
  .tab:hover, .tab:active { transform: none; }
}

/* Центральная кнопка + (FAB) */
.fab {
  justify-self: center;
  width: 54px;
  height: 54px;
  margin-top: -26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  /* градиент центрирован по горизонтали (50%) — иначе блик уводит форму в «яйцо» */
  background: radial-gradient(135% 135% at 50% 22%, var(--plum), var(--plum-deep));
  border: none;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .22),
    0 6px 16px -2px rgb(80 96 58 / .42);
  transition:
    transform .2s cubic-bezier(.16, 1, .3, 1),
    background .25s ease,
    box-shadow .25s ease;
}

/* Наведение — лёгкое увеличение + смена цвета на более светлый/насыщенный (как акцент капсулы) */
@media (hover: hover) {
  .fab:hover {
    transform: scale(1.05);
    background: radial-gradient(135% 135% at 50% 22%, #6a7c4a, var(--plum));
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / .35),
      0 9px 22px -3px rgb(80 96 58 / .5);
  }
}
.fab:active { transform: scale(.94); }
.fab svg { width: 26px; height: 26px; }
/* Открытая шторка → поворот в крестик (выше специфичность, перебивает hover) */
.fab-toggle:checked ~ .tabbar .fab { transform: rotate(45deg); }

@media (prefers-reduced-motion: reduce) {
  .fab { transition: none; }
  .fab:hover, .fab:active { transform: none; }
}

/* Шторка быстрых действий */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgb(34 39 31 / .38);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.action-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 115%);
  width: calc(100% - 20px);
  max-width: 540px;
  z-index: 46;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 12px calc(14px + env(safe-area-inset-bottom));
  border-radius: 28px;
  border: 1px solid rgb(255 255 255 / .5);
  background:
    linear-gradient(135deg, rgb(255 255 255 / .85), rgb(255 255 255 / .62)),
    rgb(255 255 255 / .72);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  box-shadow: 0 -10px 40px rgb(34 39 31 / .18);
  transition: transform .26s cubic-bezier(.16, 1, .3, 1);
}
.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin: 2px auto 6px;
}
.fab-toggle:checked ~ .sheet-overlay { opacity: 1; visibility: visible; }
.fab-toggle:checked ~ .action-sheet { transform: translate(-50%, 0); }

.sheet-item-form { margin: 0; }
.sheet-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.sheet-item:active { transform: scale(.99); }
/* Неприменимое действие со сменой — показываем, но погашенным (без 404) */
.sheet-item--off { opacity: .42; cursor: default; }
.sheet-item--off:active { transform: none; }
.sheet-ic {
  width: 34px;
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  font-size: 18px;
  background: var(--chip-bg);
  color: var(--plum);
}
.sheet-ic svg { width: 20px; height: 20px; }
.sheet-cancel {
  text-align: center;
  padding: 13px;
  border-radius: 16px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .fab, .sheet-overlay, .action-sheet { transition: none; }
  .tab .tab-icon { animation: none; transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .tabbar, .action-sheet {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ── Формы и вход ──────────────────────────────── */
.field { display: block; margin-bottom: 14px; }

.field-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--font-body);
  background: #fff;
  resize: vertical;
}

.field input[type="file"] {
  padding: 10px 12px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--plum);
}

/* Чипы выбранных категорий */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Список чекбоксов (выбор категорий) */
.check-list ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.check-list li { margin: 0; }
.check-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 4px;
  font-size: 15px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.check-list li:last-child label { border-bottom: none; }
.check-list input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--plum);
  flex-shrink: 0;
}

.close-form .errorlist,
.add-form .errorlist {
  color: #b03050;
  font-size: 13px;
  list-style: none;
  margin: -4px 0 10px;
}

.appointment-summary {
  margin-bottom: 14px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  margin: 4px 0 16px;
}

.checkbox-input {
  margin-top: 3px;
  accent-color: var(--plum);
}

.login-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding-bottom: 20px;
}

.login-brand { text-align: center; margin-bottom: 24px; }

.login-logo {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 4px;
  color: var(--plum-deep);
}

.login-sub {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
}

.login-card { padding: 24px; }

.login-alt-link {
  display: block;
  margin-top: 14px;
  color: var(--plum-deep);
  font-size: 14px;
  text-align: center;
  text-decoration: none;
}

.form-error {
  color: #b03050;
  font-size: 13.5px;
  margin-bottom: 12px;
}

/* ── Motion: появление блоков финансов (vanilla JS, см. static/js/finance-anim.js) ──
   Прячем reveal-цели до анимации, чтобы не было «вспышки». Селектор бьёт по уже
   существующему DOM экрана финансов — разметку карточек трогать не нужно.
   Класс .js-motion ставится в <head> только когда reduced-motion НЕ запрошен,
   поэтому при reduced-motion блоки сразу видимы и JS-анимации не запускаются. */
.js-motion main[data-tab="finance"] > .section-head,
.js-motion main[data-tab="finance"] > .card,
.js-motion main[data-tab="finance"] > .metric-rings {
  opacity: 0;
  will-change: opacity, transform;
}
