/* Оформление по шаблону «Шаб1_Бордовый — Президентская академия, Новосибирск» */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/montserrat-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/montserrat-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --red: #c81240;        /* accent1 шаблона */
  --red-dark: #a00f33;   /* accent2 */
  --wine: #a00f33;
  --pink: #f7dfe5;       /* светлые плашки, как в слайдах «Импульс» */
  --pink-2: #fbeef1;
  --navy: #29345b;       /* accent4 */
  --navy-2: #29345b;
  --ink: #242423;
  --muted: #7f8189;
  --line: #dedfe1;
  --bg: #f0f0f0;
  --card: #ffffff;
  --ok: #1f7a46;
  --ok-bg: #e6f3eb;
  --warn-bg: #f3f3f4;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(36, 36, 35, .06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: 'Montserrat', Arial, sans-serif; color: var(--ink); background: var(--bg);
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

/* ---------- шапка: малиновая, как титульный слайд ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--red); color: #fff; padding: 0 clamp(16px, 4vw, 40px); }
.top-in { max-width: 1120px; margin: 0 auto; height: 72px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; min-width: 0; flex: 0 1 auto; }
.brand-logo { height: 46px; width: auto; display: block; flex: none; }
.brand-text { min-width: 0; padding-left: 16px; border-left: 1px solid rgba(255,255,255,.45); }
.brand-title { white-space: nowrap; font-weight: 700; font-size: 17px; line-height: 1.15; }
.brand-sub { font-size: 12px; color: rgba(255,255,255,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav > * { white-space: nowrap; flex: none; }
.top-nav a, .top-nav button {
  background: none; border: 0; color: rgba(255,255,255,.85); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 10px 12px; border-bottom: 3px solid transparent; border-radius: 0;
}
.top-nav a.active { color: #fff; border-bottom-color: #fff; }
.who { font-weight: 700; padding: 7px 12px; background: var(--red-dark); font-size: 14px; }
.sync { font-size: 13px; color: rgba(255,255,255,.8); display: flex; align-items: center; gap: 6px; white-space: nowrap; margin-right: 6px; }
.sync::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.sync.off::before { background: #ffd34d; }
.top-accent { height: 0; }

/* ---------- раскладка ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 36px clamp(16px, 4vw, 40px) 140px; }
/* полоска над заголовком, как на слайдах; подпись — мелко и серым под полоской */
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 10px; }
.eyebrow::before { content: ''; width: 64px; height: 4px; background: var(--red); }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.15; margin: 10px 0 12px; font-weight: 700; color: var(--red-dark); }
h2 { font-size: 22px; margin: 0 0 14px; font-weight: 700; color: var(--red-dark); }
h3 { font-size: 17px; margin: 0; font-weight: 700; color: var(--ink); }
.lead { color: #4a4a4c; font-size: 16px; max-width: 700px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.section { margin-top: 36px; }

.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 30px; }
.stats { display: flex; gap: 12px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px 20px; min-width: 130px; border-top: 4px solid var(--red); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--red); }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------- кнопки, бейджи ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--radius);
  padding: 14px 22px; font-weight: 700; font-size: 15px; background: var(--red); color: #fff; text-decoration: none;
  min-height: 52px; transition: background .15s, opacity .15s;
}
.btn:hover { background: var(--red-dark); }
.btn:disabled { opacity: .35; cursor: not-allowed; background: var(--red); }
.btn.dark { background: var(--red-dark); }
.btn.dark:hover { background: #840c2a; }
.btn.ghost { background: #fff; color: var(--red-dark); box-shadow: inset 0 0 0 2px var(--red); }
.btn.ghost:hover { background: var(--pink-2); }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--red); font-weight: 700; text-decoration: none; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; text-decoration: none; font-size: 14px; }
.back:hover { color: var(--red); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 2px; font-size: 12px; font-weight: 600; background: #ececed; color: #5d5f66; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.red { background: var(--red); color: #fff; }
.badge.navy { background: var(--navy); color: #fff; }
.badge.warn { background: var(--pink); color: var(--red-dark); }

.progress { height: 6px; background: #e4e4e6; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--red); transition: width .3s; }
.progress.ok > i { background: var(--ok); }

/* ---------- этапы ---------- */
.stages { display: grid; gap: 12px; }
.stage-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 20px; align-items: center; padding: 18px 22px; }
.stage-num { width: 56px; height: 56px; background: #ececed; display: grid; place-items: center; font-weight: 700; font-size: 22px; color: var(--muted); }
.stage-item.current { box-shadow: inset 4px 0 0 var(--red), var(--shadow); }
.stage-item.current .stage-num { background: var(--red); color: #fff; }
.stage-item.done .stage-num { background: var(--pink); color: var(--red-dark); }
.stage-item.locked { opacity: .55; }
.stage-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--muted); }
.stage-meta .progress { width: 140px; }
.note { border-left: 4px solid var(--red); padding: 2px 0 2px 16px; }

/* ---------- экран этапа ---------- */
.criteria-list { display: flex; gap: 0; flex-wrap: wrap; margin-top: 16px; }
.criteria-list span { display: flex; background: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); margin: 0 10px 10px 0; }
.criteria-list b { background: var(--red); color: #fff; padding: 9px 14px; }
.criteria-list span { padding-right: 14px; align-items: center; gap: 12px; }
.tabs { display: inline-flex; background: #fff; box-shadow: inset 0 0 0 2px var(--red); border-radius: var(--radius); overflow: hidden; }
.tabs button { border: 0; background: none; padding: 9px 16px; font-weight: 600; font-size: 13px; color: var(--red-dark); border-radius: 0; }
.tabs button.on { background: var(--red); color: #fff; }

.queue { display: flex; flex-direction: column; gap: 8px; }
.q-row {
  display: grid; grid-template-columns: 52px 1fr auto auto; align-items: center; gap: 16px; background: #fff;
  padding: 0 18px 0 0; border: 0; box-shadow: var(--shadow); text-align: left; width: 100%; min-height: 66px; border-radius: var(--radius); overflow: hidden;
}
.q-row:hover { background: var(--pink-2); }
.q-row.next { box-shadow: inset 0 0 0 2px var(--red); }
.q-pos { align-self: stretch; display: grid; place-items: center; font-weight: 700; font-size: 18px; color: var(--muted); background: #ececed; }
.q-row.next .q-pos { background: var(--red); color: #fff; }
.q-name { font-weight: 700; font-size: 16px; }
.q-sub { font-size: 12px; color: var(--muted); }
.q-score { font-weight: 700; font-size: 18px; min-width: 64px; text-align: right; color: var(--red-dark); }

.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.pair { background: #fff; box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
.pair-h { font-size: 13px; font-weight: 700; color: #fff; background: var(--red); padding: 9px 14px; text-align: center; }
.pair-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.pcard {
  border: 0; border-right: 1px solid var(--line); padding: 14px; background: #fff; text-align: left;
  display: flex; flex-direction: column; gap: 6px; min-height: 132px; transition: background .15s; border-radius: 0;
}
.pcard:last-child { border-right: 0; }
.pcard:hover { background: var(--pink-2); }
.pcard.scored { background: #fafafa; }
.pcard .g { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pcard .n { font-weight: 700; font-size: 15px; line-height: 1.25; }
.pcard .s { margin-top: auto; }
.avatar { width: 40px; height: 40px; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 14px; }
.avatar.f { background: var(--red); }
.avatar.m { background: var(--red-dark); }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: #fff;
  box-shadow: 0 -1px 0 var(--line), 0 -6px 20px rgba(0,0,0,.05); padding: 14px clamp(16px, 4vw, 40px) calc(14px + env(safe-area-inset-bottom));
}
.dock-in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.dock-in .grow { flex: 1; min-width: 0; }

/* ---------- окно оценки ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(36, 36, 35, .55); display: grid; place-items: center; padding: 20px; }
.sheet { background: #fff; width: min(720px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 24px 64px rgba(0,0,0,.3); border-radius: var(--radius); animation: pop .15s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: .6; } }
.sheet-h { padding: 22px 28px 18px; display: flex; gap: 16px; align-items: center; background: var(--red); color: #fff; }
.sheet-h h2 { color: #fff; }
.sheet-h .muted, .sheet-h .eyebrow { color: rgba(255,255,255,.8); }
.sheet-h .eyebrow::before { display: none; }
.sheet-h .avatar { background: #fff !important; color: var(--red); }
.sheet-h .btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.sheet-b { padding: 22px 28px; display: flex; flex-direction: column; gap: 22px; }
.sheet-f { padding: 4px 28px 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.sheet-f .btn { flex: 1; }
.crit-t { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.crit-t small { color: var(--red); font-weight: 700; font-size: 12px; display: block; text-transform: uppercase; letter-spacing: .05em; }
.grades { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.grades button { height: 64px; border-radius: var(--radius); border: 2px solid var(--line); background: #fff; font-size: 24px; font-weight: 700; transition: all .12s; }
.grades button:hover { border-color: var(--red); }
.grades button.on { background: var(--red); border-color: var(--red); color: #fff; }
.grades.off { opacity: .3; pointer-events: none; }
.level { font-size: 13px; color: var(--muted); margin-top: 8px; min-height: 18px; }
.total-box { display: flex; align-items: center; justify-content: space-between; background: var(--pink); color: var(--red-dark); padding: 14px 18px; }
.total-box b { font-size: 28px; font-weight: 700; }
.absent { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border: 2px dashed var(--line); cursor: pointer; user-select: none; }
.absent.on { border-color: var(--red); background: var(--pink-2); }
.switch { width: 48px; height: 28px; border-radius: 99px; background: #d3d4d7; position: relative; flex: none; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.absent.on .switch { background: var(--red); }
.absent.on .switch::after { left: 23px; }

.dialog { width: min(480px, 100%); text-align: center; padding: 30px 28px 24px; border-top: 6px solid var(--red); }
.dialog .eyebrow { align-items: center; }
.dialog h2 { margin-bottom: 8px; }
.dialog p { color: #4a4a4c; margin: 0 0 22px; }
.dialog .btns { display: flex; flex-direction: column; gap: 10px; }

/* ---------- таблицы: малиновая шапка, как «Кто что покупает» ---------- */
.table-wrap { overflow-x: auto; background: #fff; box-shadow: var(--shadow); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; white-space: nowrap; }
th { font-size: 12px; color: #fff; font-weight: 700; background: var(--red); }
tbody tr:nth-child(even) td { background: #f6f6f6; }
td.num, th.num { text-align: center; }
td.total { font-weight: 700; font-size: 16px; text-align: right; color: var(--red-dark); }
th.total { text-align: right; }
tr.group td { background: var(--pink) !important; font-size: 12px; font-weight: 700; color: var(--red-dark); padding: 7px 14px; }
td.cell { cursor: pointer; font-weight: 700; }
td.cell:hover { background: var(--pink) !important; }
td.cell.abs { color: var(--muted); font-weight: 600; }
.place { width: 32px; height: 32px; display: inline-grid; place-items: center; font-weight: 700; background: #ececed; }
.place.p1 { background: var(--red); color: #fff; }
.place.p2 { background: var(--red-dark); color: #fff; }
.place.p3 { background: var(--navy); color: #fff; }

.banner { padding: 18px 22px; display: flex; gap: 16px; align-items: center; border-radius: var(--radius); }
.banner.ok { background: var(--ok-bg); color: #145c33; }
.banner.navy { background: var(--red); color: #fff; }
.banner.navy .btn { background: #fff; color: var(--red-dark); }

/* ---------- вход: титульный слайд ---------- */
body.login-mode .top { display: none; }
.login-wrap {
  min-height: 100vh; background: var(--red); color: #fff; position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr minmax(320px, 400px); align-items: center; gap: 40px;
  padding: 40px clamp(24px, 6vw, 80px);
}
.login-wrap::after {
  content: ''; position: absolute; right: -6%; top: 50%; width: min(620px, 60vw); aspect-ratio: 600 / 785; transform: translateY(-50%);
  background: url(/img/emblem-white.png) center / contain no-repeat; opacity: .35; pointer-events: none;
}
.login-title { position: relative; z-index: 1; }
.login-title img { height: 64px; margin-bottom: 48px; }
.login-title h1 { color: #fff; font-size: clamp(36px, 6vw, 64px); margin: 0 0 12px; }
.login-title p { margin: 0; font-size: 18px; color: rgba(255,255,255,.85); max-width: 440px; }
.login { position: relative; z-index: 1; background: #fff; color: var(--ink); padding: 28px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); border-radius: var(--radius); }
.login h2 { margin: 0 0 4px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 18px 0; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; background: #e1e1e3; }
.pin-dots i.on { background: var(--red); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { height: 62px; border: 2px solid var(--line); background: #fff; font-size: 24px; font-weight: 700; border-radius: var(--radius); }
.keypad button:active { background: var(--pink); border-color: var(--red); }
.keypad button.fn { border-color: transparent; font-size: 13px; color: var(--muted); }
.err { color: var(--red); font-weight: 600; min-height: 22px; margin-top: 12px; font-size: 14px; }
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--ink); color: #fff; z-index: 60;
  padding: 12px 20px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100vw - 32px); text-align: center; border-left: 4px solid var(--red); font-size: 14px;
}

input.inp, select.inp { border: 2px solid var(--line); padding: 9px 12px; background: #fff; min-height: 44px; border-radius: var(--radius); }
input.inp:focus, select.inp:focus { outline: none; border-color: var(--red); }

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .login-title img { margin-bottom: 24px; height: 52px; }
  .login-wrap::after { width: 90vw; right: -30%; top: 30%; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .brand-text, .sync span { display: none; }
  .brand-logo { height: 38px; }
  .stage-item { grid-template-columns: 44px 1fr; padding: 16px; }
  .stage-item > .btn, .stage-item > .badge { grid-column: 1 / -1; }
  .stage-num { width: 44px; height: 44px; font-size: 18px; }
  .grid2 { grid-template-columns: 1fr; }
  .q-row { grid-template-columns: 40px 1fr auto; }
  .q-row .badge { display: none; }
  .grades button { height: 56px; }
  .sheet-h, .sheet-b, .sheet-f { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 480px) { .pair-cards { grid-template-columns: 1fr; } .pcard { border-right: 0; border-bottom: 1px solid var(--line); } .who { display: none; } }
