/* Кабинет администратора South-Bridge.
   Визуальный язык сайта: фиолетовый #7a378c, сиреневый #b491be, графит #413f3f,
   Panton для заголовков, Pragmatica для текста, прямые углы, полосы вместо карточек. */

@font-face {
  font-family: 'Panton';
  src: url(../fonts/Panton-ExtraBold.woff2) format('woff2'), url(../fonts/Panton-ExtraBold.woff) format('woff');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Panton';
  src: url(../fonts/Panton-Black.woff2) format('woff2');
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: 'Pragmatica';
  src: url(../fonts/PragmaticaC.woff2) format('woff2'), url(../fonts/PragmaticaC.woff) format('woff');
  font-weight: 400;
  font-display: swap;
}

:root {
  --plum: #7a378c;
  --plum-deep: #5f2a6d;
  --plum-ink: #4a2155;
  --lilac: #b491be;
  --lilac-soft: #e6dbea;
  --wash: #f6f2f8;
  --ink: #2b2830;
  --graphite: #413f3f;
  --muted: #6b6570;
  --paper: #ffffff;
  --danger: #a8322d;
  --danger-line: #dcb4b1;
  --danger-wash: #fbeeed;

  --display: 'Panton', 'Arial Black', Arial, sans-serif;
  --text: 'Pragmatica', 'PT Sans', 'Segoe UI', Arial, sans-serif;
  --mono: Consolas, 'Cascadia Mono', 'DejaVu Sans Mono', monospace;
  --rail: 300px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--plum); }
a:hover { color: var(--plum-deep); }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; color: var(--graphite); }
h1 { font-size: 32px; line-height: 1.15; margin: 0; }
button { font: inherit; }

/* ---------- шапка ---------- */

.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 28px;
  border-bottom: 5px solid var(--plum);
  background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { display: block; width: 47px; height: 44px; }
