/* ===== Шрифты Народного фронта: DIN Pro ===== */
@font-face { font-family: "DIN Pro"; src: url(/fonts/dinpro.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DIN Pro"; src: url(/fonts/dinpro_medium.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "DIN Pro"; src: url(/fonts/dinpro_bold.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "DIN Condensed"; src: url(/fonts/dinpro_condensedbold.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "DIN Condensed"; src: url(/fonts/dinpro_condensedblack.woff2) format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

/* ===== Палитра Народного фронта ===== */
:root {
  --red:     #e30613;   /* основной фирменный красный */
  --red-d:   #b00510;
  --red-dd:  #8a0410;
  --black:   #1a1a1a;
  --ink:     #222428;
  --muted:   #8a8a8e;
  --bg:      #f2f2f3;
  --box:     #e3e3e5;   /* серые подложки блоков */
  --line:    #dcdce0;
  --white:   #ffffff;
  --ok:      #2f9e4f;   /* зелёный «доверяю» — для онлайн-статуса */
  --radius:  6px;
  --shadow:  0 4px 18px rgba(0, 0, 0, 0.08);
  --body: "DIN Pro", "Segoe UI", Arial, system-ui, sans-serif;
  --head: "DIN Condensed", "DIN Pro", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
[hidden] { display: none !important; }

/* ===== Заголовки — сжатый DIN, капс ===== */
h1, h2, h3, .head { font-family: var(--head); letter-spacing: .2px; }

/* ===== Шапка ===== */
.topbar { background: var(--white); border-bottom: 3px solid var(--red); }
.topbar__inner {
  max-width: 1160px; margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.wordmark {
  font-family: var(--head); font-weight: 900; color: var(--red);
  font-size: 17px; line-height: .96; text-transform: uppercase; letter-spacing: .5px;
}
.brand__divider { width: 2px; height: 34px; background: var(--line); }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__title { font-family: var(--head); font-weight: 700; font-size: 17px; text-transform: uppercase; color: var(--black); }
.brand__sub { font-size: 12px; color: var(--muted); }
.topbar__nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.navbtn {
  background: transparent; color: var(--ink); border: none; cursor: pointer;
  font: inherit; font-weight: 500; font-size: 14px; padding: 8px 12px; border-radius: var(--radius);
  text-transform: uppercase; letter-spacing: .3px;
}
.navbtn:hover { background: #f3f3f4; color: var(--red); }
.navbtn--ghost { border: 1px solid var(--line); }
.navbtn--ghost:hover { border-color: var(--red); }
.user-chip {
  font-size: 13px; font-weight: 700; color: var(--white); padding: 6px 11px;
  background: var(--red); border-radius: 20px; text-transform: uppercase; letter-spacing: .3px;
}

/* ===== Экран входа ===== */
.login {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px; position: relative;
  background: #e30613;
  overflow: hidden;
}
/* «осколочные» грани как на обложке НФ — светлые/тёмные грани поверх яркого красного */
.login::before, .login::after {
  content: ""; position: absolute; inset: -25%; pointer-events: none;
}
.login::before {
  background:
    linear-gradient(118deg, rgba(255,255,255,.10) 0 30%, transparent 30%),
    linear-gradient(202deg, rgba(255,255,255,.07) 0 40%, transparent 40%),
    linear-gradient(150deg, transparent 55%, rgba(160,4,12,.55) 55% 58%, transparent 58%);
}
.login::after {
  background:
    linear-gradient(28deg, transparent 64%, rgba(120,3,9,.45) 64% 66%, transparent 66%),
    linear-gradient(320deg, transparent 72%, rgba(255,255,255,.06) 72%);
}
.login__wordmark {
  position: absolute; top: 26px; right: 30px; color: #fff; font-family: var(--head);
  font-weight: 900; font-size: 18px; line-height: .96; text-transform: uppercase;
  text-align: right; letter-spacing: .5px; z-index: 2;
}
.login__card {
  position: relative; z-index: 2;
  background: #fff; border-radius: 4px; box-shadow: 0 24px 70px rgba(0,0,0,.4);
  padding: 40px 36px; width: 100%; max-width: 390px; text-align: center;
}
.login__logo { display: none; }
.login__title { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 27px; margin: 0 0 6px; color: var(--black); line-height: 1; }
.login__sub { font-size: 14px; color: var(--muted); margin: 0 0 26px; }
.login__form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login__form label, .uform label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--black); text-transform: uppercase; letter-spacing: .4px;
}
.login__form input, .uform input, .uform select {
  font: inherit; font-size: 15px; padding: 12px; text-transform: none; letter-spacing: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fafafa;
}
.login__form input:focus, .uform input:focus, .uform select:focus {
  outline: none; border-color: var(--red); background: #fff;
  box-shadow: 0 0 0 3px rgba(227,6,19,.15);
}
.login__error {
  background: #fdecec; color: var(--red-dd); border: 1px solid #f4c6c6;
  padding: 9px 12px; border-radius: var(--radius); font-size: 13px;
}

/* ===== Кнопки ===== */
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border: none;
  border-radius: var(--radius); padding: 11px 18px; font-size: 14px;
  text-transform: uppercase; letter-spacing: .4px;
  transition: transform .05s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-d); }
.btn--dark { background: var(--black); color: #fff; }
.btn--dark:hover { background: #000; }
.btn--ghost { background: #fff; color: var(--black); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--red); color: var(--red); }
.btn--block { width: 100%; }
.btn:disabled { background: #cfcfd3; color: #fff; cursor: not-allowed; }

/* ===== Страницы ===== */
.page { padding: 32px 22px 60px; }
.page__inner { max-width: 1160px; margin: 0 auto; }
.page__h1 {
  font-family: var(--head); font-weight: 900; text-transform: uppercase;
  font-size: 30px; color: var(--black); margin: 0 0 4px; line-height: 1;
}
.page__lead { color: var(--muted); margin: 0 0 28px; font-size: 15px; }

/* ===== Разделы ===== */
.section { margin-bottom: 36px; }
.section__head { border-left: 5px solid var(--red); padding-left: 14px; margin-bottom: 18px; }
.section__title {
  font-family: var(--head); font-weight: 900; text-transform: uppercase;
  font-size: 22px; color: var(--black); margin: 0 0 3px;
  display: flex; align-items: center; gap: 10px; line-height: 1;
}
.section__icon { font-size: 21px; }
.section__sub { margin: 0; color: var(--muted); font-size: 14px; }

/* ===== Карточки сервисов ===== */
.cards {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 5px; height: 100%;
  background: var(--red);
}
.card__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card__icon {
  font-size: 25px; width: 50px; height: 50px; flex: none;
  display: grid; place-items: center; background: var(--box); border-radius: var(--radius);
}
.card__title { font-family: var(--head); font-weight: 700; text-transform: uppercase; font-size: 18px; margin: 4px 0 0; color: var(--black); line-height: 1; }
.card__desc { color: #55565b; font-size: 14px; line-height: 1.5; flex: 1; margin: 0 0 18px; }
.card__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Метки статуса */
.tag {
  font-family: var(--head); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 3px 9px; border-radius: 3px; align-self: flex-start; margin-top: 6px;
}
.tag--online   { background: #e4f4e9; color: var(--ok); }
.tag--download { background: #fde7e9; color: var(--red); }
.tag--skill    { background: #ececee; color: var(--black); }
.tag--soon     { background: #ededef; color: var(--muted); }
.tag--dev      { background: #ededef; color: var(--muted); }

/* ===== Таблица сотрудников ===== */
.utable { width: 100%; border-collapse: collapse; margin-top: 18px; background: #fff;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.utable th, .utable td { padding: 12px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line); }
.utable th { background: var(--black); color: #fff; font-family: var(--head); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.utable tr:last-child td { border-bottom: none; }
.utable .pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 3px; text-transform: uppercase; }
.pill--admin { background: #fde7e9; color: var(--red); }
.pill--user { background: #ededef; color: var(--muted); }
.pill--on { background: #e4f4e9; color: var(--ok); }
.pill--off { background: #fdecec; color: var(--red-dd); }
.row-actions { display: flex; gap: 6px; }
.iconbtn { background: none; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  padding: 5px 10px; font-size: 13px; font-weight: 700; color: var(--black); text-transform: uppercase; letter-spacing: .3px; }
.iconbtn:hover { border-color: var(--red); color: var(--red); }
.iconbtn--danger { color: var(--red); }

/* ===== Модалки ===== */
.modal { position: fixed; inset: 0; background: rgba(26,26,26,.6);
  display: grid; place-items: center; padding: 22px; z-index: 50; }
.modal__box { background: #fff; border-radius: 4px; padding: 30px; max-width: 470px;
  width: 100%; box-shadow: 0 24px 70px rgba(0,0,0,.45); position: relative; border-top: 5px solid var(--red); }
.modal__close { position: absolute; top: 12px; right: 14px; background: none; border: none;
  font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal__title { font-family: var(--head); font-weight: 900; text-transform: uppercase; color: var(--black); margin: 0 0 18px; font-size: 21px; line-height: 1; }
.guide { padding-left: 20px; margin: 0 0 20px; color: var(--ink); }
.guide li { margin-bottom: 9px; line-height: 1.5; font-size: 14px; white-space: pre-wrap; }
.uform { display: flex; flex-direction: column; gap: 14px; }

/* ===== Страница скилла ===== */
.skill__back { margin-bottom: 18px; }
.skill { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.skill__head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.skill__head .card__icon { width: 58px; height: 58px; font-size: 30px; }
.skill__head .page__h1 { margin-bottom: 4px; }
.skill__head .page__lead { margin: 0; }
.skill__readme {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 30px; color: var(--ink); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere;
}
.skill__loading { color: var(--muted); }
.skill__readme h1, .skill__readme h2, .skill__readme h3, .skill__readme h4 {
  font-family: var(--head); font-weight: 900; text-transform: uppercase; color: var(--black);
  line-height: 1.05; margin: 26px 0 12px;
}
.skill__readme h1 { font-size: 26px; }
.skill__readme h2 { font-size: 21px; border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.skill__readme h3 { font-size: 17px; }
.skill__readme p { margin: 0 0 14px; }
.skill__readme ul, .skill__readme ol { margin: 0 0 14px; padding-left: 22px; }
.skill__readme li { margin-bottom: 6px; }
.skill__readme a { color: var(--red); text-decoration: none; font-weight: 600; }
.skill__readme a:hover { text-decoration: underline; }
.skill__readme a.anchor, .skill__readme .octicon-link { display: none; }
.skill__readme code {
  background: #f2f2f4; border-radius: 4px; padding: 2px 6px; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.skill__readme pre {
  background: #1a1a1a; color: #f3f3f3; border-radius: var(--radius); padding: 16px 18px;
  overflow: auto; margin: 0 0 16px;
}
.skill__readme pre code { background: none; color: inherit; padding: 0; }
.skill__readme blockquote {
  border-left: 4px solid var(--red); margin: 0 0 16px; padding: 4px 16px; color: var(--muted);
}
.skill__readme table { border-collapse: collapse; margin: 0 0 16px; width: 100%; }
.skill__readme th, .skill__readme td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.skill__readme th { background: #f5f5f7; }
.skill__readme img { max-width: 100%; height: auto; }
.skill__readme hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.skill__more { margin-top: 16px; }
.skill__more > summary {
  cursor: pointer; list-style: none; user-select: none;
  font-family: var(--head); font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  font-size: 13px; color: var(--muted); padding: 10px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
.skill__more > summary::-webkit-details-marker { display: none; }
.skill__more > summary::before { content: "▸ "; color: var(--red); }
.skill__more[open] > summary::before { content: "▾ "; }
.skill__more[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.skill__more .skill__readme { border-top: none; border-radius: 0 0 var(--radius) var(--radius); }
.skill__side { position: sticky; top: 22px; }
.skill__box {
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.skill__boxtitle { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 18px; margin: 0; color: var(--black); }
.skill__boxnote { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.skill__box .guide { margin: 6px 0 0; padding-left: 18px; }
.skill__box .guide li { font-size: 13px; margin-bottom: 7px; }
@media (max-width: 860px) {
  .skill { grid-template-columns: 1fr; }
  .skill__side { position: static; }
}

/* ===== Бета-метка и плашка ===== */
.tag--beta { background: #fff2e0; color: #b56a00; }
.skill__beta {
  background: #fff7ec; border: 1px solid #f3d9a8; border-left: 4px solid #d68a00;
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px;
  color: #8a5a00; font-size: 14px; line-height: 1.45;
}

/* ===== Комментарии ===== */
.comments { margin-top: 32px; }
.comments__title {
  font-family: var(--head); font-weight: 900; text-transform: uppercase;
  font-size: 22px; color: var(--black); margin: 0 0 4px;
}
.comments__sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.comments__form {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 20px;
}
.comments__form textarea {
  width: 100%; font: inherit; font-size: 15px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; background: #fafafa;
}
.comments__form textarea:focus {
  outline: none; border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}
.comments__formbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.comments__err { color: var(--red-dd); font-size: 13px; }
.comments__list { display: flex; flex-direction: column; gap: 12px; }
.comments__empty { color: var(--muted); font-size: 14px; }
.comment { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.comment__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment__author { font-weight: 700; color: var(--black); }
.comment__date { color: var(--muted); font-size: 12px; }
.comment__del {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .3px;
}
.comment__del:hover { color: var(--red); }
.comment__body { font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ===== Тост ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--black); color: #fff; padding: 13px 20px; border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 14px; font-weight: 500; z-index: 80;
  border-left: 4px solid var(--red);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .topbar__inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .brand__divider { display: none; }
}
