/* Портал участника «Бирюса 2026».
   Сдержанный брендовый минимализм в духе стоек. Точные шрифт/логотип/палитра
   дорабатываются отдельно — здесь функциональная база. */

:root {
  --brand: #00527a;
  --brand-dark: #013f5e;
  --brand-soft: #e6f0f5;
  --ink: #14202a;
  --muted: #5c6b76;
  --line: #dce4e9;
  --bg: #f4f8fb;
  --surface: #ffffff;
  --danger: #b3261e;
  --ok: #1f7a44;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(0, 82, 122, 0.10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -200px, var(--brand-soft), transparent 60%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 18px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Бренд */
.brand { display: flex; justify-content: center; padding: 8px 0 2px; }
.brand__logo { width: 210px; max-width: 62%; height: auto; }

/* Карточка */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px;
}
.card__title { margin: 0 0 6px; font-size: 22px; }
.card__lead { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.card__alt { margin: 18px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.card__alt a, a { color: var(--brand); text-decoration: none; }
.card__alt a:hover, a:hover { text-decoration: underline; }

/* Форма */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field__opt { font-weight: 400; color: var(--muted); font-style: normal; }
.field__input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px;
  font-size: 16px; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field__input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 82, 122, 0.15);
}
.field__hint { font-size: 12px; color: var(--muted); }

/* Select — единый вид с кастомной стрелкой; длинный текст обрезается многоточием */
select.field__input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 40px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}
select.field__input::-ms-expand { display: none; }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* Кнопки */
.btn {
  border: none; border-radius: 14px; padding: 13px 16px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background .15s, opacity .15s; width: 100%;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn--ghost {
  background: transparent; color: var(--brand);
  border: 1px solid var(--line); width: auto; padding: 9px 14px; font-size: 14px;
}
.btn--ghost:hover { background: var(--brand-soft); }
.btn--small { width: auto; padding: 8px 14px; font-size: 14px; }

/* Сообщения */
.msg {
  border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px;
  background: var(--brand-soft); color: var(--brand-dark);
  border: 1px solid #cfe1ea;
}
.msg--error { background: #fbe9e7; color: var(--danger); border-color: #f3c9c4; }
.msg--ok { background: #e7f5ec; color: var(--ok); border-color: #c6e7d2; }

.ttl { display: inline-block; margin-left: 6px; font-variant-numeric: tabular-nums; color: var(--brand); font-weight: 600; }

/* Кабинет */
.cab__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 4px; }
.cab__name { font-size: 22px; font-weight: 700; margin: 0; line-height: 1.25; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.cab__head .btn { flex-shrink: 0; }
.person { margin: 6px 0 22px; }
.person__name { font-size: 20px; font-weight: 700; margin: 0 0 10px; }
.person__row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.person__row .k { color: var(--muted); }
.person__row .v { font-weight: 600; text-align: right; }
.muted { color: var(--muted); }

.section__title { font-size: 15px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 0 12px; }
.badges__list { display: flex; flex-direction: column; gap: 12px; }

.badge {
  border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px;
  background: #fff; display: flex; flex-direction: column; gap: 8px;
}
.badge--active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(0,82,122,.12); }
.badge__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.badge__role { font-weight: 700; }
.badge__tag { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); white-space: nowrap; }
.badge__tag--off { background: #eef1f3; color: var(--muted); }
.badge__tag--active { background: var(--brand); color: #fff; }
.badge__shifts { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.45; }
.badge__meta { font-size: 14px; color: var(--muted); line-height: 1.5; }
.badge__meta b { color: var(--ink); font-weight: 600; }
.badge__team { font-size: 14px; color: var(--ink); }
.badge__team-none { font-size: 12.5px; color: var(--muted); line-height: 1.45; background: var(--brand-soft); border-radius: 10px; padding: 8px 10px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: auto; }

/* ---- Раздел прибытия/отбытия ---- */
.transport { margin-top: 22px; }
.tr-block {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  margin-top: 12px;
  background: #fff;
}
.tr-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.tr-block__title { font-weight: 700; color: #0f172a; }
.tr-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.tr-tag--pending  { background: #fef3c7; color: #92400e; }
.tr-tag--approved { background: #dcfce7; color: #166534; }
.tr-tag--rejected { background: #fee2e2; color: #991b1b; }
.tr-info { margin-bottom: 10px; }
.tr-info__row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}
.tr-info__row span { color: #64748b; }
.tr-info__row b { color: #0f172a; }
.tr-note { margin: 6px 0 10px; font-size: 13px; }
.tr-reject {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 10px;
  font-size: 14px;
}
.tr-form { display: flex; flex-direction: column; gap: 10px; }
.tr-edit-btn { align-self: flex-start; }
.tr-submit { align-self: flex-start; margin-top: 4px; }

/* ---- Аккордеон-блоки и подпись бейджа ---- */
.tr-context { margin: 2px 0 10px; font-size: 13px; }
.tr-block { padding: 0; overflow: hidden; }
.tr-block__head {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.tr-block__head::-webkit-details-marker { display: none; }
.tr-block__head::after {
  content: "▾";
  margin-left: auto;
  color: #94a3b8;
  transition: transform .15s ease;
}
details[open] .tr-block__head::after { transform: rotate(180deg); }
.tr-block__head { padding: 14px 16px; margin: 0; }
.tr-block__body { padding: 0 16px 16px; }
.tr-tag--none { background: #f1f5f9; color: #64748b; }
.tr-tag--cleared { background: #f1f5f9; color: #64748b; }

/* ---- QR в шапке + модалка ---- */
.qr-mini {
  flex-shrink: 0;
  width: 64px; height: 64px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  background: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow .15s ease;
}
.qr-mini:hover { box-shadow: 0 0 0 2px rgba(0,82,122,.15); }
.qr-mini img, .qr-mini canvas { display: block; width: 100% !important; height: 100% !important; }

.qr-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, .72);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: pointer;
}
.qr-modal__box {
  background: #fff; border-radius: 20px;
  padding: 28px 28px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 92vw;
}
.qr-big { width: 280px; height: 280px; max-width: 78vw; max-height: 78vw; }
.qr-big img, .qr-big canvas { display: block; width: 100% !important; height: 100% !important; }
.qr-modal__name { margin: 0; font-size: 18px; font-weight: 700; text-align: center; }
.qr-modal__hint { margin: 0; font-size: 12px; }

/* ---- Руководительский раздел «Моя служба» ---- */
.manager { margin-top: 8px; }
.mgr-scope { margin: -6px 0 12px; font-size: 14px; }
.mgr-count { margin: 0 0 10px; font-size: 13px; }
.mgr-list { display: flex; flex-direction: column; gap: 8px; }
.mgr-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff;
}
.mgr-row--off { opacity: .65; }
.mgr-row__main { min-width: 0; }
.mgr-row__name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.mgr-row__meta { font-size: 13px; color: var(--muted); }
.mgr-tag { flex-shrink: 0; font-size: 12px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.mgr-tag--on { background: var(--brand-soft); color: var(--brand-dark); }
.mgr-tag--off { background: #eef1f3; color: var(--muted); }

/* ---- Форма регистрации сотрудника ---- */
.mgr-reg-btn { margin: 0 0 14px; }
.mgr-reg-form {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  margin: 0 0 16px; background: #fafbfc;
  display: flex; flex-direction: column; gap: 10px;
}
.mgr-reg-title { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.mgr-fixed {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #eef1f3; color: var(--ink); font-weight: 600;
}
.mgr-photo-preview { margin: -2px 0 4px; }
.mgr-photo-preview img {
  max-width: 140px; max-height: 180px; border-radius: 10px; border: 1px solid var(--line);
}
.mgr-extra { border-top: 1px solid var(--line); padding-top: 8px; }
.mgr-extra summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--brand-dark); }
.mgr-extra[open] summary { margin-bottom: 8px; }
.mgr-reg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.field__opt { font-weight: 400; color: var(--muted); font-style: normal; }

/* ---- Мои заявки руководителя ---- */
.mgr-reqs { margin: 0 0 16px; }
.mgr-reqs-title { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.mgr-req {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  background: #fff; margin-bottom: 8px;
}
.mgr-req__main { min-width: 0; }
.mgr-req__name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.mgr-req__note { font-size: 12.5px; color: #b91c1c; margin-top: 2px; }
.mgr-req-tag { flex-shrink: 0; font-size: 12px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.mgr-req-tag--pending { background: #fef9c3; color: #854d0e; }
.mgr-req-tag--approved { background: #dcfce7; color: #166534; }
.mgr-req-tag--rejected { background: #fee2e2; color: #b91c1c; }

/* ---- Группировка сотрудников по направлениям ---- */
.mgr-group { margin-bottom: 14px; }
.mgr-group__title {
  margin: 0 0 8px; font-size: 13px; font-weight: 700;
  color: var(--brand-dark); text-transform: uppercase; letter-spacing: .02em;
}

/* Направление в карточке заявки */
.mgr-req__dir { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* Выбор смен в форме регистрации */
.mgr-shifts { display: flex; flex-direction: column; gap: 6px; }
.mgr-shift { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.mgr-shift input { width: 16px; height: 16px; flex-shrink: 0; }

/* Кнопка изменения у заявки */
.mgr-req__right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.btn--small { padding: 4px 10px; font-size: 12px; }

/* ---- График по дням ---- */
.mgr-row--clickable { cursor: pointer; }
.mgr-row--clickable:hover { background: #f6f8fa; }
.mgr-row--open { border-color: var(--brand); }
.mgr-sched { padding: 4px 0 10px; }
.sched-shift { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; background: #fff; }
.sched-shift__title { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.sched-tools { display: flex; gap: 8px; margin: 8px 0; }
.sched-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sched-day { display: flex; align-items: center; gap: 6px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; cursor: pointer; }
.sched-day input { width: 15px; height: 15px; }
.sched-grid--view { gap: 6px; }
.sched-view-day { font-size: 12.5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; color: var(--muted); background: #fff; }
.sched-view-day--on { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand-soft); font-weight: 600; }
.sched-view-day--today { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---- Спойлеры разделов руководителя/графика ---- */
.mgr-spoiler { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; }
.mgr-spoiler__title { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--brand-dark); list-style: revert; }
.mgr-spoiler[open] > .mgr-spoiler__title { margin-bottom: 10px; }
.mgr-spoiler .mgr-list { display: block; }

/* ---- Факт присутствия в графике ---- */
.sched-day--fact { border-color: var(--brand); }
.sched-fact { font-size: 11px; color: #166534; background: #dcfce7; border-radius: 999px; padding: 2px 7px; margin-left: 2px; }
.sched-markbtn { font-size: 11px; color: var(--brand-dark); background: none; border: 1px dashed var(--line); border-radius: 999px; padding: 2px 7px; margin-left: 2px; cursor: pointer; }
.sched-markbtn:hover { border-color: var(--brand); }

/* Мой график (сотрудник) */
.sched-myrows { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sched-myday { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.sched-myday--today { outline: 2px solid var(--brand); outline-offset: 1px; }
.sched-myday__date { font-size: 13px; }
.sched-myday__tags { display: flex; align-items: center; gap: 6px; }
.sched-mytag { font-size: 11px; border-radius: 999px; padding: 2px 8px; }
.sched-mytag--work { background: var(--brand-soft); color: var(--brand-dark); }
.sched-mytag--fact { background: #dcfce7; color: #166534; }

/* ---- График: ячейки-дни ---- */
.sgrid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.sday { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.sday__cell {
  width: 52px; height: 52px; border-radius: 12px;
  border: 1px solid var(--line); background: #f1f4f6; color: var(--muted);
  font-size: 12px; line-height: 1.15; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; text-align: center;
  transition: background .12s ease, color .12s ease, box-shadow .12s ease;
}
.sday__cell--on {
  background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(0,82,122,.25);
}
.sday--today .sday__cell { outline: 2px solid var(--brand); outline-offset: 2px; }
.sday__fact { min-height: 20px; display: flex; align-items: center; }
.sday__scan {
  font-size: 10.5px; color: #166534; background: #dcfce7;
  border-radius: 999px; padding: 2px 8px; font-weight: 600;
}
.sday__mark {
  font-size: 10.5px; color: var(--brand-dark); background: none;
  border: 1px dashed var(--line); border-radius: 999px; padding: 2px 8px; cursor: pointer;
}
.sday__mark--on {
  color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; font-weight: 600;
}
.sday__mark:hover { border-color: var(--brand); }

/* ---- График: раскладка строкой (ячейка + присутствие) ---- */
.sgrid { flex-direction: column; gap: 8px; }
.sday { flex-direction: row; align-items: stretch; gap: 10px; width: 100%; }
.sday__fact { flex: 1; min-height: 0; }
.sday__presence {
  width: 100%; text-align: center; font-size: 12px; line-height: 1.25;
  border-radius: 12px; padding: 6px 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sday__presence--off { color: var(--brand-dark); background: #f1f4f6; border: 1px dashed var(--line); }
.sday__presence--off:hover { border-color: var(--brand); }
.sday__presence--on { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; font-weight: 600; }
.sday__presence--locked { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; font-weight: 600; cursor: default; }

/* ---- График: сетка квадратов + подпись присутствия (переопределение) ---- */
.sgrid { flex-direction: row; flex-wrap: wrap; gap: 10px; }
.sday { flex-direction: column; align-items: center; gap: 4px; width: auto; }
.sday__cell--locked { cursor: default; opacity: .92; }
.sday__cell--locked.sday__cell--on { box-shadow: none; }
.sday__note { font-size: 9.5px; color: #166534; text-align: center; max-width: 56px; line-height: 1.1; }

/* ---- Смены на бейдже: активная + спойлер ---- */
.badge__shift { font-size: 13.5px; padding: 1px 0; }
.badge__shift--active { font-weight: 600; }
.badge__shifts-more { margin-top: 2px; }
.badge__shifts-more > summary { cursor: pointer; font-size: 12.5px; color: var(--brand-dark); padding: 2px 0; }
.badge__shifts-more[open] > summary { margin-bottom: 2px; }

/* ---- Рейсы ---- */
.trip-group__title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 8px; }
.trip-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.trip-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.trip-card__route { font-size: 14.5px; font-weight: 600; }
.trip-card__time { font-size: 13px; color: var(--muted); margin-top: 4px; }
.trip-card__when { font-size: 15.5px; font-weight: 600; color: var(--ink); margin-top: 6px; }
.trip-card__when b { color: var(--brand-dark); }
.trip-card__places { font-size: 13px; margin-top: 6px; }
.trip-card__action { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.trip-status { font-size: 11px; border-radius: 999px; padding: 3px 9px; white-space: nowrap; flex-shrink: 0; font-weight: 600; }
.trip-status--open { background: #dcfce7; color: #166534; }
.trip-status--closed { background: #fef9c3; color: #854d0e; }
.trip-status--boarding { background: #dbeafe; color: #1e40af; }
.trip-status--departed { background: #e0e7ff; color: #3730a3; }
.trip-status--done { background: #e5e7eb; color: #374151; }
.trip-status--cancelled { background: #fee2e2; color: #991b1b; }
.trip-note { font-size: 12.5px; color: var(--muted); }
.trip-note--ok { color: #166534; font-weight: 600; }

/* ---- Верхний всплывающий тост ---- */
.toast {
  position: fixed; top: 16px; left: 50%;
  transform: translateX(-50%) translateY(-140%);
  z-index: 9999; max-width: 92%; box-sizing: border-box;
  padding: 13px 20px; border-radius: 14px; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); text-align: center;
  background: #1f2937; color: #fff; pointer-events: none;
  opacity: 0; transition: transform .28s ease, opacity .28s ease;
}
.toast--show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast--ok { background: #166534; color: #fff; }
.toast--error { background: #991b1b; color: #fff; }

/* ---- Крупные кнопки рейсов ---- */
.trip-card__action { margin-top: 12px; }
.btn--trip {
  width: 100%; padding: 12px 16px; font-size: 15px; border-radius: 12px;
}
.btn--trip-leave { background: #fff; color: #991b1b; border: 1px solid #fecaca; }
.btn--trip-leave:hover { background: #fef2f2; }
.btn--trip-disabled {
  background: #e5e7eb; color: #9ca3af; border: 1px solid #e5e7eb; cursor: pointer;
}
.btn--trip-disabled:hover { background: #e5e7eb; }

/* ---- Кнопка записи сотрудников ---- */
.trip-card__staff-btn { margin-top: 8px; }

/* ---- Модалка ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9000; background: rgba(15,23,42,.45);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.modal {
  background: #fff; width: 100%; max-width: 520px; max-height: 86vh;
  border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  box-shadow: 0 -8px 32px rgba(0,0,0,.2);
}
@media (min-width: 560px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: 18px; }
}
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.modal__title { font-size: 17px; font-weight: 700; }
.modal__close { background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal__sub { padding: 0 18px 10px; color: var(--muted); font-size: 13.5px; border-bottom: 1px solid var(--line); }
.modal__body { padding: 12px 18px 20px; overflow-y: auto; }
.modal__places { font-size: 13.5px; margin-bottom: 10px; }
.staff-pick { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid #f1f4f6; cursor: pointer; }
.staff-pick input { width: 20px; height: 20px; flex-shrink: 0; }
.staff-pick input:disabled { opacity: .5; }
.staff-pick__name { font-size: 14.5px; font-weight: 500; }
.staff-pick__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Блокирующая подпись сотрудника — красным (как ошибки) */
.staff-pick__meta--blocked { color: #991b1b; }

/* Роль сотрудника — выделенная (ярче, крупнее, жирная) */
.mgr-row__role { font-weight: 700; font-size: 13.5px; color: var(--brand-dark); margin-top: 2px; }
.mgr-row__sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ======== Общий график сотрудников (матрица) ======== */
.sched-grid__legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 14px; font-size: 12.5px; }
.sg-leg { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.sg-leg::before { content: ""; width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sg-leg--work::before { background: #4b91f1; }
.sg-leg--off::before  { background: #e9edf2; }
.sg-leg--fact::before { background: #34c77b; }

.sg-scroll { overflow: auto; max-height: 78vh; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.sg-table { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; }
.sg-table th, .sg-table td { border-right: 1px solid #eef1f3; border-bottom: 1px solid #eef1f3; }

/* sticky угол + первый столбец (имена) */
.sg-corner, .sg-name { position: sticky; left: 0; background: #fff; text-align: left;
  min-width: 156px; max-width: 220px; padding: 6px 10px; }
.sg-table thead th.sg-corner { z-index: 15; background: #f8fafc; box-shadow: 1px 0 0 #eef1f3; }
.sg-corner--top { top: 0; overflow: hidden; }
.sg-corner--bot { top: 34px; font-weight: 700; vertical-align: bottom; }
.sg-name { z-index: 4; }

/* sticky шапка */
.sg-table thead th { position: sticky; background: #f8fafc; z-index: 6; }
.sg-row-shift th { top: 0; }
.sg-row-date th  { top: 34px; }

.sg-shift { cursor: pointer; user-select: none; font-weight: 600; padding: 6px 10px;
  white-space: nowrap; text-align: left; color: var(--brand-dark);
  max-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sg-shift:hover { background: #eef2f7; }
.sg-shift__toggle { font-size: 11px; }
.sg-shift--collapsed { cursor: pointer; padding: 6px 2px; min-width: 30px; width: 30px;
  text-align: center; color: var(--muted); }
.sg-shift--collapsed:hover { background: #eef2f7; }

/* свёрнутая смена в теле: высокая ячейка, название центрируется по видимой области */
.sg-vlabel-cell { background: #eef2f7; cursor: pointer; min-width: 30px; width: 30px;
  text-align: center; vertical-align: middle; padding: 0; position: relative; z-index: 1; }
.sg-vlabel-cell:hover { background: #e2e8f0; }
.sg-vlabel { writing-mode: vertical-rl; text-orientation: mixed; white-space: nowrap;
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--muted);
  position: sticky; top: 50%; transform: translateY(-50%); }

.sg-date { padding: 4px 2px; width: 40px; min-width: 40px; max-width: 40px; text-align: center; font-weight: 500; line-height: 1.15; box-sizing: border-box; }
.sg-date--weekend { background: #fef2f2; }
.sg-date__dd { display: block; font-size: 12px; }
.sg-date__wd { display: block; font-size: 10px; color: var(--muted); }

/* группы */
.sg-group__label { position: sticky; left: 0; z-index: 4; padding: 6px 10px; font-weight: 700; white-space: nowrap; }
.sg-group__fill { padding: 0; border-right-color: transparent; }
.sg-group--dir .sg-group__label { font-size: 13px; color: var(--ink); background: #e7edf4; }
.sg-group--dir .sg-group__fill  { background: #e7edf4; }
.sg-group--sub .sg-group__label { font-size: 12px; color: var(--muted); font-weight: 600; padding-left: 18px; background: #f1f5f9; }
.sg-group--sub .sg-group__fill  { background: #f1f5f9; }

.sg-name__fio { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-name__role { display: block; font-size: 11px; color: var(--brand-dark); font-weight: 600; }

/* ячейки — равный размер, галочки вместо заливки */
.sg-cell { width: 40px; min-width: 40px; max-width: 40px; height: 40px; padding: 0;
  position: relative; cursor: pointer; box-sizing: border-box; text-align: center;
  vertical-align: middle; font-size: 18px; font-weight: 700; line-height: 40px; }
.sg-cell--work { color: #3b82f6; }
.sg-cell--work::after { content: "✓"; }
.sg-cell--fact { color: #16a34a; }
.sg-cell--fact::after { content: "✓"; font-weight: 800; }
.sg-cell--off::after  { content: ""; }
.sg-cell--na { cursor: default; }
.sg-cell--locked { cursor: default; opacity: .85; }
.sg-cell:not(.sg-cell--na):not(.sg-cell--locked):hover { background: #eef4fd; }
.sg-cell:not(.sg-cell--na):not(.sg-cell--locked):active::after { transform: scale(.85); }
.sg-cell--saving { opacity: .4; }

/* перекрестье при наведении: подсветка столбца вверх и строки влево, поверх всего */
.sg-cell.sg-cx       { background: #d6e4fb !important; }
.sg-cell.sg-cx::after { position: relative; z-index: 1; }
.sg-group__fill.sg-cx { background: #d6e4fb !important; }
.sg-name.sg-cx       { background: #d2e1fb !important; }
.sg-table thead th.sg-date.sg-cx { background: #d2e1fb !important; }

@media (max-width: 560px) {
  .sg-corner, .sg-name { min-width: 88px; max-width: 100px; }
  .sg-name__fio { font-size: 12px; }
  .sg-name__role { font-size: 10px; }
  .sg-cell { width: 34px; min-width: 34px; max-width: 34px; height: 34px; line-height: 34px; font-size: 16px; }
  .sg-date { width: 34px; min-width: 34px; max-width: 34px; }
}

.mgr-grid-btn { display: block; text-align: center; text-decoration: none; margin-top: 8px; }

/* ======== Подсветка официальных дат мероприятия ======== */
/* матрица: шапка официальной даты */
.sg-date--official { background: #fef3c7; box-shadow: inset 0 -3px 0 #f59e0b; }
.sg-date--official .sg-date__wd { color: #b45309; }
/* матрица: колонка официальных дней — лёгкий фон у пустых/выходных (статусные не трогаем) */
.sg-cell--na.sg-col-official    { background: #fffbeb; }
.sg-cell--off.sg-col-official   { background: #fef9e7; }
.sg-group__fill.sg-col-official { background: #fffbeb; }

/* легенда официальных */
.sg-leg--official::before { background: #f59e0b; }

/* личный график: официальный день — золотистая рамка */
.sday__cell--official { box-shadow: inset 0 0 0 2px #f59e0b; }

/* кнопка свернуть/развернуть все смены (в углу над сотрудником) */
.sg-allbtn { border: 1px solid var(--line); background: #fff; border-radius: 7px;
  padding: 3px 8px; font-size: 11.5px; font-weight: 600; color: var(--brand-dark);
  cursor: pointer; white-space: nowrap; max-width: 100%; box-sizing: border-box;
  overflow: hidden; text-overflow: ellipsis; display: block; }
.sg-allbtn:hover { background: #eef2f7; }

/* ======== Личный рейтинг ======== */
.rating-entry { margin: 12px 0; }
.rating-entry__btn { display: block; text-align: center; text-decoration: none;
  background: var(--brand-dark); color: #fff; font-weight: 600; }

.rating-tabs { display: flex; gap: 6px; margin: 12px 0 16px; border-bottom: 1px solid var(--line); }
.rt-tab { border: none; background: none; padding: 8px 14px; font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rt-tab--active { color: var(--brand-dark); border-bottom-color: var(--brand-dark); }

.rt-list { display: flex; flex-direction: column; gap: 10px; }
.rt-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.rt-card--clickable { cursor: pointer; transition: box-shadow .12s, transform .06s; }
.rt-card--clickable:hover { box-shadow: 0 3px 12px rgba(8,38,54,.1); transform: translateY(-1px); }
.rt-card--preopen { opacity: .75; }
.rt-card--closed { background: #fafbfc; }
.rt-card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rt-type { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.rt-points { font-size: 13px; font-weight: 700; color: var(--brand-dark); }
.rt-card__title { font-size: 15px; font-weight: 600; color: var(--ink); }
.rt-card__desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.rt-card__bottom { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rt-meta { font-size: 12px; color: var(--muted); }
.rt-mypts { margin-left: auto; font-weight: 700; color: #16a34a; }

.rt-badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.rt-badge--draft    { background: #f1f5f9; color: #64748b; }
.rt-badge--pending  { background: #fef3c7; color: #b45309; }
.rt-badge--accepted { background: #dcfce7; color: #15803d; }
.rt-badge--rejected { background: #fee2e2; color: #b91c1c; }

.rt-board { display: flex; flex-direction: column; gap: 4px; }
.rt-board__row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.rt-board__row--me { background: #eef4fd; }
.rt-board__rank { width: 26px; text-align: center; font-weight: 700; color: var(--muted); }
.rt-board__photo { width: 34px; height: 34px; border-radius: 50%; background: #dbe4ee;
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: 12px; font-weight: 700; color: #5b7086; flex-shrink: 0; }
.rt-board__img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.rt-board__name { flex: 1; font-size: 14px; font-weight: 500; }
.rt-board__pts { font-weight: 700; color: var(--brand-dark); }

.rt-total { margin-bottom: 12px; font-size: 15px; }
.rt-results { display: flex; flex-direction: column; gap: 6px; }
.rt-res__row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.rt-res__main { display: flex; flex-direction: column; gap: 2px; }
.rt-res__title { font-size: 14px; font-weight: 500; }
.rt-res__date { font-size: 12px; color: var(--muted); }
.rt-res__right { display: flex; align-items: center; gap: 10px; }
.rt-res__pts { font-weight: 700; color: var(--brand-dark); min-width: 28px; text-align: right; }

.rt-overlay { position: fixed; inset: 0; background: rgba(8,38,54,.5); display: flex;
  align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.rt-modal { background: #fff; border-radius: 16px; padding: 22px; max-width: 560px; width: 100%;
  max-height: 86vh; overflow: auto; position: relative; }
.rt-modal__close { position: absolute; top: 14px; right: 14px; border: none; background: none;
  font-size: 18px; color: var(--muted); cursor: pointer; }
.rt-modal__type { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.rt-modal__title { font-size: 19px; margin: 6px 0 12px; }
.rt-modal__desc { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.rt-modal__note { margin-top: 16px; padding: 10px 12px; background: #f1f5f9; border-radius: 10px;
  font-size: 13px; color: var(--muted); }

/* формы выполнения задания */
.rt-form { margin-top: 16px; }
.rt-q { margin-bottom: 16px; }
.rt-q__text { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.rt-q__hint { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.rt-q__opts { display: flex; flex-direction: column; gap: 6px; }
.rt-opt { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.rt-opt:hover { background: #f8fafc; }
.rt-opt input { margin-top: 2px; }
.rt-textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; resize: vertical; box-sizing: border-box; }
.rt-file__input { font-size: 14px; }
.rt-file__prev { font-size: 13px; color: var(--muted); margin-top: 6px; }
.rt-file__status { font-size: 13px; color: var(--brand-dark); margin-top: 6px; }
.rt-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }

/* комментарий модератора */
.rt-comment { margin-top: 12px; padding: 10px 12px; background: #fef2f2; border-radius: 10px;
  font-size: 13px; color: #7f1d1d; line-height: 1.45; }
.rt-comment__label { font-weight: 700; }
.rt-res__comment { font-size: 12.5px; color: #b91c1c; margin-top: 2px; }

/* поощрения и штрафы в результатах */
.rt-res__row--award { background: #fafbfc; }
.rt-res__kind { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px;
  border-radius: 999px; margin-bottom: 3px; width: fit-content; }
.rt-res__kind--plus  { background: #dcfce7; color: #15803d; }
.rt-res__kind--minus { background: #fee2e2; color: #b91c1c; }
.rt-res__pts--plus  { color: #16a34a; }
.rt-res__pts--minus { color: #dc2626; }

/* пререквизиты: заблокированное задание */
.rt-card--locked { opacity: .72; }
.rt-meta--locked { color: #b45309; font-weight: 600; }

/* свой вариант ответа в опросе */
.rt-other { width: 100%; box-sizing: border-box; margin-top: 8px; border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 11px; font-size: 14px; font-family: inherit; }

/* задание-посещение: список целей ОП */
.rt-att__label { margin: 16px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink); }
.rt-att__list { display: flex; flex-direction: column; gap: 6px; }
.rt-att__item { display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.rt-att__item--done { background: #f0fdf4; border-color: #bbf7d0; }
.rt-att__check { width: 18px; text-align: center; font-weight: 700; color: #94a3b8; }
.rt-att__item--done .rt-att__check { color: #16a34a; }
.rt-att__title { flex: 1; }
.rt-att__time { font-size: 12px; color: var(--muted); white-space: nowrap; }