.brand-name {
  font-family: var(--display);
  font-weight: 900;
  font-size: 24px;
  line-height: 1;
  color: var(--graphite);
}
.brand-name .accent { color: var(--plum); }
.brand-sub {
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.1;
  color: var(--muted);
  padding-left: 18px;
  border-left: 2px solid var(--lilac);
}
.topnav { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.topnav a, .topnav button {
  font-weight: bold;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 8px 12px;
  cursor: pointer;
}
.topnav a:hover, .topnav button:hover { color: var(--plum); }
.topnav a[aria-current="page"] { color: var(--plum); box-shadow: inset 0 -3px 0 var(--plum); }
.nav-main { display: flex; align-items: center; gap: 2px; margin-right: 90px; }
.nav-user { display: flex; align-items: center; gap: 2px; }
.topnav .nav-me { color: var(--graphite); }
.topnav .nav-me:hover { color: var(--plum); }

/* ---------- раскладка ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: calc(100vh - 69px);
}
.rail { background: var(--wash); border-right: 1px solid var(--lilac-soft); }
.content { padding: 28px 40px 64px; max-width: 1120px; }
.content.full { max-width: none; }
.boot { padding: 40px; color: var(--muted); }

/* ---------- выбор клиента: фиолетовая полоса как на сайте ---------- */

.picker { background: var(--plum); color: #fff; padding: 18px 20px 20px; }
.picker-label {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  color: var(--lilac-soft);
  margin-bottom: 6px;
}
.client-select {
  width: 100%;
  height: 42px;
  font: inherit;
  font-weight: bold;
  color: #fff;
  background: var(--plum-deep) 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' fill='none' stroke='%23e6dbea' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0;
  padding: 0 36px 0 12px;
  appearance: none;
  cursor: pointer;
}
.client-select option { color: var(--ink); background: #fff; font-weight: normal; }
.client-select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.picker .btn { margin-top: 12px; }

.rail-block { padding: 20px 20px 6px; }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rail-head h2 { font-size: 16px; margin: 0; }

.glinks { list-style: none; margin: 0; padding: 0; }
.glinks li { padding: 7px 0; border-top: 1px solid var(--lilac-soft); }
.glinks li:first-child { border-top: 0; padding-top: 2px; }
.glink { font-weight: bold; text-decoration: none; overflow-wrap: anywhere; }
.glink:hover { text-decoration: underline; }
.glink-desc { display: block; font-size: 13px; color: var(--muted); }

/* разделы: 2px сиреневая линия сверху, у активного — 5px фиолетовая (как меню услуг на сайте) */
.sections { list-style: none; margin: 0; padding: 0; }
.section-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 2px solid var(--lilac);
  color: var(--ink);
  font-weight: bold;
  text-decoration: none;
}
.section-item:hover { color: var(--plum); border-top-color: var(--plum); }
.section-item[aria-current="page"] { color: var(--plum); border-top: 5px solid var(--plum); padding-top: 6px; }
.section-count { font-weight: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty-small { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  background: var(--lilac-soft);
  color: var(--plum-ink);
}
.btn:hover { background: var(--lilac); color: #fff; }
.btn.primary { background: var(--plum); color: #fff; }
.btn.primary:hover { background: var(--plum-deep); }
.btn.ghost { background: transparent; color: var(--plum); box-shadow: inset 0 0 0 1px var(--lilac); }
.btn.ghost:hover { background: var(--wash); color: var(--plum-deep); }
.btn.ghost.danger { color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger-line); }
.btn.ghost.danger:hover { background: var(--danger-wash); }
.btn.solid-danger { background: var(--danger); color: #fff; }
.btn.solid-danger:hover { background: #8a2925; }
.btn.on-plum { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px var(--lilac); }
.btn.on-plum:hover { background: var(--plum-deep); }
.btn.wide { width: 100%; height: 46px; font-size: 16px; }
.btn.square { width: 38px; padding: 0; font-family: var(--text); font-size: 16px; }
.btn:disabled { opacity: 0.55; cursor: progress; }

.btn-link {
  background: none;
  border: 0;
  padding: 2px 0;
  font-size: 14px;
  color: var(--plum);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--lilac);
  text-underline-offset: 3px;
  white-space: nowrap;
}
.btn-link:hover { color: var(--plum-deep); text-decoration-color: var(--plum); }
.btn-link.danger { color: var(--danger); text-decoration-color: var(--danger-line); }

/* ---------- основная область ---------- */

.crumb { margin: 0 0 4px; font-size: 14px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--plum); text-decoration: underline; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--plum);
}
.page-desc { margin: 6px 0 0; color: var(--muted); max-width: 65ch; white-space: pre-wrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }

.empty { padding: 40px 0 8px; max-width: 56ch; }
.empty h1 { margin-bottom: 8px; }
.empty p { color: var(--muted); margin: 0 0 18px; }

.pick-list { list-style: none; margin: 8px 0 0; padding: 0; columns: 2 320px; column-gap: 40px; }
.pick-list li { break-inside: avoid; }
.pick-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-top: 2px solid var(--lilac);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  color: var(--graphite);
}
.pick-list a:hover { border-top-color: var(--plum); color: var(--plum); }
.pick-list .count { font-family: var(--text); font-weight: normal; font-size: 14px; color: var(--muted); }

/* ---------- ссылки раздела ---------- */

.links { list-style: none; margin: 0; padding: 0; }
.link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 28px;
  padding: 16px 0;
  border-bottom: 1px solid var(--lilac-soft);
}
.link-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.link-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.25;
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.link-title:hover { text-decoration: underline; }
.link-url {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--graphite);
  background: var(--wash);
  padding: 1px 6px;
  overflow-wrap: anywhere;
}
.copy { font-size: 13px; }
.link-desc { margin: 6px 0 0; max-width: 72ch; white-space: pre-wrap; }
.link-meta { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.link-tools { display: flex; align-items: center; gap: 6px 14px; justify-self: end; }
.move { display: inline-flex; gap: 2px; }
.move button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--lilac-soft);
  background: #fff;
  color: var(--plum);
  cursor: pointer;
}
.move button:hover { border-color: var(--plum); }
.move button:disabled { visibility: hidden; }
.link-row > .notes-block { grid-column: 1 / -1; }

/* ---------- заметки ---------- */

.notes-block { background: var(--wash); border-left: 3px solid var(--lilac); padding: 12px 16px; margin-top: 10px; }
.notes-block.for-section { margin: 18px 0 4px; }
.notes-title { font-size: 15px; margin: 0 0 6px; }
.notes { list-style: none; margin: 0 0 10px; padding: 0; }
.note { padding: 8px 0; border-bottom: 1px solid var(--lilac-soft); }
.note-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.note-foot .btn-link { font-size: 12.5px; }
.note-form { display: flex; align-items: flex-start; gap: 10px; }
.note-input {
  flex: 1;
  min-height: 40px;
  resize: vertical;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--lilac);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}
.section-notes-toggle > summary {
  cursor: pointer;
  color: var(--plum);
  font-size: 14px;
  padding: 14px 0 0;
  list-style: none;
  width: fit-content;
  text-decoration: underline;
  text-decoration-color: var(--lilac);
  text-underline-offset: 3px;
}
.section-notes-toggle > summary::-webkit-details-marker { display: none; }

/* ---------- формы и диалоги ---------- */

.field { margin-bottom: 14px; }
.field > label, .field > .label {
  display: block;
  margin-bottom: 4px;
  font-weight: bold;
  font-size: 14px;
  color: var(--graphite);
}
.input, .field input:not([type="checkbox"]), .field textarea, .field select {
  width: 100%;
  font: inherit;
  padding: 9px 11px;
  border: 1px solid var(--lilac);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}
.field textarea { resize: vertical; }
.input:focus-visible, .field input:focus-visible, .field textarea:focus-visible, .note-input:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: -1px;
}
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }
.hint { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 14.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--plum); }
.checks { max-height: 220px; overflow: auto; border: 1px solid var(--lilac-soft); padding: 6px 10px; }
.form-error { margin: 0 0 12px; padding: 8px 10px; font-size: 14px; color: var(--danger); background: var(--danger-wash); }
.mono { font-family: var(--mono); }

