/* ==========================================================================
   Страница сборок — оформление в стиле проекта Roadmap.
   Сдержанная светлая палитра, аккуратные тени, системные шрифты, без CDN.
   ========================================================================== */

:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #fbfcfe;
  --line: #e3e8ef;
  --line-soft: #eef2f7;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #8a94a6;
  --accent: #3b5bdb;
  --accent-ink: #2946b4;
  --accent-soft: #eef2ff;
  --danger: #d64545;
  --danger-soft: #fdecec;
  --warn: #e8590c;
  --warn-soft: #fff4e6;
  --warn-ink: #a8480b;
  --ok: #1f7a5c;
  --ok-soft: #e8f6ef;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-2: 0 10px 30px -12px rgba(15, 23, 42, 0.25), 0 2px 8px rgba(15, 23, 42, 0.06);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 19px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--ink-3); font-size: 12.5px; }

/* ── Каркас ─────────────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel-soft);
  border-right: 1px solid var(--line);
}

.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; }

.brand__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(140deg, #3b5bdb, #5b4bc4);
  color: #fff; box-shadow: 0 2px 6px rgba(59, 91, 219, 0.35);
}

.brand__name { display: flex; flex-direction: column; font-size: 15px; font-weight: 650; }
.brand__sub { font-size: 11.5px; font-weight: 400; color: var(--ink-3); }

.sidebar__search {
  display: flex; align-items: center; gap: 7px;
  margin: 0 14px 10px; padding: 0 10px; height: 32px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink-3);
}
.sidebar__search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: 13px; color: var(--ink); }

.sidebar__list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 12px; }

.sidebar__foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }

/* ── Список продуктов ───────────────────────────────────────────────────── */
.product {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px; margin-bottom: 4px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: none; color: var(--ink); font: inherit; cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.product:hover { background: #f2f5fa; }
.product.is-active { background: #fff; border-color: #c7d2fe; box-shadow: var(--shadow-1); }
.product__name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.product__meta { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

/* ── Основная область ───────────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }

.topbar {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 18px 24px 16px; background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar__title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.topbar__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.content { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 40px; }

/* ── Две колонки сборок (без разделительных линий) ──────────────────────── */
.board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  align-items: start;
}

.column { min-width: 0; }

.column__head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.column__title { display: flex; align-items: center; gap: 9px; }
.column__title h2 { font-weight: 650; }
.column__hint { color: var(--ink-3); font-size: 12.5px; }
.column__empty {
  margin: 0; padding: 18px 16px;
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
  background: var(--panel-soft); color: var(--ink-3); font-size: 13px;
}

@media (max-width: 1180px) {
  .board { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}

.build {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
  padding: 16px 18px; margin-bottom: 12px;
}
.build--test { border-color: #f2ddc0; background: #fffdfa; }
.build__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.build__version { font-family: var(--mono); font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.build__date { color: var(--ink-3); font-size: 12.5px; margin-left: auto; }
.build__notes { color: var(--ink-2); font-size: 13.5px; margin: 8px 0 12px; white-space: pre-wrap; }
.build__notes:empty { display: none; }

.assets { display: flex; flex-direction: column; gap: 6px; }
.asset {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 9px;
  background: var(--panel-soft);
}
.asset__name { font-weight: 550; }
.asset__size { color: var(--ink-3); font-size: 12px; }
.asset__hash { margin-left: auto; color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; }

/* ── Мелкие элементы ────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  background: #f1f4f9; color: var(--ink-2); font-size: 12px; white-space: nowrap;
}
.chip b { color: var(--ink); font-weight: 600; }
.chip--accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip--test { background: var(--warn-soft); color: var(--warn-ink); }
.chip--ok { background: var(--ok-soft); color: var(--ok); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink-2);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.btn:hover { background: #f8fafc; border-color: #cfd8e3; color: var(--ink); text-decoration: none; }

/* Главная кнопка — ссылка на боевой сайт продукта */
.btn--primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(59, 91, 219, 0.35);
}
.btn--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; height: 60%; color: var(--ink-3); text-align: center;
}

/* Ряд со ссылкой на боевой сайт вместо файлов релиза */
.asset--prod { background: var(--accent-soft); border-color: #c7d2fe; align-items: center; }

/* ── Сворачиваемые карточки админ-зоны ──────────────────────────────────── */
.build--collapsible { padding: 0; }

.build--collapsible > .build__head {
  padding: 13px 18px;
  margin: 0;
  cursor: pointer;
  list-style: none;
}
.build--collapsible > .build__head::-webkit-details-marker { display: none; }
.build--collapsible[open] > .build__head { border-bottom: 1px solid var(--line-soft); }

.build__actions {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto;   /* вправо, вместе с датой не разъезжается */
}
.build--collapsible .build__date { margin-left: 0; }

.build__chevron {
  color: var(--ink-3); font-size: 12px;
  transition: transform 0.15s ease;
}
.build--collapsible[open] .build__chevron { transform: rotate(90deg); }

.build__body { padding: 12px 18px 16px; }
.build__body .build__notes { margin-top: 0; }

/* Галочка публикации в свёрнутой карточке — компактная */
.build--collapsible .toggle { margin: 0 0 0 4px; padding: 4px 9px; height: 26px; font-size: 12.5px; }
.build--collapsible .toggle input { width: 14px; height: 14px; }

/* ── Отчёт Windows-агента ───────────────────────────────────────────────── */
.report {
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel-soft);
}
.report--ok { border-color: #bfe3d2; background: var(--ok-soft); }
.report--warnings { border-color: #f2ddc0; background: var(--warn-soft); }
.report--failed { border-color: #f0c4c4; background: var(--danger-soft); }

.report__head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px; }
.report__meta { color: var(--ink-3); font-size: 12.5px; }
.report__summary { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.report__problems { margin: 0 0 10px; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }
.report__problem { margin-bottom: 3px; }
.report__shot {
  display: block; max-width: 100%; margin: 6px 0 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.report__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Админ-зона ─────────────────────────────────────────────────────────── */

/* Сборка, скрытая от публичной зоны: видна только здесь и приглушена. */
.build--hidden { background: var(--panel-soft); border-style: dashed; }

.toggle {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 2px 0 10px;
  padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.toggle:hover { background: #f8fafc; }
.toggle input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

.history-block { margin-top: 30px; }
.history-block h2 { margin-bottom: 10px; }

.history {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--panel); box-shadow: var(--shadow-1);
  padding: 12px 16px; margin-bottom: 10px;
}
.history summary { cursor: pointer; font-weight: 550; color: var(--ink); }
.history__text {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  color: var(--ink-2); white-space: pre-wrap; overflow-x: auto;
}

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); max-height: 42vh; }
  .content { padding: 16px; }
  .topbar { padding: 14px 16px; }
}
