/* Нефродиета — лендинг. Палитра: синий и голубой лист + персиковые акценты. */

:root {
  --blue: #3f8fd8;
  --blue-dark: #1f5fa8;
  --blue-soft: #8cc4f0;
  --blue-bg: #eaf4fc;
  --peach: #f5c6a0;
  --peach-dark: #e59b67;
  --peach-bg: #fcf1e9;
  --text: #25334a;
  --muted: #66758a;
  --white: #fff;
  --radius: 24px;
  --shadow: 0 12px 40px rgba(40, 80, 130, 0.12);
  --container: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; overflow-x: clip; }

/* Стандартная плашка Blazor Server о разрыве SignalR-соединения (PublicLayout.razor,
   MainLayout.razor). Скрыта по умолчанию — без этого правила (обычно идёт в шаблонном
   app.css, которого в этом проекте нет) плашка видна на каждой странице всегда, а не
   только при реальном разрыве связи; JS-рантайм Blazor сам снимает "none" при обрыве.
   Обнаружено визуально на форме регистрации (POST со сменой страницы) — 2026-09-26. */
#blazor-error-ui {
  display: none;
  position: fixed; bottom: 0; left: 0; width: 100%; z-index: 1000;
  background: #FFF9C4; color: #5D4037; padding: 10px 16px;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.15); font-size: 14px;
}
#blazor-error-ui .reload { color: var(--blue-dark); margin-left: 6px; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); font-size: 14px; }

/* ── Кнопки и метки ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 16px 32px;
  border-radius: 16px;
  background: var(--blue);
  color: var(--white);
  font-weight: 600; font-size: 15px;
  text-decoration: none;
  border: 2px solid var(--blue);
  transition: transform .2s, background .2s, box-shadow .2s;
  box-shadow: 0 8px 20px rgba(63, 143, 216, 0.35);
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--blue-dark); box-shadow: none; }
.btn--ghost:hover { background: var(--blue); color: var(--white); }
.btn--small { padding: 10px 20px; font-size: 14px; border-radius: 12px; }

.pills { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.pill {
  padding: 8px 18px; border-radius: 12px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--white);
}
.pill--blue { background: linear-gradient(90deg, var(--blue-soft), var(--blue)); }
.pill--peach { background: var(--peach); color: #fff; }

/* Лист: форма из двух скруглённых противоположных углов */
.leaf { position: absolute; border-radius: 0 72% 0 72%; }

/* ── Шапка ──────────────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(252, 241, 233, 0.92);
  backdrop-filter: blur(10px);
}
.header__inner { display: flex; align-items: center; gap: 32px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo__text {
  font-size: 11px; line-height: 1.1; letter-spacing: .28em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 500; font-size: 15px; position: relative; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px;
  background: var(--blue); transition: right .25s;
}
.nav a:hover::after { right: 0; }
.burger { display: none; }

/* ── Первый экран ───────────────────────────────────────────────────────── */
.hero { position: relative; padding: 72px 0 40px; }
.hero::before {
  content: ""; position: absolute; left: 0; top: 104px; width: 32%; height: 40px;
  background: linear-gradient(90deg, rgba(140, 196, 240, .55), rgba(140, 196, 240, 0));
  border-radius: 0 12px 12px 0; z-index: -1;
}
.hero__inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero__kicker { color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.hero__title {
  font-size: clamp(44px, 7vw, 84px); font-weight: 800;
  text-transform: uppercase; letter-spacing: .01em;
  background: linear-gradient(180deg, var(--blue-soft), var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 24px;
}
/* Blazor FocusOnNavigate (Routes.razor) фокусирует h1 — браузер рисовал вокруг него чёрную рамку. */
.hero__title:focus, .hero__title:focus-visible { outline: none; }
.hero__lead { font-size: 18px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; max-width: 520px; line-height: 1.5; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
.hero__visual { position: relative; display: flex; justify-content: center; align-items: center; min-height: 460px; }
.leaf--hero {
  width: 88%; aspect-ratio: 1; right: 0; top: 50%; transform: translateY(-50%);
  background: linear-gradient(135deg, #e2f0fb 0%, #c7e2f7 100%);
}
.hero__visual::after {
  content: ""; position: absolute; width: 38%; aspect-ratio: 1; left: 2%; bottom: 0;
  border-radius: 72% 0 72% 0; background: var(--peach-bg); z-index: 0;
}
/* Картинка — исходная, с рамкой, без обработки (решение оператора 2026-09-21) */
.hero__img { position: relative; z-index: 1; width: 92%; }

/* ── Общие секции ───────────────────────────────────────────────────────── */
.section { padding: 96px 0; position: relative; }
.section--peach { background: var(--peach-bg); }
.section--blue { background: var(--blue-bg); }
.section__title {
  font-size: clamp(30px, 4vw, 44px); font-weight: 600; text-transform: uppercase;
  color: var(--blue); letter-spacing: .02em; margin-bottom: 20px;
}
.section__lead { color: var(--muted); font-size: 17px; max-width: 720px; margin-bottom: 40px; }

/* ── О школе ────────────────────────────────────────────────────────────── */
.about__inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 64px; align-items: center; }
.about__lead { font-size: 20px; font-weight: 600; line-height: 1.45; }
.about__text p:not(.about__lead) { color: var(--muted); }
.about__text .btn { margin-top: 12px; }
.about__card {
  margin: 0; background: var(--white); border-radius: var(--radius); padding: 40px 32px;
  text-align: center; box-shadow: var(--shadow); position: relative;
}
.about__card::before {
  content: ""; position: absolute; width: 90px; height: 90px; top: -28px; right: -20px;
  border-radius: 0 72% 0 72%; background: var(--blue-soft); opacity: .6;
}
.about__card img { width: 180px; margin: 0 auto 16px; }
.about__card figcaption { color: var(--muted); font-size: 14px; }

.card {
  background: var(--white); border-radius: var(--radius); padding: 28px;
  box-shadow: 0 6px 24px rgba(40, 80, 130, .07);
}
.card h3 { font-size: 19px; font-weight: 700; margin: 12px 0 10px; }
.card p { color: var(--muted); font-size: 15px; margin: 0; }
/* ── Приложение ─────────────────────────────────────────────────────────── */
.app__inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.steps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 20px; }
.step { display: flex; gap: 18px; align-items: flex-start; }
.step__n {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 14px; background: var(--blue); color: #fff; font-weight: 800;
}
.step:nth-child(even) .step__n { background: var(--peach); }
.step h3 { font-size: 17px; font-weight: 700; margin: 2px 0 4px; }
.step p { color: var(--muted); margin: 0; font-size: 15px; }
.app__note { font-size: 14px; color: var(--muted); border-left: 3px solid var(--blue-soft); padding-left: 14px; }
.app__download { margin-top: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.app__download .btn { width: auto; }

.app__phones { position: relative; height: 620px; }
.leaf--app { width: 80%; aspect-ratio: 1; left: 10%; top: 8%; background: var(--peach-bg); }
.phone {
  position: absolute; width: 250px; border-radius: 40px; padding: 10px;
  background: #1c2533; box-shadow: 0 30px 60px rgba(30, 45, 70, .25);
}
.phone img { border-radius: 30px; }
.phone--back { left: 6%; top: 60px; transform: rotate(-7deg); opacity: .96; }
.phone--front { right: 6%; top: 0; transform: rotate(4deg); }

/* ── Важно ──────────────────────────────────────────────────────────────── */
.notice { padding: 0 0 96px; }
.notice__box {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 28px 32px; border-radius: var(--radius);
  background: var(--peach-bg); border: 1px dashed var(--peach);
}
.notice__box p { margin: 0; }
.notice__icon { flex: none; width: 40px; height: 40px; fill: none; stroke: var(--peach-dark); stroke-width: 3; stroke-linecap: round; }

/* ── Контакты ───────────────────────────────────────────────────────────── */
.contacts__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.contact h3 { margin-top: 0; }
.contact .muted { margin-bottom: 16px; }
.contact__link { display: block; font-weight: 600; color: var(--blue-dark); text-decoration: none; margin-top: 6px; word-break: break-all; }
.contact__link:hover { text-decoration: underline; }
.socials { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Подвал ─────────────────────────────────────────────────────────────── */
.footer { padding: 28px 0; font-size: 14px; color: var(--muted); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--muted); }

/* ── Адаптив ────────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .hero__inner, .about__inner, .app__inner { grid-template-columns: 1fr; }
  .hero__visual { min-height: 0; order: -1; max-width: 520px; margin: 0 auto; width: 100%; }
  .contacts__grid { grid-template-columns: 1fr 1fr; }
  .app__phones { max-width: 520px; width: 100%; margin: 0 auto; }
}

@media (max-width: 760px) {
  .header__cta { display: none; }
  .burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; margin-left: auto; padding: 10px;
    background: none; border: 0; cursor: pointer;
  }
  .burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
  .nav {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 24px 20px;
    background: var(--peach-bg); box-shadow: 0 12px 20px rgba(0, 0, 0, .06);
    display: none;
  }
  .nav--open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid #f0dfd2; }
  .container { padding: 0 16px; }
  .section { padding: 64px 0; }
  .hero { padding-top: 32px; }
  .hero::before { display: none; }
  .hero__lead { font-size: 15px; }
  .contacts__grid { grid-template-columns: 1fr; }
  .app__phones { height: 480px; }
  .phone { width: 190px; border-radius: 32px; padding: 8px; }
  .phone img { border-radius: 25px; }
  .notice__box { flex-direction: column; padding: 22px; }
  .about__card::before { right: -8px; }
}

/* ── Шапка: вход / аккаунт (веб-кабинет, 2026-09-26) ─────────────────────── */
/* min-width:0 на каждом уровне — иначе flex-контейнер не сжимается ниже
   min-content своего содержимого, и длинный email не обрезается
   многоточием, а вместо этого переносится на вторую строку и выталкивает
   «Выйти» за пределы шапки/экрана на узких телефонах (см. заметку по
   исправлению вёрстки кабинета, 2026-09-27). */
.header__account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 500; font-size: 14px; min-width: 0; }
.account-mark {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--blue); color: var(--white); font-size: 13px; font-weight: 700;
}
.account-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; max-width: 160px;
}
.account-logout {
  background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px;
  cursor: pointer; text-decoration: underline;
}
.account-logout-form { margin: 0; flex-shrink: 0; }