dialog.dlg {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-top: 5px solid var(--plum);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(40, 20, 50, 0.28);
}
dialog.dlg.wide { width: min(820px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: rgba(43, 40, 48, 0.55); }
.dlg-form { padding: 22px 24px 20px; }
.dlg-title { font-size: 22px; margin: 0 0 14px; }
.dlg-intro { margin: -6px 0 14px; color: var(--muted); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- администрирование ---------- */

.tabs { display: flex; flex-wrap: wrap; gap: 4px 26px; margin: 18px 0 20px; border-bottom: 1px solid var(--lilac-soft); }
.tabs a {
  padding: 10px 0;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  font-family: var(--display);
  font-weight: 800;
  color: var(--muted);
  text-decoration: none;
}
.tabs a:hover { color: var(--plum); }
.tabs a[aria-current="page"] { color: var(--plum); border-bottom-color: var(--plum); }
.tab-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.tab-head p { margin: 0; color: var(--muted); max-width: 70ch; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--lilac);
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
table.data td { padding: 10px; border-bottom: 1px solid var(--lilac-soft); vertical-align: top; }
table.data td.num { font-variant-numeric: tabular-nums; }
table.data td.nowrap { white-space: nowrap; }
.tag { display: inline-block; margin: 0 4px 3px 0; padding: 1px 7px; font-size: 12.5px; background: var(--lilac-soft); color: var(--plum-ink); }
.tag.strong { background: var(--plum); color: #fff; }
.tag.warn { background: var(--danger-wash); color: var(--danger); }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.muted { color: var(--muted); }

.gl-editor { display: grid; gap: 10px; margin-bottom: 14px; }
.gl-row { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr auto; gap: 8px; align-items: start; }
.gl-row .btn { height: 41px; }
.gl-head { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr 41px; gap: 8px; font-weight: bold; font-size: 13.5px; color: var(--graphite); }

.narrow { max-width: 460px; }
.notice { margin: 18px 0; padding: 12px 14px; background: var(--wash); border-left: 3px solid var(--plum); }
.facts { margin: 16px 0 24px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: bold; }

.roles-grid { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.role-card { padding-top: 14px; border-top: 3px solid var(--plum); }
.role-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.role-head h2 { margin: 0; font-size: 18px; }
.perm-list { display: grid; gap: 8px; margin: 10px 0 14px; }
.perm-list .check { align-items: flex-start; }
.perm-list .hint { display: block; margin: 1px 0 0; }

.settings-form { max-width: 760px; }
.settings-form h2 { margin: 22px 0 10px; font-size: 17px; }
.settings-grid { display: grid; gap: 0 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.section-title { margin: 30px 0 10px; font-size: 17px; }
table.data .email { display: block; font-size: 12.5px; }

.form-section { margin: 18px 0 10px; font-size: 16px; }
.captcha-box { margin: 6px 0 16px; min-height: 100px; }
.reg-line { color: var(--muted); font-size: 14px; }
.login-card .reg-line a { color: var(--plum); }

.org-card { margin: 30px 0 10px; padding-top: 14px; border-top: 3px solid var(--plum); max-width: 680px; }
.org-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.org-head h2 { margin: 0; font-size: 18px; }
.org-sub { margin: 18px 0 8px; font-size: 15px; }
.contacts { list-style: none; margin: 0; padding: 0; }
.contacts li { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 7px 0; border-top: 1px solid var(--lilac-soft); }

.issue-open { text-align: left; white-space: normal; }
.issue-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: -6px 0 12px; font-size: 13.5px; }
.issue-desc { margin: 0 0 14px; padding: 10px 12px; background: var(--wash); white-space: pre-wrap; }
.comment-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.comment { padding: 8px 0; border-bottom: 1px solid var(--lilac-soft); }
.comment-meta { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 12.5px; color: var(--muted); }
.comment-meta .tag { font-size: 11.5px; }
.comment-text { margin: 3px 0 0; white-space: pre-wrap; }
.comment-form { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
.comment-form textarea { flex: 1; }

.notices { margin: 24px 0 8px; }
.notices h2 { margin: 0 0 10px; font-size: 18px; }
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice { padding: 12px 16px; margin-bottom: 10px; background: var(--wash); border-left: 3px solid var(--lilac); }
.notice.unread { border-left-color: var(--plum); background: #f2e9f5; }
.notice-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.notice-head h3 { margin: 0; font-size: 16px; }
.notice-head .muted { font-size: 12.5px; }
.notice-text { margin: 6px 0 4px; white-space: pre-wrap; }

.templates-grid { display: grid; gap: 30px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.template-card { padding-top: 14px; border-top: 3px solid var(--plum); }
.template-card textarea { font-size: 13px; line-height: 1.45; }
code.var { margin-right: 6px; padding: 1px 5px; background: var(--lilac-soft); font-size: 12.5px; }

.issues { margin: 26px 0 30px; }
.issues-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.issues-head h2 { margin: 0; font-size: 18px; }
.issues-meta { font-size: 12.5px; color: var(--muted); }
.issues-table td { vertical-align: middle; }
.issues-problem { margin: 0; padding: 10px 12px; background: var(--wash); border-left: 3px solid var(--lilac); color: var(--graphite); }

.build {
  position: fixed;
  right: 10px;
  bottom: 6px;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.75;
  pointer-events: none;
}
.login-page .settings-form { max-width: 760px; }
.settings-form h2 { margin: 22px 0 10px; font-size: 17px; }
.settings-grid { display: grid; gap: 0 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.section-title { margin: 30px 0 10px; font-size: 17px; }
table.data .email { display: block; font-size: 12.5px; }

.form-section { margin: 18px 0 10px; font-size: 16px; }
.captcha-box { margin: 6px 0 16px; min-height: 100px; }
.reg-line { color: var(--muted); font-size: 14px; }
.login-card .reg-line a { color: var(--plum); }

.org-card { margin: 30px 0 10px; padding-top: 14px; border-top: 3px solid var(--plum); max-width: 680px; }
.org-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.org-head h2 { margin: 0; font-size: 18px; }
.org-sub { margin: 18px 0 8px; font-size: 15px; }
.contacts { list-style: none; margin: 0; padding: 0; }
.contacts li { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 7px 0; border-top: 1px solid var(--lilac-soft); }

.issue-open { text-align: left; white-space: normal; }
.issue-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: -6px 0 12px; font-size: 13.5px; }
.issue-desc { margin: 0 0 14px; padding: 10px 12px; background: var(--wash); white-space: pre-wrap; }
.comment-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.comment { padding: 8px 0; border-bottom: 1px solid var(--lilac-soft); }
.comment-meta { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 12.5px; color: var(--muted); }
.comment-meta .tag { font-size: 11.5px; }
.comment-text { margin: 3px 0 0; white-space: pre-wrap; }
.comment-form { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
.comment-form textarea { flex: 1; }

.notices { margin: 24px 0 8px; }
.notices h2 { margin: 0 0 10px; font-size: 18px; }
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice { padding: 12px 16px; margin-bottom: 10px; background: var(--wash); border-left: 3px solid var(--lilac); }
.notice.unread { border-left-color: var(--plum); background: #f2e9f5; }
.notice-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.notice-head h3 { margin: 0; font-size: 16px; }
.notice-head .muted { font-size: 12.5px; }
.notice-text { margin: 6px 0 4px; white-space: pre-wrap; }

.templates-grid { display: grid; gap: 30px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.template-card { padding-top: 14px; border-top: 3px solid var(--plum); }
.template-card textarea { font-size: 13px; line-height: 1.45; }
code.var { margin-right: 6px; padding: 1px 5px; background: var(--lilac-soft); font-size: 12.5px; }

.issues { margin: 26px 0 30px; }
.issues-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.issues-head h2 { margin: 0; font-size: 18px; }
.issues-meta { font-size: 12.5px; color: var(--muted); }
.issues-table td { vertical-align: middle; }
.issues-problem { margin: 0; padding: 10px 12px; background: var(--wash); border-left: 3px solid var(--lilac); color: var(--graphite); }

.build { position: static; margin-top: 14px; text-align: center; color: var(--lilac-soft); opacity: 0.8; }
.form-done { margin: 0 0 12px; padding: 8px 10px; font-size: 14px; color: #1f5c3a; background: #eaf5ee; }

/* ---------- уведомления ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  font-size: 14px;
  color: #fff;
  background: var(--graphite);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* ---------- страница входа ---------- */

.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--plum); }
.login-shell { width: min(430px, calc(100vw - 32px)); padding: 40px 0; }
.login-shell.wide-shell { width: min(640px, calc(100vw - 32px)); }
.login-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; text-decoration: none; }
.login-brand img { width: 64px; height: 60px; display: block; }
.login-brand .brand-name { color: #fff; font-size: 30px; }
.login-brand .accent { color: var(--lilac); }
.login-brand .brand-sub { display: block; margin-top: 6px; padding-left: 0; border-left: 0; color: var(--lilac-soft); }
.login-card { background: #fff; padding: 26px 28px 24px; }
.login-card h1 { font-size: 26px; margin-bottom: 14px; }
.login-card > p { margin: -4px 0 14px; color: var(--muted); }
.login-card .form-error {
  padding: 2px 0 10px;
  background: none;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
}
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.pw-toggle:hover { color: var(--plum); }
.pw-toggle svg { display: block; }

.sso { margin-top: 14px; }
.sso-or { margin: 0 0 10px; text-align: center; font-size: 13px; color: var(--muted); }
.sso-btn { gap: 10px; text-decoration: none; }

.code-input { font-family: var(--mono); font-size: 26px !important; letter-spacing: 0.3em; text-align: center; }
.qr { display: block; width: 196px; height: 196px; margin: 6px auto 10px; image-rendering: pixelated; }
.secret { margin: 0 0 16px; font-size: 13.5px; text-align: center; color: var(--muted); }
.secret code { display: inline-block; margin-top: 2px; padding: 2px 6px; font-family: var(--mono); font-size: 14px; color: var(--ink); background: var(--wash); letter-spacing: 0.05em; }
.steps { margin: 0 0 12px; padding-left: 20px; }
.steps li { margin-bottom: 4px; }
.login-alt { margin-top: 12px; text-align: center; }
.login-foot { margin-top: 18px; text-align: center; font-size: 14px; }
.login-foot a { color: var(--lilac-soft); }
.login-foot a:hover { color: #fff; }

/* ---------- адаптивность ---------- */

@media (max-width: 860px) {
  .topbar { padding: 10px 16px; gap: 10px; }
  .brand-sub { display: none; }
  .topnav { margin-left: 0; width: 100%; justify-content: space-between; }
  .nav-main { margin-right: 0; }
  .layout { grid-template-columns: 1fr; min-height: 0; }
  .rail { border-right: 0; border-bottom: 1px solid var(--lilac-soft); }
  .content { padding: 20px 16px 48px; }
  h1 { font-size: 26px; }
  .link-row { grid-template-columns: 1fr; }
  .link-tools { justify-self: start; flex-wrap: wrap; }
  .note-form { flex-direction: column; align-items: stretch; }
  .gl-head { display: none; }
  .gl-row { grid-template-columns: 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--lilac-soft); }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
