/* Стили панели: та же палитра, что reset.html/play.html — панель выглядит
   как часть Bytelore. Темы — по системной; вёрстка сразу адаптивная:
   на узком экране навигация становится нижней панелью (ради 20.5). */
:root {
  --bg: #f2f2f7; --card: #ffffff; --text: #0d0d14;
  --muted: #737380; --brand: #595ced; --error: #d93838; --ok: #21a651;
  --border: #d9d9e0; --warn: #b8860b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121217; --card: #212129; --text: #f2f2f7;
    --muted: #9999a6; --brand: #787aff; --error: #ff6961; --ok: #4cc770;
    --border: #3a3a45; --warn: #e6b84c;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}
body.centered { display: flex; align-items: center; justify-content: center; padding: 16px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* Шапка и навигация */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; border-bottom: 1px solid var(--border);
  background: var(--card);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600;
         color: var(--text); text-decoration: none; }
.nav {
  display: flex; gap: 4px; padding: 6px 16px; background: var(--card);
  border-bottom: 1px solid var(--border); overflow-x: auto;
}
.nav a {
  padding: 7px 12px; border-radius: 8px; color: var(--muted);
  text-decoration: none; white-space: nowrap;
}
.nav a.active { color: var(--brand); background: var(--bg); font-weight: 600; }
.nav a:hover { color: var(--text); }
main { padding: 20px; max-width: 1080px; margin: 0 auto; }

/* На телефоне навигация — нижняя панель во всю ширину. */
@media (max-width: 640px) {
  .nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
    border-bottom: 0; border-top: 1px solid var(--border);
    justify-content: space-around;
  }
  main { padding-bottom: 76px; }
}

h1 { font-size: 22px; margin: 6px 0 16px; }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--error); font-weight: 600; }
.error { color: var(--error); font-size: 14px; margin-top: 12px; text-align: center; }
.crumbs { margin: 0 0 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }

/* Карточки */
.cards {
  display: grid; gap: 14px; margin-bottom: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--card); border-radius: 14px; padding: 18px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 8%); margin-bottom: 14px;
}
.cards .card { margin-bottom: 0; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .num { font-size: 30px; font-weight: 700; }
.stat .label { color: var(--muted); }
.stat .hint { color: var(--muted); font-size: 13px; }

/* Таблицы: на узком экране скроллятся внутри карточки, не ломая страницу. */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; }
th, td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
.num-cell { text-align: right; font-weight: 600; }
.card:has(table) { overflow-x: auto; }

/* Мини-график регистраций */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 88px; }
.bar-slot { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.bar { width: 100%; background: var(--brand); border-radius: 3px 3px 0 0; opacity: 0.85; }
.chart-range { display: flex; justify-content: space-between;
               color: var(--muted); font-size: 12px; margin-top: 6px; }

/* Статусы заданий */
.status { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-queued { background: var(--bg); color: var(--muted); }
.status-running { background: var(--bg); color: var(--warn); }
.status-done { background: var(--bg); color: var(--ok); }
.status-failed { background: var(--bg); color: var(--error); }
.progress-line { font-weight: 600; }
.log {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; font-size: 13px; white-space: pre-wrap; word-break: break-word;
  max-height: 480px; overflow-y: auto;
}
.pager { display: flex; justify-content: space-between; margin-top: 10px; }
.pager a { color: var(--brand); text-decoration: none; }

/* Формы */
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
input[type="password"], input[type="text"] {
  width: 100%; padding: 11px 14px; font-size: 16px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  outline: none;
}
input:focus { border-color: var(--brand); }
button {
  padding: 10px 18px; font-size: 15px; font-weight: 600; color: #fff;
  background: var(--brand); border: 0; border-radius: 10px; cursor: pointer;
}
button.ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  padding: 7px 14px; font-size: 14px;
}
button.ghost:hover { color: var(--text); }

/* Карточка входа */
.login-card { width: 100%; max-width: 400px; text-align: center; }
.login-card .mark { display: block; margin: 0 auto 12px; }
.login-card h1 { font-size: 21px; margin: 0 0 2px; }
.login-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.login-card form { text-align: left; }
.login-card button { width: 100%; margin-top: 14px; padding: 13px; }

/* Модуль «Ошибки» (20.6) */
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.filters label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; }
.filters select {
  padding: 8px 10px; font-size: 14px; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.actions form { display: flex; gap: 8px; align-items: center; }
.actions input[type="text"] { width: 170px; }
button.danger { background: var(--error); }
details pre {
  overflow-x: auto; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px; font-size: 12.5px; line-height: 1.5;
}
details summary { cursor: pointer; color: var(--muted); }