@media (max-width: 420px) {
  .account-name { max-width: 96px; }
}

/* ── Формы входа/регистрации/восстановления (веб-кабинет, 2026-09-26) ───── */
.auth-page { padding: 64px 0 96px; }
.auth-card {
  max-width: 420px; margin: 0 auto; background: var(--white);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 32px;
}
.auth-card h1 { font-size: 24px; margin: 0 0 8px; }
.auth-card .muted { margin: 0 0 24px; }
.auth-field { display: block; margin: 0 0 18px; }
.auth-field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.auth-field input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 16px;
  background: var(--blue-bg); border: 1px solid transparent; border-radius: 12px; color: var(--text);
}
.auth-field input:focus { outline: none; border-color: var(--blue); background: var(--white); }
.auth-consent { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 22px; font-size: 13px; color: var(--muted); }
.auth-consent input { margin-top: 3px; }
.auth-consent a { color: var(--blue-dark); }
.auth-submit { width: 100%; border: 0; }
.auth-error {
  background: #FDECEA; color: #C62828; border-radius: 10px; padding: 10px 14px;
  font-size: 14px; margin: 0 0 18px;
}
.auth-notice {
  background: #E8F5E9; color: #2E7D32; border-radius: 10px; padding: 10px 14px;
  font-size: 14px; margin: 0 0 18px;
}
.auth-hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.auth-links { margin-top: 20px; font-size: 14px; text-align: center; }
.auth-links a { color: var(--blue-dark); }

/* ── Анкета и анализы (Survey.razor, Этап 3) ─────────────────────────────── */
.survey-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 18px; }
.survey-grid-personal .auth-field, .survey-grid-flags { margin-bottom: 4px; }
.survey-gender { display: flex; gap: 24px; margin: 4px 0 8px; font-size: 15px; }
.survey-gender label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.survey-box { background: var(--blue-bg); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.survey-box-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.survey-box-row { display: flex; gap: 8px; align-items: center; }
.survey-box-input {
  flex: 1; min-width: 0; box-sizing: border-box; padding: 10px 12px; font-size: 16px;
  background: var(--white); border: 1px solid transparent; border-radius: 10px; color: var(--text);
}
.survey-box-input:focus { outline: none; border-color: var(--blue); }
.survey-box-unit { font-size: 13px; color: var(--muted); white-space: nowrap; }
.survey-box-unit-static { padding: 0 4px; }
select.survey-box-unit {
  background: var(--white); border: 1px solid transparent; border-radius: 8px; padding: 8px 6px;
}
.survey-flag { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.survey-save { max-width: 320px; margin: 4px 0 20px; }

@media (max-width: 480px) {
  .auth-card { padding: 32px 20px; }
}

/* ── Дневник питания (Diary.razor, Этап 5) ───────────────────────────────── */
.diary-date-field input { max-width: 220px; }
.diary-search-results { list-style: none; margin: 4px 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.diary-search-hit {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  text-align: left; background: var(--blue-bg); border: 1px solid transparent; border-radius: 10px;
  padding: 8px 12px; cursor: pointer; font: inherit; color: var(--text);
}
.diary-search-hit:hover { border-color: var(--blue); }
.diary-search-hit.is-selected { border-color: var(--blue); background: var(--white); }
.diary-search-hit-meta { font-size: 12px; color: var(--muted); }
.diary-add-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.diary-grams-field, .diary-meal-field { min-width: 160px; }
.diary-meal-field select {
  width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 16px;
  background: var(--blue-bg); border: 1px solid transparent; border-radius: 12px; color: var(--text);
}
.diary-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.diary-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 4px 8px; }
.diary-table td { padding: 6px 8px; border-top: 1px solid var(--blue-bg); }
.diary-own-products { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.diary-own-products li { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--blue-bg); border-radius: 10px; padding: 8px 12px; }
.diary-subtitle { font-size: 15px; margin: 8px 0; }

/* ── Графики (LineChart/PieChart, Этап 6) ────────────────────────────────── */
.chart { margin: 0; max-width: 100%; overflow-x: auto; }
.chart svg { display: block; width: 100%; height: auto; min-width: 320px; }
.chart figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
.chart-empty { margin: 0; font-size: 14px; font-style: italic; color: var(--muted); }

.chart-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; overflow-x: visible; margin-bottom: 24px; }
.chart-pie svg { width: 200px; min-width: 0; flex: 0 0 auto; }
.chart-legend { flex: 1 1 220px; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chart-legend li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.chart-legend-mark { width: 14px; height: 14px; flex: 0 0 auto; border-radius: 4px; }
.chart-legend-label { flex: 1 1 auto; }
.chart-legend-value { font-variant-numeric: tabular-nums; font-weight: 700; }

.analytics-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.analytics-picker button {
  border: 1px solid transparent; background: var(--blue-bg); color: var(--text);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; cursor: pointer;
}
.analytics-picker button.is-active { background: var(--blue); color: var(--white); }

/* ── Личный кабинет: оболочка (Этап 2 плана веб-кабинета, 2026-09-26) ───── */
.cab-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--blue-bg); }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--blue); color: var(--white);
  padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

.cab-topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 24px; background: var(--white); box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 20;
}
.cab-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.cab-brand-mark {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px; background: var(--blue); color: var(--white);
}
.cab-topbar > .cab-user { min-width: 0; }
.cab-user { display: flex; align-items: center; gap: 10px; }
.cab-user-mark {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: var(--white);
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
/* overflow/ellipsis + min-width:0 — тот же приём, что у .account-name в
   шапке лендинга: без него длинный email переносится на вторую строку и
   выталкивает «Выйти» за правый край экрана на узких телефонах (не просто
   некрасиво — кнопка становится физически недостижимой, скрыта за
   overflow-x:hidden на body). */
.cab-user-name {
  font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; min-width: 0; max-width: 200px;
}
.cab-logout {
  background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px;
  cursor: pointer; text-decoration: underline;
}
.cab-logout-form { margin: 0; flex-shrink: 0; }

@media (max-width: 420px) {
  .cab-user-name { max-width: 110px; }
}

.cab-body { flex: 1; display: flex; }
.cab-nav {
  width: 260px; flex-shrink: 0; background: var(--white); padding: 20px 12px;
  display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--blue-bg);
}
.cab-nav-item {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
  border-radius: 12px; text-decoration: none; color: var(--text);
}
.cab-nav-item:hover { background: var(--blue-bg); }
.cab-nav-item.is-active { background: var(--blue); }
.cab-nav-item.is-active .cab-nav-title,
.cab-nav-item.is-active .cab-nav-sub { color: var(--white); }
.cab-nav-title { font-weight: 600; font-size: 14px; }
.cab-nav-sub { font-size: 12px; color: var(--muted); }

.cab-main { flex: 1; padding: 32px; max-width: 920px; }

@media (max-width: 760px) {
  .cab-body { flex-direction: column; }
  .cab-nav { width: 100%; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--blue-bg); }
  .cab-nav-item { flex-shrink: 0; }
  .cab-main { padding: 20px 16px; }
}

/* ── «Сводка» (Own.razor, Этап 2) ────────────────────────────────────────── */
.cab-page-title { margin: 0 0 20px; font-size: 24px; }
.cab-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px 28px; margin-bottom: 20px;
}
.cab-card h2, .cab-card-title { margin: 0 0 16px; font-size: 18px; }
.cab-card .muted { margin: 0 0 16px; }
.cab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.cab-stat { background: var(--blue-bg); border-radius: 14px; padding: 14px 16px; }
.cab-stat-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cab-stat-value { font-size: 20px; font-weight: 700; color: var(--text); }
.cab-empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.cab-empty a { color: var(--blue-dark); }
.cab-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

/* ── Инструкция пользователя ────────────────────────────────────────────── */
.instruction__inner { max-width: 820px; }
.instruction__h { font-size: 24px; font-weight: 700; margin: 40px 0 16px; }
.instruction__steps { padding-left: 24px; display: grid; gap: 24px; margin: 0 0 24px; }
.instruction__steps > li::marker { color: var(--blue); font-weight: 800; }
.instruction__steps h3 { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.instruction__steps p, .instruction__steps ul { color: var(--muted); margin: 0 0 10px; }
.instruction__outro { font-weight: 600; }

/* Админ «Список продуктов»: широкая таблица, кнопка всегда видна */
.cab-main:has(.products-wide) { max-width: none; }
.patients-wide .products-table td:first-child { min-width: 220px; }
.products-wide { overflow-x: auto; }
.products-table { font-size: 13px; }
.products-table th, .products-table td { padding: 6px 6px; white-space: nowrap; }
.products-table td:first-child, .products-table th:first-child { white-space: normal; min-width: 180px; }
.products-table input { width: 60px; padding: 4px 6px; font-size: 13px; }
.products-table .products-actions { position: sticky; right: 0; background: var(--white); box-shadow: -6px 0 8px -6px rgba(0,0,0,.15); }
.products-table .btn { padding: 6px 12px; font-size: 13px; border-radius: 10px; box-shadow: none; transform: none; }
/* Админ «Пациенты»: заголовки в несколько строк, чтобы все столбцы помещались на экране */
.patients-wide .products-table th { white-space: normal; vertical-align: bottom; line-height: 1.2; max-width: 90px; }
.patients-wide .products-table td { white-space: normal; }
.patients-wide .products-table th, .patients-wide .products-table td { padding: 6px 4px; }
.patients-wide .products-table td:first-child, .patients-wide .products-table th:first-child { min-width: 160px; max-width: none; }
.diary-meal-total td { font-weight: 600; background: var(--blue-bg); border-top: 2px solid var(--blue); }

/* Админ «Алгоритм квоты»: цепочка проверок. Подсветка — по месту сработавшего правила:
   is-hit — сработало, is-passed — проверено и не подошло, is-skipped — до него не дошли. */
.quota-flow, .quota-flow-nested { list-style: none; margin: 0; padding: 0; }
.quota-group-title { margin: 18px 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.quota-group-title:first-child { margin-top: 0; }
.quota-step { position: relative; background: var(--blue-bg); border: 2px solid transparent; border-radius: 14px; padding: 12px 16px 12px 64px; margin-bottom: 22px; }
.quota-step::after { content: "↓"; position: absolute; left: 50%; bottom: -21px; transform: translateX(-50%); color: var(--blue); font-weight: 700; line-height: 20px; }
.quota-flow > .quota-step:last-child { margin-bottom: 0; }
.quota-flow > .quota-step:last-child::after { content: none; }
.quota-guard { background: var(--peach-bg); }
.quota-step-no { position: absolute; left: 16px; top: 12px; min-width: 34px; height: 34px; padding: 0 6px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--blue); color: var(--white); font-weight: 700; font-size: 14px; }
.quota-guard .quota-step-no { background: var(--peach-dark); }
.quota-step-cond { margin: 0 0 6px; font-size: 14px; }
.quota-step-result { margin: 0 0 4px; font-weight: 700; }
.quota-step-meta { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.quota-step-comment { margin: 4px 0 0; font-size: 13px; font-style: italic; color: var(--text); }
.quota-step-comment.is-none { color: var(--muted); font-style: normal; }
.quota-step.is-hit { background: var(--white); border-color: var(--blue-dark); box-shadow: var(--shadow); }
.quota-step.is-hit::before { content: "сработало"; display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--blue-dark); }
.quota-step.is-passed { opacity: .72; }
.quota-step.is-skipped { opacity: .42; border: 2px dashed var(--blue-soft); }
.quota-flow-nested { margin: 8px 0 0; border-left: 3px solid var(--blue-soft); padding-left: 12px; }
.quota-flow-nested li { padding: 6px 0; font-size: 13px; }
.quota-flow-nested li.is-hit { font-weight: 700; color: var(--blue-dark); }
.quota-probe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 16px; }
.quota-probe-grid label { display: block; font-size: 12px; color: var(--muted); }
.quota-probe-grid input[type="text"], .quota-probe-grid select { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--blue-soft); border-radius: 10px; font: inherit; font-size: 14px; color: var(--text); background: var(--white); }
.quota-probe-checks { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; font-size: 14px; }
.quota-probe-checks label { display: inline-flex; align-items: center; gap: 8px; }
.quota-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.quota-presets button { padding: 6px 14px; border: 1px solid var(--blue-soft); border-radius: 999px; background: var(--white); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.quota-presets button:hover { background: var(--blue-bg); }
.quota-hit-title { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.quota-flow-note { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
@media print {
  .cab-nav, .cab-topbar, .skip-link, .quota-probe { display: none !important; }
  .cab-main { max-width: none; padding: 0; }
  .cab-card { box-shadow: none; break-inside: avoid; }
  .quota-step { break-inside: avoid; opacity: 1 !important; }
}

/* Админ «Нормы»: таблица границ нормы по группам пациентов */
.norms-scroll { overflow-x: auto; }
.norms-table { min-width: 640px; }
.norms-table th, .norms-table td { white-space: nowrap; }
.norms-table td:first-child, .norms-table th:first-child { white-space: normal; min-width: 150px; }
.norms-table td:nth-child(n+3), .norms-table th:nth-child(n+3) { text-align: center; }
.norms-table .norm-unit { color: var(--muted); }
.norm-dict { display: block; font-size: 11px; color: var(--muted); }
.norm-inherited { color: var(--muted); font-style: italic; }
.norms-note { margin: 0 0 14px; }
.norms-text { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
