/* Оформление платформы: одна тема на админку и стенд. */

:root {
  --bg: #0b0f17;
  --bg-1: #111827;
  --bg-2: #161f31;
  --bg-3: #1d283e;
  --line: #26324a;
  --line-2: #33415e;
  --text: #e6ecf7;
  --text-2: #9fb0cc;
  --text-3: #6b7d9c;
  --accent: #6366f1;
  --accent-2: #818cf8;
  --accent-soft: rgba(99, 102, 241, .14);
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --info: #0ea5e9;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .45);
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a3651; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a4a6d; }

/* ── каркасы ─────────────────────────────────────────────────────────────── */

.shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 264px;
  flex: 0 0 264px;
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar__brand {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar__logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  display: grid; place-items: center;
  font-size: 18px;
}

.sidebar__title { font-weight: 650; letter-spacing: -.01em; }
.sidebar__sub { font-size: 11.5px; color: var(--text-3); }

.sidebar__scroll { overflow-y: auto; flex: 1; padding: 10px 0 20px; }

.side-group__label {
  padding: 14px 18px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  cursor: pointer;
  color: var(--text-2);
  border-left: 2px solid transparent;
  user-select: none;
}
.side-item:hover { background: var(--bg-2); color: var(--text); }
.side-item.is-active { background: var(--accent-soft); color: var(--text); border-left-color: var(--accent); }
.side-item__emoji { width: 20px; text-align: center; font-size: 15px; }
.side-item__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item__badge {
  font-size: 10.5px; padding: 1px 6px; border-radius: 20px;
  background: var(--bg-3); color: var(--text-3);
}
.side-item.is-off .side-item__name { text-decoration: line-through; opacity: .55; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.topbar {
  height: 60px; flex: 0 0 60px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: var(--bg-1);
}
.topbar__title { font-size: 15px; font-weight: 600; }
.topbar__spacer { flex: 1; }

.content { flex: 1; overflow-y: auto; padding: 24px 26px 60px; }
.content--flush { padding: 0; overflow: hidden; }

/* ── элементы ────────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.card__head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.card__title { font-size: 13.5px; font-weight: 620; letter-spacing: .01em; }
.card__hint { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.card__spacer { flex: 1; }

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

.label {
  display: block;
  font-size: 12px; font-weight: 550;
  color: var(--text-2);
  margin-bottom: 6px;
}
.label__hint { font-weight: 400; color: var(--text-3); margin-left: 6px; font-size: 11.5px; }

.input, .select, .textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.55; font-family: var(--sans); }
.textarea--mono { font-family: var(--mono); font-size: 12.5px; }
.input--mono { font-family: var(--mono); font-size: 12.5px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--text);
  font: inherit; font-weight: 550; font-size: 13px;
  cursor: pointer;
  transition: background .12s, border-color .12s, opacity .12s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--bg-3); border-color: #3f5074; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.btn--danger { color: #fca5a5; border-color: #4a2530; background: #2a1620; }
.btn--danger:hover:not(:disabled) { background: #3a1c2a; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover:not(:disabled) { background: var(--bg-2); color: var(--text); }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn--block { width: 100%; justify-content: center; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch__track {
  width: 38px; height: 21px; border-radius: 20px;
  background: var(--bg-3); border: 1px solid var(--line-2);
  position: relative; transition: background .15s, border-color .15s;
  flex: 0 0 38px;
}
.switch__track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--text-3);
  transition: transform .15s, background .15s;
}
.switch input:checked + .switch__track { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(17px); background: var(--accent-2); }

.range-row { display: flex; align-items: center; gap: 12px; }
.range { flex: 1; accent-color: var(--accent); }
.range-val {
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  min-width: 46px; text-align: right;
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 550;
  background: var(--bg-3); color: var(--text-2);
  border: 1px solid var(--line);
}
.chip--ok { background: rgba(34,197,94,.13); color: #86efac; border-color: rgba(34,197,94,.3); }
.chip--warn { background: rgba(245,158,11,.13); color: #fcd34d; border-color: rgba(245,158,11,.3); }
.chip--err { background: rgba(239,68,68,.13); color: #fca5a5; border-color: rgba(239,68,68,.32); }
.chip--info { background: rgba(14,165,233,.13); color: #7dd3fc; border-color: rgba(14,165,233,.3); }
.chip--accent { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(99,102,241,.35); }

.empty {
  padding: 44px 20px; text-align: center; color: var(--text-3);
  border: 1px dashed var(--line-2); border-radius: var(--radius);
}
.empty__icon { font-size: 34px; margin-bottom: 10px; opacity: .6; }

.toast-host {
  position: fixed; bottom: 22px; right: 22px;
  display: flex; flex-direction: column; gap: 9px; z-index: 300;
}
.toast {
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 11px 15px;
  box-shadow: var(--shadow); max-width: 380px;
  animation: toast-in .18s ease-out;
  font-size: 13px;
}
.toast--err { border-color: #6b2b2b; background: #2a1620; color: #fca5a5; }
.toast--ok { border-color: rgba(34,197,94,.35); background: #14251b; color: #86efac; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3, 6, 12, .72);
  display: grid; place-items: center; z-index: 250; padding: 24px;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--bg-1); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: var(--shadow);
  width: min(680px, 100%); max-height: 86vh; overflow-y: auto;
}
.modal__head {
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; background: var(--bg-1); z-index: 1;
}
.modal__title { font-size: 15px; font-weight: 620; }
.modal__body { padding: 22px; }
.modal__foot {
  padding: 14px 22px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
  position: sticky; bottom: 0; background: var(--bg-1);
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 22px; background: var(--bg-1); }
.tab {
  padding: 11px 15px; cursor: pointer; font-size: 13px; font-weight: 550;
  color: var(--text-3); border-bottom: 2px solid transparent;
  transition: color .12s, border-color .12s;
}
.tab:hover { color: var(--text-2); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }

table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); font-weight: 600; padding: 0 12px 9px; border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-2); }

.kbd {
  font-family: var(--mono); font-size: 11px;
  background: var(--bg-3); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--text-2);
}

.stat {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 17px;
}
.stat__value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.stat__label { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.sep { height: 1px; background: var(--line); margin: 18px 0; }

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.dots::after {
  content: ''; animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }