:root {
  --bg: #1e1f21;
  --bg-soft: #232426;
  --panel: #2a2b2e;
  --panel-2: #313235;
  --border: #3a3b3f;
  --border-strong: #4a4c51;
  --text: #e9eaec;
  --muted: #a4a6ab;
  --faint: #777a80;
  --accent: #5aa7ff;
  --accent-soft: rgba(90, 167, 255, 0.14);
  --green: #7fcf9b;
  --blue: #5aa7ff;
  --danger: #e05a5a;
  --danger-soft: rgba(224, 90, 90, 0.13);
  --warn: #e2b85c;
  --warn-soft: rgba(226, 184, 92, 0.13);
  --radius: 6px;
  --radius-sm: 4px;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono, .mono-text { font-family: var(--mono); }
code { background: rgba(255, 255, 255, 0.05); padding: 1px 5px; border-radius: 5px; font-size: 0.92em; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
p { margin: 0 0 10px; }

/* ---------- layout ---------- */
.layout { display: flex; flex-direction: column; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 46px;
  flex: 0 0 46px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border-right: 0;
  border-bottom: 1px solid var(--border);
  background: #26272a;
  z-index: 50;
}

.brand { display: flex; align-items: center; gap: 9px; text-decoration: none !important; color: var(--text); flex: 0 0 auto; }
.brand-mark {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: grid; place-items: center;
  border-radius: 4px;
  background: var(--accent);
  color: #0b1522;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: -0.03em;
  box-shadow: none;
}
.brand-text { display: flex; flex-direction: column; font-weight: 700; font-size: 12.5px; letter-spacing: 0.14em; line-height: 1.05; }
.brand-text small { font-weight: 500; font-size: 8px; letter-spacing: 0.2em; color: var(--faint); text-transform: uppercase; margin-top: 2px; }

.nav { display: flex; flex-direction: row; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; overflow: visible; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px;
  border-radius: 3px;
  color: var(--muted);
  font-weight: 500;
  font-size: 11.5px;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.nav a svg { width: 14px; height: 14px; fill: currentColor; opacity: 0.7; }
.nav a:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); text-decoration: none; }
.nav a.active {
  background: var(--accent-soft);
  color: #86c0ff;
  border-color: rgba(90, 167, 255, 0.22);
}
.nav a.active svg { opacity: 1; }

.nav-group { position: relative; }
.nav-group > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 3px;
  color: var(--muted);
  font-weight: 500;
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  list-style: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  content: "▾";
  font-size: 9px;
  opacity: 0.6;
  transition: transform 0.12s;
}
.nav-group[open] > summary::after { transform: rotate(180deg); }
.nav-group > summary svg { width: 14px; height: 14px; fill: currentColor; opacity: 0.7; }
.nav-group > summary:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }
.nav-group.active > summary,
.nav-group[open] > summary {
  background: var(--accent-soft);
  color: #86c0ff;
  border-color: rgba(90, 167, 255, 0.22);
}
.nav-group.active > summary svg,
.nav-group[open] > summary svg { opacity: 1; }

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  min-width: 230px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}
.nav-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.nav-menu a svg { width: 14px; height: 14px; fill: currentColor; opacity: 0.7; }
.nav-menu a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); text-decoration: none; }
.nav-menu a.active {
  background: var(--accent-soft);
  color: #86c0ff;
  border-color: rgba(90, 167, 255, 0.22);
}
.nav-menu a.active svg { opacity: 1; }

.sidebar-foot { margin-top: 0; display: flex; flex-direction: row; align-items: center; gap: 14px; padding-top: 0; border-top: 0; flex: 0 0 auto; }
.conn { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.ver { font-size: 9.5px; color: var(--faint); font-family: var(--mono); }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; text-align: left; }
.link-button:hover { color: var(--danger); }

.main { min-width: 0; padding: 18px 20px 16px; display: flex; flex-direction: column; flex: 1; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.titles h1 { font-size: 25px; }
.sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.action-group { display: flex; gap: 7px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--panel);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.pill.ok { border-color: rgba(111, 227, 161, 0.35); color: var(--green); background: rgba(111, 227, 161, 0.07); }
.pill.off { border-color: rgba(255, 97, 97, 0.3); color: var(--danger); background: var(--danger-soft); }
.pill.warn { border-color: rgba(255, 200, 87, 0.3); color: var(--warn); background: var(--warn-soft); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: 0 0 8px; }
.dot.ok, .pill.ok .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(111, 227, 161, 0.13); }
.dot.off, .pill.off .dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 97, 97, 0.12); }
.dot.warn, .pill.warn .dot { background: var(--warn); }

.flash-area { display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  font-size: 13px;
}
.flash.ok { border-color: rgba(111, 227, 161, 0.35); background: rgba(111, 227, 161, 0.08); }
.flash.err { border-color: rgba(255, 97, 97, 0.4); background: var(--danger-soft); }
.flash.warn { border-color: rgba(255, 200, 87, 0.4); background: var(--warn-soft); }

.footer { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--border); color: var(--faint); font-size: 11.5px; }

/* ---------- cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  min-width: 0;
}
.card.subtle { background: rgba(255, 255, 255, 0.02); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 15px;
  min-width: 0;
}
.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); font-weight: 650; margin-bottom: 7px; }
.stat-value { display: flex; align-items: baseline; gap: 7px; font-size: 23px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.stat-value.small { font-size: 16px; }
.stat-dim { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-sub { margin-top: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 22px 0 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 16px; display: flex; align-items: baseline; gap: 8px; }

.range-bar { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--panel); }
.range-btn { background: transparent; border: 0; border-right: 1px solid var(--border); color: var(--muted); font: inherit; font-size: 12px; padding: 6px 11px; cursor: pointer; }
.range-btn:last-child { border-right: 0; }
.range-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.range-btn.active { background: var(--accent-soft); color: var(--accent); }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-card { padding-bottom: 10px; }
.chart { width: 100%; display: block; }
.legend { display: flex; gap: 13px; font-size: 11px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: var(--blue); }
.lg.host::before { background: #6fb3ff; }
.lg.squad::before { background: #6fd1c0; }
.lg.players::before { background: #8dc4ff; }

.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.admin-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.btn:hover { background: #3a3b3f; border-color: #56585e; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn.primary { background: #2f6fae; border-color: #3a82c9; color: #f2f7ff; }
.btn.primary:hover { background: #3a82c9; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: rgba(224, 90, 90, 0.4); color: #ff8f8f; }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.small { padding: 4px 8px; font-size: 11px; }
.btn.wide { width: 100%; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.field > span { color: var(--muted); font-weight: 600; }
.input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #202124;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus { border-color: rgba(90, 167, 255, 0.65); box-shadow: 0 0 0 2px rgba(90, 167, 255, 0.12); }
.input.small { padding: 6px 9px; font-size: 12px; }
.input.grow { flex: 1 1 130px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
textarea.input { resize: vertical; line-height: 1.55; }
.hint { color: var(--faint); font-size: 11.5px; margin: 0; }
.warn-text { color: var(--warn); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .field:nth-child(1), .form-grid .field:nth-child(2) { grid-column: span 1; }
.mono-text { font-family: var(--mono); font-size: 12.5px; }
.checkbox-line { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.checkbox-line input { accent-color: var(--accent); }
.password-wrap { position: relative; display: flex; }
.password-wrap .input { padding-right: 78px; }
.ghost-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; padding: 4px 6px; }
.ghost-eye:hover { color: var(--accent); }
.switch-field { position: relative; }
.switch-field input { position: absolute; opacity: 0; width: 42px; height: 22px; right: 0; top: 22px; cursor: pointer; z-index: 2; }
.switch { position: absolute; right: 0; top: 22px; width: 42px; height: 22px; border-radius: 999px; background: #2c2d30; border: 1px solid var(--border-strong); transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.switch-field input:checked + .switch { background: var(--accent-soft); border-color: rgba(90, 167, 255, 0.55); }
.switch-field input:checked + .switch::after { transform: translateX(20px); background: var(--accent); }
.save-bar { display: flex; align-items: center; justify-content: flex-end; gap: 18px; padding: 12px 2px 4px; }
.inline-form { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.inline-field { flex-direction: row; align-items: center; gap: 9px; }
.row-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.stack-form { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
form.inline { display: inline; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 650; padding: 7px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 9px; border-bottom: 1px solid rgba(31, 43, 55, 0.6); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 7px 8px; }
.table .right { text-align: right; white-space: nowrap; }
.table .empty, .empty { color: var(--faint); text-align: center; padding: 18px 8px; font-size: 12.5px; }
.table td.mono { color: #cfe0f0; font-size: 12.2px; }
.audit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.audit li { display: grid; grid-template-columns: 74px 130px minmax(0, 1fr); gap: 9px; padding: 7px 2px; border-bottom: 1px solid rgba(31, 43, 55, 0.55); font-size: 11.8px; align-items: baseline; }
.audit li:last-child { border-bottom: 0; }
.audit-time { color: var(--faint); font-family: var(--mono); font-size: 10.8px; }
.audit-action { color: var(--accent); font-family: var(--mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.audit-detail { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- badges / chips ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 650; border: 1px solid var(--border-strong); color: var(--muted); background: rgba(255, 255, 255, 0.02); white-space: nowrap; }
.badge.lock { color: var(--warn); border-color: rgba(255, 200, 87, 0.3); background: var(--warn-soft); }
.badge.ok { color: var(--green); border-color: rgba(111, 227, 161, 0.3); background: rgba(111, 227, 161, 0.08); }
.badge.warn { color: var(--warn); border-color: rgba(255, 200, 87, 0.3); background: var(--warn-soft); }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.chip { font-family: var(--mono); font-size: 10.8px; padding: 3px 7px; border-radius: 6px; background: rgba(90, 184, 255, 0.08); border: 1px solid rgba(90, 184, 255, 0.18); color: #a9d8ff; }
.chip.unknown { color: var(--warn); border-color: rgba(255, 200, 87, 0.3); background: var(--warn-soft); }

/* ---------- configs ---------- */
.configs-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.file-list-card { padding: 12px; }
.file-list { display: flex; flex-direction: column; gap: 2px; max-height: 460px; overflow-y: auto; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; border-radius: 7px; color: var(--muted); text-decoration: none !important; font-size: 12.2px; }
.file-row:hover { background: rgba(255, 255, 255, 0.035); color: var(--text); }
.file-row.active { background: var(--accent-soft); color: var(--accent); }
.file-name { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: var(--faint); white-space: nowrap; }
.file-forms { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.file-input { max-width: 100%; font-size: 10.5px; }
.editor-card { padding: 16px; }
.editor-form { display: flex; flex-direction: column; gap: 10px; }
.code-editor { font-family: var(--mono); font-size: 12.3px; line-height: 1.55; min-height: 480px; white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: hidden; tab-size: 4; }
.editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- admins ---------- */
.details { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.details summary { cursor: pointer; color: var(--muted); font-size: 12.3px; font-weight: 600; padding: 4px 0; }
.details summary:hover { color: var(--text); }
.details[open] summary { margin-bottom: 10px; }
.details form { display: flex; flex-direction: column; gap: 11px; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; }
.perm-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.perm { display: flex; align-items: flex-start; gap: 8px; padding: 5px 7px; border-radius: 7px; cursor: pointer; font-size: 11.8px; }
.perm:hover { background: rgba(255, 255, 255, 0.025); }
.perm input { margin-top: 3px; accent-color: var(--accent); }
.perm span { display: flex; flex-direction: column; gap: 1px; }
.perm b { font-family: var(--mono); font-weight: 600; color: #cfe0f0; font-size: 11.4px; }
.perm small { color: var(--faint); font-size: 10.6px; line-height: 1.35; }
.perm-grid + .field { margin-top: 12px; }
.group-card { display: flex; flex-direction: column; }
.new-group { border-style: dashed; }
.admins-table .row-form { justify-content: flex-end; }
.admins-table .row-form .input.small { min-width: 120px; }

/* ---------- whitelist ---------- */
.info-card .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 12px; }
.info-card h4 { margin-bottom: 6px; }
.slots-form { padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------- console ---------- */
.console-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.console-card { padding: 14px; }
.console-out {
  margin: 0;
  height: 480px;
  overflow: auto;
  background: #191a1c;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12.3px;
  line-height: 1.55;
  color: #c8ced6;
  white-space: pre-wrap;
  word-break: break-word;
}
.console-dim { color: var(--faint); }
.console-cmd { color: var(--accent); }
.console-error { color: #ff9c9c; }
.console-form { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.prompt { color: var(--accent); font-family: var(--mono); font-weight: 700; }
.console-input { flex: 1; min-width: 0; background: #202124; border: 1px solid var(--border-strong); border-radius: 4px; color: var(--text); font-family: var(--mono); font-size: 13px; padding: 9px 11px; outline: none; }
.console-input:focus { border-color: rgba(90, 167, 255, 0.6); }
.console-side { display: flex; flex-direction: column; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quick-grid .btn { justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 12.3px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; color: var(--text); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; padding: 24px; }
.login-wrap { width: 100%; max-width: 380px; }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 28px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5); }
.login-brand { margin-bottom: 22px; }
.login-card h1 { font-size: 22px; }
.login-card .sub { margin-bottom: 18px; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.login-note { margin: 18px 0 0; color: var(--faint); font-size: 11px; text-align: center; }

/* ---------- toasts / misc ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; }
.toast { padding: 9px 13px; border-radius: 4px; background: #303134; border: 1px solid var(--border-strong); color: var(--text); font-size: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); animation: toast-in 0.18s ease-out; max-width: 380px; }
.toast.err { border-color: rgba(255, 97, 97, 0.45); }
.toast.ok { border-color: rgba(111, 227, 161, 0.4); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.inline-error { padding: 9px 12px; margin-bottom: 10px; border-radius: 8px; border: 1px solid rgba(255, 97, 97, 0.35); background: var(--danger-soft); color: #ffb3b3; font-size: 12.5px; }
.hidden { display: none; }
.small-text { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 12px; }
.muted-row { opacity: 0.55; }
.search-input { width: 220px; }
.remove-mod-form { display: inline-flex; align-items: center; gap: 8px; }
.plain-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.plain-list code { font-size: 11.5px; }

/* ---------- dialog ---------- */
.dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #2b2c2f;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.dialog::backdrop { background: rgba(10, 10, 12, 0.72); backdrop-filter: blur(2px); }
.dialog form { display: flex; flex-direction: column; gap: 12px; }
.dialog-player { margin: 0; padding: 9px 11px; border-radius: 8px; background: rgba(255, 255, 255, 0.035); color: var(--muted); font-size: 12.3px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.ghost-eye.static { position: static; transform: none; margin-left: auto; }

/* ---------- dashboard shell ---------- */
body[data-page="dashboard"] .topbar { display: none; }
body[data-page="dashboard"] .footer { display: none; }
body[data-page="dashboard"] .main { padding: 10px 12px 12px; }
body[data-page="dashboard"] .flash-area:empty { display: none; }

/* ---------- доступ к панели ---------- */
.steam-login { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 10px; text-decoration: none; }
.login-sep { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em; margin: 14px 0; }
.login-sep::before, .login-sep::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.access-add { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) 150px auto; gap: 8px; align-items: center; }
.access-user { border: 1px solid var(--border); border-radius: 4px; padding: 10px; margin-top: 10px; background: #2b2c2f; }
.access-user-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.access-avatar { width: 34px; height: 34px; border-radius: 3px; object-fit: cover; border: 1px solid var(--border); }
.access-avatar.placeholder { display: grid; place-items: center; background: #303134; color: var(--muted); font-size: 11px; font-weight: 700; }
.access-ident { min-width: 0; flex: 1; }
.access-ident b { display: block; font-size: 12px; }
.access-ident span { display: block; font-size: 10px; }
.access-user-fields { grid-template-columns: minmax(140px, 1fr) 170px auto; align-items: end; }
.access-active { align-self: center; padding-top: 14px; }
.access-perms { margin-top: 9px; border-top: 1px solid var(--border); padding-top: 8px; }
.access-perms summary { cursor: pointer; color: var(--muted); font-size: 10.5px; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 9px; }
.perm-group h4 { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin-bottom: 4px; }
.perm-line { display: flex; gap: 6px; font-size: 10.5px; line-height: 1.35; margin: 2px 0; }
.perm-actions { display: flex; gap: 6px; margin-top: 8px; }
.access-delete { margin-top: 6px; }
@media (max-width: 900px) {
  .access-add, .access-user-fields { grid-template-columns: 1fr; }
  .access-active { padding-top: 0; }
}
@media (max-width: 1280px) {
  .nav a, .nav-group > summary { padding: 6px 7px; font-size: 11px; }
  .sidebar { gap: 10px; padding: 0 12px; }
  .sidebar-foot { gap: 8px; }
}
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-groups { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; min-height: 46px; flex: 0 0 auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; flex-wrap: wrap; overflow: visible; row-gap: 2px; }
  .nav-group { position: static; }
  .nav-group[open] { flex-basis: 100%; }
  .nav-menu {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 4px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    box-shadow: none;
  }
  .sidebar-foot { margin-left: auto; }
}
@media (max-width: 980px) {
  .sidebar { position: static; height: auto; min-height: 46px; flex: 0 0 auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; flex-wrap: wrap; overflow: visible; row-gap: 2px; }
  .nav a { padding: 6px 8px; }
  .sidebar-foot { margin-left: auto; }
  .main { padding: 16px 14px; }
  .chart-grid, .grid-two, .info-card .info-grid, .form-grid, .console-layout, .configs-layout { grid-template-columns: 1fr; }
  .file-list { max-height: 220px; }
  .code-editor { min-height: 340px; }
  .console-out { height: 360px; }
  .save-bar { flex-direction: column; align-items: stretch; }
  .login-body { padding: 14px; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-right { width: 100%; justify-content: flex-start; }
  .form-grid { gap: 13px; }
  .perm-grid { grid-template-columns: 1fr; }
  .audit li { grid-template-columns: 62px minmax(0, 1fr); }
  .audit-detail { display: none; }
  .quick-grid { grid-template-columns: 1fr; }
  .action-group { width: 100%; }
  .action-group form { flex: 1; }
  .action-group .btn { width: 100%; }
}

