/* ==========================================================================
   Дежурства инженеров — стили
   Плакат-таблица по мотивам бумажной «шахматки», календарь и формы.
   ========================================================================== */

* ,
*::before,
*::after { box-sizing: border-box; }

:root {
  --navy: #152a4e;
  --navy-900: #0f2039;
  --ink: #182236;
  --ink-2: #33405a;
  --muted: #6a7a92;
  --muted-2: #8d9ab0;
  --line: #dde4ee;
  --line-2: #e9eef5;
  --bg: #e8ecf2;
  --card: #fff;
  --blue: #3a6fa8;
  --blue-d: #2d5b8d;
  --blue-soft: #eaf1f9;
  --teal: #2b8b83;
  --orange: #ef8a2b;
  --red: #c62828;
  --red-bg: #fdecec;
  --green: #2f7d4f;
  --green-bg: #e9f5ee;
  --duty-gray: #808080;
  --hatch-1: #e3ebf6;
  --hatch-2: #c6d8ec;
  --font-head: 'Roboto Condensed', 'Arial Narrow', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --shadow: 0 24px 60px -42px rgba(13, 27, 54, 0.55);
  --radius: 0.9rem;
}

html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.i {
  width: 1.1em;
  height: 1.1em;
  display: inline-block;
  vertical-align: -0.16em;
  flex: none;
}

:where(button, a, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ── Кнопки ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 2.35rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.62rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease, box-shadow 0.14s ease;
}
.btn:hover { background: #f6f9fd; border-color: #c7d3e2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }

.btn--primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-900); border-color: var(--navy-900); }

.btn--print { background: #fff; color: var(--ink-2); }
.btn--logout { background: #fff; color: var(--ink-2); }
.btn--today { min-height: 2.1rem; padding: 0 0.7rem; font-size: 0.8rem; color: var(--ink-2); }
.btn--sm { min-height: 2rem; padding: 0 0.65rem; font-size: 0.8rem; border-radius: 0.55rem; }
.btn--danger { color: var(--red); border-color: #f0cfcf; background: #fff7f7; }
.btn--danger:hover { background: #fdecec; border-color: #e7b6b6; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--line-2); color: var(--ink); }

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.62rem;
  background: transparent;
  color: var(--ink-2);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.iconbtn:hover { background: var(--line-2); }
.iconbtn--bordered { border-color: var(--line); background: #fff; }
.iconbtn--bordered:hover { background: #f6f9fd; border-color: #c7d3e2; }

/* ── Верхняя панель ─────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid #dbe2ec;
}

.topbar__in {
  max-width: 98rem;
  margin: 0 auto;
  padding: 0.6rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}
.brand__mark { display: block; flex: none; }
.brand__mark img { display: block; height: 2rem; width: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.08; min-width: 0; }
.brand__text strong {
  font-family: var(--font-head);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand__text span {
  font-size: 0.66rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monthnav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}
.monthnav__label {
  min-width: 9.5rem;
  text-align: center;
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.topbar__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.rolechip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.36rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--blue-soft);
  color: var(--blue-d);
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rolechip--manager { background: #e9eef8; color: var(--navy); }

/* ── Строка состояния ───────────────────────────────────────────────────── */
.wrap {
  max-width: 98rem;
  margin: 0 auto;
  padding: 1rem 1.2rem 2.5rem;
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.34rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #fff4e2;
  color: #9a5b0a;
  border: 1px solid #f3ddb8;
}
.status--approved { background: var(--green-bg); color: var(--green); border-color: #bfe0cc; }

.statusbar__item {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.statusbar__item b { color: var(--ink-2); font-weight: 600; }
.statusbar__spacer { flex: 1 1 auto; }

.tabs {
  display: inline-flex;
  padding: 0.2rem;
  gap: 0.15rem;
  background: #dfe5ee;
  border-radius: 0.7rem;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.95rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { color: var(--navy); }
.tab.is-active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(15, 32, 57, 0.16); }

/* ── Баннер ─────────────────────────────────────────────────────────────── */
.banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.8rem;
  border-radius: 0.7rem;
  background: #fff8e8;
  border: 1px solid #f2dfb8;
  color: #6d5a2e;
  font-size: 0.84rem;
  line-height: 1.4;
}
.banner--info { background: var(--blue-soft); border-color: #cfe0f2; color: var(--blue-d); }
.banner--approved { background: var(--green-bg); border-color: #bfe0cc; color: var(--green); }
.banner .i { font-size: 1.05rem; }
.banner__actions { margin-left: auto; display: inline-flex; gap: 0.4rem; flex-wrap: wrap; }

/* ── Плакат ─────────────────────────────────────────────────────────────── */
.poster {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #e2e8f1;
  padding: 1rem 1.15rem 1rem;
  max-width: 74rem;
  margin: 0 auto;
}

.poster__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.55rem;
}
.poster__org {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}
.poster__note {
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-2);
  text-align: right;
}

.tablewrap {
  overflow-x: auto;
  scrollbar-width: thin;
}

.duty {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--font-head);
  font-size: 0.9rem;
}

.duty th,
.duty td {
  border: 1px solid #c9d2df;
  padding: 0;
}

.duty thead th {
  font-weight: 600;
  text-align: center;
  padding: 0.2rem 0.15rem;
  background: #f6f8fb;
}

.duty .th-name,
.duty .th-pos {
  text-align: left;
  padding: 0.3rem 0.5rem;
  background: #f2f5f9;
}

.duty .th-name { width: 16%; font-size: 0.9rem; color: var(--ink-2); vertical-align: middle; }
.duty .th-pos { width: 22%; font-size: 0.9rem; color: var(--ink-2); vertical-align: middle; }
.duty .th-month {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.18rem 0.2rem;
  color: var(--navy);
  background: #eef2f8;
}
.duty .th-date { font-size: 0.92rem; font-weight: 700; color: var(--ink-2); }
.duty .th-wd {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  padding-bottom: 0.26rem;
  text-transform: lowercase;
}
.duty .th-date.is-holiday,
.duty .th-wd.is-holiday { color: var(--red); }
.duty .th-date.is-holiday { background: var(--red-bg); }
.duty .th-wd.is-holiday { background: var(--red-bg); }
.duty .th-date.is-weekend,
.duty .th-wd.is-weekend { color: #b04a4a; }
.duty .th-date.is-working,
.duty .th-wd.is-working { color: var(--green); }

.duty tbody tr:nth-child(even) .td-pos,
.duty tbody tr:nth-child(even) .td-name { background: #fbfcfe; }

.duty .td-name {
  text-align: left;
  padding: 0.3rem 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.duty .td-pos {
  text-align: left;
  padding: 0.3rem 0.5rem;
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.duty tbody tr.is-inactive .td-name { color: var(--muted); }

.cell {
  height: 2.15rem;
  position: relative;
  text-align: center;
  vertical-align: middle;
  background: #fff;
  transition: background 0.1s ease;
}
.cell.is-on {
  background:
    repeating-linear-gradient(45deg, var(--hatch-1) 0, var(--hatch-1) 5px, var(--hatch-2) 5px, var(--hatch-2) 10px);
}
.cell.is-approved { background: var(--duty-gray); }
.cell.is-editable { cursor: pointer; }
.cell.is-editable:hover { background: #eaf2fc; }
.cell.is-editable:not(.is-on)::after {
  content: '+';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9db8d6;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.cell.is-editable:not(.is-on):hover::after { opacity: 1; }
.cell.is-editable:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.cell.is-editable.is-on:hover { background: var(--hatch-2); }
.cell.is-busy { opacity: 0.6; }

.poster__bottom {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}
.poster__responsible { font-size: 0.88rem; color: var(--ink-2); }
.poster__responsible b { font-family: var(--font-head); font-size: 1rem; color: var(--ink); }
.poster__sign { font-size: 0.8rem; color: var(--muted); }
.poster__sign b { color: var(--green); font-weight: 600; }

.poster__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.15rem;
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line);
}
.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.74rem;
  color: var(--muted);
}
.legend__sw {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 0.25rem;
  border: 1px solid #c3cedd;
  flex: none;
}
.legend__sw--weekend { background: #f3f5f9; }
.legend__sw--holiday { background: var(--red-bg); border-color: #ecc4c4; }
.legend__sw--marked {
  background: repeating-linear-gradient(45deg, var(--hatch-1) 0, var(--hatch-1) 4px, var(--hatch-2) 4px, var(--hatch-2) 8px);
  border-color: #b9cde3;
}
.legend__sw--approved { background: var(--duty-gray); border-color: #6f6f6f; }

/* ── Календарь ──────────────────────────────────────────────────────────── */
.calendar {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #e2e8f1;
  padding: 1rem 1.15rem 1.1rem;
  max-width: 74rem;
  margin: 0 auto;
}
.calendar__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}
.calendar__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}
.calendar__sub { margin: 0; font-size: 0.76rem; color: var(--muted); }

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}
.calendar__dow {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.2rem 0;
}
.calendar__dow.is-weekend { color: var(--red); }

.cal__day {
  min-height: 6.2rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.35rem 0.4rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
}
.cal__day.is-empty { background: transparent; border-color: transparent; }
.cal__day.is-outside {
  background: transparent;
  border-color: transparent;
  opacity: 0.45;
}
.cal__day.is-outside .cal__num { font-weight: 400; color: var(--muted-2); }
.cal__day.is-weekend { background: #f5f7fb; }
.cal__day.is-holiday { background: var(--red-bg); border-color: #f0cfcf; }
.cal__day.is-working { background: var(--green-bg); border-color: #cbe5d4; }
.cal__day.is-today { box-shadow: inset 0 0 0 2px var(--blue); }

.cal__num {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-2);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem;
}
.cal__day.is-weekend .cal__num,
.cal__day.is-holiday .cal__num { color: var(--red); }
.cal__day.is-holiday .cal__num { color: var(--red); }
.cal__day.is-working .cal__num { color: var(--green); }
.cal__dowmark {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.cal__day.is-weekend .cal__dowmark,
.cal__day.is-holiday .cal__dowmark { color: #c06a6a; }

.cal__holiday {
  font-size: 0.64rem;
  line-height: 1.2;
  color: var(--red);
  font-weight: 600;
}
.cal__working { font-size: 0.64rem; color: var(--green); font-weight: 600; }
.cal__duty {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin-top: 0.1rem;
}
.cal__name {
  font-size: 0.68rem;
  line-height: 1.18;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal__more { font-size: 0.64rem; color: var(--muted); }
.cal__none { font-size: 0.66rem; color: var(--muted-2); margin-top: auto; }

.calendar__foot {
  margin-top: 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}
.calendar__foot b { color: var(--ink); }

/* ── Подсказки ──────────────────────────────────────────────────────────── */
.hint {
  max-width: 74rem;
  margin: 0.9rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 1.1rem;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.hint kbd {
  font-family: var(--font-body);
  font-size: 0.7rem;
  padding: 0.1em 0.38em;
  border-radius: 0.3rem;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 #d7dfea;
}

/* ── Диалоги ────────────────────────────────────────────────────────────── */
.modal {
  border: 0;
  padding: 0;
  border-radius: 1rem;
  max-width: min(92vw, 100%);
  box-shadow: 0 40px 90px -30px rgba(10, 23, 41, 0.6);
  background: #fff;
  color: var(--ink);
}
.modal::backdrop { background: rgba(12, 24, 43, 0.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal__form { width: min(30rem, 92vw); padding: 1.15rem 1.2rem 1.1rem; }
.modal--wide .modal__form { width: min(46rem, 94vw); }

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.modal__eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 0.16rem;
}
.modal__title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}
.modal__hint {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.field { display: flex; flex-direction: column; gap: 0.28rem; margin-bottom: 0.7rem; }
.field__label { font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.input {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
}
.input:hover { border-color: #c7d3e2; }
.input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(58, 111, 168, 0.14); }
select.input { padding-right: 1.8rem; }

.formerror {
  margin: 0.2rem 0 0;
  padding: 0.5rem 0.65rem;
  border-radius: 0.55rem;
  background: #fdecec;
  border: 1px solid #f0cccc;
  color: #a12626;
  font-size: 0.78rem;
}

/* ── Настройки ──────────────────────────────────────────────────────────── */
.settings { display: flex; flex-direction: column; gap: 0.2rem; }
.settings__block { padding: 0.85rem 0; border-top: 1px solid var(--line-2); }
.settings__block:first-child { border-top: 0; padding-top: 0.15rem; }
.settings__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-head);
  font-size: 1rem;
  letter-spacing: 0.01em;
}
.settings__hint { margin: 0 0 0.6rem; font-size: 0.72rem; color: var(--muted); line-height: 1.45; }
.settings__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.7rem; }
.settings__grid .field { margin-bottom: 0.35rem; }
.settings__actions { display: flex; gap: 0.4rem; justify-content: flex-end; }

.englist, .daylist { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.55rem; }
.engrow, .dayrow {
  display: grid;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid var(--line-2);
  border-radius: 0.55rem;
  background: #fbfcfe;
}
.engrow { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) auto auto; }
.dayrow { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.engrow.is-inactive { opacity: 0.62; }
.engrow .input, .dayrow .input { min-height: 2.05rem; font-size: 0.8rem; }
.engrow__name { font-weight: 600; }
.dayrow__date { font-family: var(--font-head); font-weight: 700; font-size: 0.86rem; white-space: nowrap; }
.dayrow__name { font-size: 0.8rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dayrow__kind {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.14rem 0.4rem;
  border-radius: 999px;
  white-space: nowrap;
}
.dayrow__kind--holiday { background: var(--red-bg); color: var(--red); }
.dayrow__kind--working { background: var(--green-bg); color: var(--green); }

.addrow { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.addrow .input { flex: 1 1 8rem; min-width: 7rem; }
.addrow--days .input[type="date"] { flex: 0 0 8.5rem; min-width: 0; }

/* ── Тост и загрузка ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%) translateY(0.4rem);
  z-index: 200;
  max-width: min(92vw, 32rem);
  padding: 0.6rem 0.95rem;
  border-radius: 0.65rem;
  background: var(--navy-950, #0a1729);
  background: #0f2039;
  color: #f2f6fc;
  font-size: 0.82rem;
  line-height: 1.4;
  box-shadow: 0 18px 40px -18px rgba(6, 16, 30, 0.8);
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--error { background: #7d1c1c; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: rgba(232, 236, 242, 0.94);
  color: var(--muted);
  font-size: 0.88rem;
  transition: opacity 0.2s ease;
}
.boot.is-hidden { opacity: 0; pointer-events: none; }
.boot__spinner {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2px solid #c6d2e2;
  border-top-color: var(--navy);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.noscript {
  margin: 2rem auto;
  max-width: 40rem;
  padding: 1rem;
  background: #fff;
  border-radius: 0.7rem;
  text-align: center;
}

/* ── Адаптив ─────────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .topbar__in { gap: 0.6rem; }
  .monthnav { order: 3; width: 100%; margin-left: 0; justify-content: center; }
  .topbar__actions { margin-left: auto; }
  .brand__text span { display: none; }
  .poster { padding: 0.8rem 0.8rem 0.8rem; }
  .duty { font-size: 0.84rem; }
  .duty .th-name { width: 18%; }
  .duty .th-pos { width: 24%; }
}

@media (max-width: 760px) {
  .wrap { padding: 0.7rem 0.55rem 2rem; }
  .topbar__in { padding: 0.5rem 0.6rem; }
  .brand__mark img { height: 1.7rem; }
  .brand__text strong { font-size: 1rem; }
  .topbar__actions .btn span { display: none; }
  .topbar__actions .btn { padding: 0 0.6rem; }
  .topbar__actions .btn--primary span,
  .topbar__actions .btn--logout span { display: inline; }
  .monthnav__label { min-width: 7.5rem; font-size: 0.94rem; }
  .statusbar { gap: 0.45rem; }
  .statusbar__spacer { display: none; }
  .statusbar__item { font-size: 0.74rem; white-space: normal; overflow-wrap: anywhere; }
  .poster { border-radius: 0.7rem; }
  .poster__top { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
  .poster__note { text-align: left; font-size: 0.82rem; }
  .duty { min-width: 38rem; }
  .duty .th-name { width: 25%; }
  .duty .th-pos { width: 20%; }
  .duty .td-name { font-size: 0.82rem; }
  .duty .td-pos { font-size: 0.7rem; }
  .duty thead .th-name,
  .duty tbody .td-name { position: sticky; left: 0; z-index: 3; background: #f7f9fc; }
  .cell { height: 2.5rem; }
  .poster__bottom { flex-direction: column; gap: 0.3rem; }
  .calendar { padding: 0.7rem 0.6rem; }
  .calendar__grid { gap: 0.22rem; }
  .cal__day { min-height: 5rem; padding: 0.25rem; font-size: 0.66rem; }
  .cal__num { font-size: 0.82rem; }
  .cal__name { font-size: 0.6rem; }
  .settings__grid { grid-template-columns: 1fr; }
  .engrow { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
  .engrow .btn { justify-self: start; }
  .dayrow { grid-template-columns: auto 1fr; }
  .dayrow .btn { justify-self: start; }
  .modal__form { width: calc(100vw - 1.4rem); padding: 1rem; }
  .modal--wide .modal__form { width: calc(100vw - 1.4rem); }
}

/* ── Печать: ровно один лист A4 горизонтально ───────────────────────────── */
@page { size: A4 landscape; margin: 7mm; }

@media print {
  html, body { background: #fff !important; }
  .topbar,
  .statusbar,
  .tabs,
  .hint,
  .banner,
  .calendar,
  .toast,
  .boot,
  .modal,
  .noscript,
  .poster__legend { display: none !important; }

  .wrap { max-width: none; margin: 0; padding: 0; }
  .poster {
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
  .poster__org { display: none; }
  .poster__top { justify-content: flex-end; margin-bottom: 1.6mm; }
  .poster__note { font-size: 9.5pt; color: #000; text-align: right; }
  .tablewrap { overflow: visible !important; }
  .duty { font-size: 9.5pt; table-layout: fixed; }
  .duty th,
  .duty td { border: 0.5pt solid #000 !important; padding: 0 !important; }
  .duty thead th { background: #fff !important; color: #000 !important; }
  .duty .th-month { font-size: 12pt; }
  .duty .th-date { font-size: 10pt; }
  .duty .th-wd { font-size: 8pt; }
  .duty .th-date,
  .duty .th-wd { color: #000 !important; background: #fff !important; }
  .duty .th-date.is-holiday,
  .duty .th-wd.is-holiday { color: #b00000 !important; }
  .duty .th-date.is-weekend,
  .duty .th-wd.is-weekend { color: #000 !important; }
  .duty .th-date.is-working,
  .duty .th-wd.is-working { color: #0a5c2c !important; }
  .duty .th-name { width: 15%; }
  .duty .th-pos { width: 21%; }
  .duty .td-name,
  .duty .td-pos { color: #000 !important; background: #fff !important; padding: 1mm 1.6mm !important; }
  .duty .td-name { font-size: 9.5pt; }
  .duty .td-pos { font-size: 8pt; }
  .duty tbody tr { break-inside: avoid; page-break-inside: avoid; }
  .cell { height: 10.5mm; background: #fff !important; }
  .cell.is-on {
    background-color: #d9d9d9 !important;
    background-image: repeating-linear-gradient(45deg, #d9d9d9 0, #d9d9d9 1mm, #bdbdbd 1mm, #bdbdbd 2mm) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .cell.is-approved {
    background: #808080 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .poster__bottom { margin-top: 3mm; font-size: 10pt; }
  .poster__responsible b { font-size: 10.5pt; }
  .poster__sign { font-size: 9pt; }
}
