/* BoxolithLolkaBot — дашборд. Без сборки: чистый CSS, переменные, тёмная тема. */

:root {
  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --bg-sunken: #eef0f7;
  --text: #171a25;
  --text-dim: #5c6479;
  --border: #dfe3ef;
  --accent: #5a4fe0;
  --accent-text: #ffffff;
  --ok: #1f9254;
  --ok-bg: #e6f6ec;
  --warn: #9a6a00;
  --warn-bg: #fdf3dd;
  --danger: #c3363f;
  --danger-bg: #fdeaec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 20, 40, .06), 0 8px 24px rgba(16, 20, 40, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10121a;
    --bg-elevated: #181b26;
    --bg-sunken: #1f2331;
    --text: #e8eaf2;
    --text-dim: #9aa1b6;
    --border: #2a2f40;
    --accent: #7d73ff;
    --ok: #58d68d;
    --ok-bg: #14301f;
    --warn: #e6b455;
    --warn-bg: #322512;
    --danger: #ff7b85;
    --danger-bg: #331a1d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: "Cascadia Mono", Consolas, monospace; font-size: .88em;
       background: var(--bg-sunken); padding: .1em .35em; border-radius: 5px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--bg-elevated); padding: 8px; z-index: 10; }

/* ── шапка ─────────────────────────────────────────────────────────────── */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 24px;
  background: var(--bg-elevated); border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text); font-weight: 700;
}
.logo-dim { color: var(--text-dim); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nav a { color: var(--text-dim); font-weight: 500; }
.nav a.active, .nav a:hover { color: var(--text); }

.banner {
  padding: 10px 24px; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.banner.warn { background: var(--warn-bg); color: var(--warn); }

.wrap { width: min(1040px, 100% - 40px); margin: 28px auto 48px; flex: 1; }

.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 24px; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 13px;
}

/* ── типографика и блоки ───────────────────────────────────────────────── */

h1 { font-size: 26px; margin: 0 0 12px; }
h2 { font-size: 19px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 0 0 6px; }
.lead { color: var(--text-dim); font-size: 16px; margin: 0 0 20px; }
.muted { color: var(--text-dim); }
.dim { color: var(--text-dim); font-size: 13px; }
.hint { color: var(--text-dim); font-size: 13px; margin: 6px 0 0; }
.warn-text { color: var(--warn); }
.error-text { color: var(--danger); font-size: 13px; margin: 6px 0 0; }

.page-head { display: flex; align-items: center; justify-content: space-between;
             gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }

.panel {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}

.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash.error { background: var(--danger-bg); color: var(--danger); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: var(--bg-sunken); color: var(--text-dim); border: 1px solid var(--border);
}
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill { background: var(--accent); color: var(--accent-text); border-radius: 999px;
        padding: 0 7px; font-size: 12px; }
.chip { display: inline-block; background: var(--bg-sunken); border-radius: 6px;
        padding: 1px 6px; margin: 0 4px 4px 0; font-size: 12px; }
.tags { margin-top: 10px; }
.tag { display: inline-block; font-size: 12px; color: var(--text-dim);
       border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; margin-right: 6px; }

/* ── кнопки ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; background: var(--bg-sunken);
  color: var(--text); text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost.active { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
form.inline { display: inline; }

.sticky-actions {
  position: sticky; bottom: 0; display: flex; gap: 10px; padding: 14px 0;
  background: linear-gradient(to top, var(--bg) 65%, transparent);
}

/* ── формы ─────────────────────────────────────────────────────────────── */

.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%; padding: 9px 11px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 9px;
}
textarea { resize: vertical; }
select[multiple] { padding: 6px; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px;
  border-color: var(--accent);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field[hidden] { display: none; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 40px; height: 22px; border-radius: 999px; background: var(--bg-sunken);
  border: 1px solid var(--border); position: relative; transition: background .15s;
  flex: 0 0 auto;
}
.switch-dot {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-dim); transition: transform .15s, background .15s;
}
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track .switch-dot { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label { font-weight: 600; font-size: 14px; }

.stack { max-width: 460px; }
.auth-card {
  max-width: 420px; margin: 32px auto; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 16px; padding: 26px; box-shadow: var(--shadow);
}
.auth-card.wide { max-width: 640px; }

/* ── страницы ──────────────────────────────────────────────────────────── */

.hero { text-align: center; padding: 34px 0 26px; }
.hero h1 { font-size: 34px; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card-icon { font-size: 26px; margin-bottom: 8px; }
.card p { color: var(--text-dim); margin: 0; }

.steps { margin-top: 34px; }
.steps ol, .steps-list { color: var(--text-dim); padding-left: 20px; line-height: 1.9; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.server-card {
  display: flex; align-items: center; gap: 14px; padding: 16px; color: var(--text);
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
}
.server-card:hover { text-decoration: none; border-color: var(--accent); }
.server-icon { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; flex: 0 0 auto; }
.server-icon.placeholder { display: grid; place-items: center; background: var(--bg-sunken);
                           font-weight: 700; font-size: 19px; color: var(--text-dim); }
.server-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.server-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.module-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.module-row {
  display: flex; align-items: flex-start; gap: 16px; padding: 18px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
}
.module-row.on { border-left: 3px solid var(--ok); }
.module-icon { font-size: 24px; line-height: 1; }
.module-body { flex: 1; min-width: 0; }
.module-body p { color: var(--text-dim); margin: 0; }
.module-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.empty { text-align: center; padding: 48px 20px; color: var(--text-dim); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-dim); font-weight: 600; font-size: 13px; }
.truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kv { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--text-dim); font-size: 14px; }
.kv dd { margin: 0; }
.kv dd.pre { white-space: pre-wrap; }

.code-box { text-align: center; padding: 20px; background: var(--bg-sunken);
            border-radius: var(--radius); margin: 16px 0; }
.code { font-family: "Cascadia Mono", Consolas, monospace; font-size: 30px;
        letter-spacing: .22em; font-weight: 700; }

.transcript {
  max-height: 520px; overflow: auto; background: var(--bg-sunken); padding: 14px;
  border-radius: 10px; font-size: 13px; white-space: pre-wrap; word-break: break-word;
}

@media (max-width: 620px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .module-row { flex-direction: column; }
}
