/* Панель RKDash Lite. © geniok */
:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #16181d;
  --muted: #6b7280;
  --line: #e2e5ea;
  --accent: #1f5fd0;
  --ok: #17794a;
  --warn: #a35a00;
  --error: #b3261e;
  --sidebar: 248px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --panel: #1c1f25;
    --text: #e8eaee;
    --muted: #9aa1ad;
    --line: #2c313a;
    --accent: #3f7ce8;
    --ok: #5cc48c;
    --warn: #e0a458;
    --error: #f2837b;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Боковое меню слева, рабочая область занимает остальное место */
body.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
body.plain { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }

.sidebar {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px; background: var(--panel); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { font-weight: 600; font-size: 16px; padding: 2px 12px 18px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--text); font-size: 14px;
}
.sidebar nav a:hover { background: var(--bg); text-decoration: none; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar .foot { border-top: 1px solid var(--line); padding-top: 12px; }
.sidebar .who { color: var(--muted); font-size: 13px; padding: 0 12px 8px; }
.sidebar .foot button { width: 100%; }

.content { padding: 28px 32px 56px; max-width: 1180px; width: 100%; }
body.plain .content { max-width: 420px; padding: 0; }

h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0 0 12px; }
p.lead { color: var(--muted); margin: 0 0 20px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px; margin-bottom: 18px;
}
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], textarea, select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--text); font: inherit;
}
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.check input { margin-top: 3px; }
.check .title { font-size: 14px; }
.check .hint { color: var(--muted); font-size: 13px; }
button, .button {
  display: inline-block; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font: inherit; cursor: pointer;
}
button:hover, .button:hover { text-decoration: none; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--error); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
pre {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; overflow-x: auto; font-size: 13px; margin: 0 0 12px;
}
.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 13px; border: 1px solid var(--line); margin: 0 4px 4px 0; }
.status.ok { color: var(--ok); }
.status.off { color: var(--muted); }
.status.error { color: var(--error); }
.status.warn { color: var(--warn); }
.notice { border-left: 3px solid var(--accent); padding: 10px 14px; background: var(--bg); border-radius: 6px; margin-bottom: 16px; }
.notice.error { border-color: var(--error); }
.notice.token { border-color: var(--ok); }
.muted { color: var(--muted); }
.fact { margin: 0 0 6px; }

@media (max-width: 860px) {
  body.app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar .brand { padding-bottom: 12px; }
  .sidebar .foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .sidebar .who { padding: 0; }
  .sidebar .foot button { width: auto; }
  .content { padding: 20px 18px 40px; }
}
