:root {
  --bg: #070a08;
  --bg-soft: #0a100d;
  --panel: #0f1712;
  --panel-2: #141f18;
  --panel-3: #1a2a1f;
  --line: rgba(235, 255, 244, 0.07);
  --line-strong: rgba(235, 255, 244, 0.13);
  --text: #eaf5ee;
  --muted: #95aca0;
  --muted-2: #6d8379;
  --green: #3ee08a;
  --green-soft: rgba(62, 224, 138, 0.12);
  --green-strong: #24b96c;
  --yellow: #f5c451;
  --red: #ff7777;
  --red-soft: rgba(255, 119, 119, 0.1);
  --blue: #7dd3fc;
  --purple: #c4b5fd;
  --orange: #fb923c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1000px 700px at 8% -15%, rgba(62, 224, 138, 0.13), transparent 62%),
    radial-gradient(800px 600px at 105% -5%, rgba(125, 211, 252, 0.06), transparent 60%),
    radial-gradient(700px 700px at 50% 120%, rgba(62, 224, 138, 0.05), transparent 65%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 40% 20%, black, transparent 78%);
}

a {
  color: var(--green);
  text-decoration: none;
}

a:hover {
  color: #74f0ad;
}

button,
input,
select,
textarea {
  font: inherit;
}

code,
.mono {
  font-family: var(--mono);
}

::selection {
  background: rgba(62, 224, 138, 0.32);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #26372d;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #33493b;
  border: 2px solid transparent;
  background-clip: padding-box;
}

[hidden] {
  display: none !important;
}

.icon {
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: middle;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(62, 224, 138, 0.045), transparent 28%),
    rgba(9, 14, 11, 0.72);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  padding: 2px 6px;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 6px 16px rgba(62, 224, 138, 0.25));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: 3px;
}

.side-create {
  width: 100%;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
  transition: 0.15s ease;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.nav-link.active {
  color: var(--text);
  background: rgba(62, 224, 138, 0.09);
  border-color: rgba(62, 224, 138, 0.18);
}

.nav-link.active .nav-icon {
  color: var(--green);
}

.nav-icon {
  color: var(--muted-2);
  display: inline-grid;
  place-items: center;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  padding: 1px 7px;
}

.sidebar-note {
  margin-top: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
  border-radius: 12px;
  padding: 12px 13px;
}

.sidebar-note-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 9px;
}

.capacity {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-strong), var(--green));
  box-shadow: 0 0 12px rgba(62, 224, 138, 0.4);
  transition: width 0.4s ease;
}

.sidebar-note-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.02);
}

.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 750;
  font-size: 14px;
  color: #052213;
  background: linear-gradient(135deg, #8af7bb, #2bc978);
  text-transform: uppercase;
}

.user-meta {
  min-width: 0;
  flex: 1;
}

.user-email {
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  font-size: 10.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.user-actions {
  display: flex;
  gap: 3px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.icon-btn.danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

/* ── Main / typography ───────────────────────────────────────────────── */
.main {
  min-width: 0;
  padding: 30px 34px 70px;
  max-width: 1460px;
  width: 100%;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 750;
}

.page-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

h2 {
  font-size: 15px;
  letter-spacing: -0.01em;
  margin: 0;
  font-weight: 650;
}

h3 {
  font-size: 14px;
  margin: 0;
  font-weight: 650;
}

p {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.text-green {
  color: var(--green);
}

.text-red {
  color: var(--red);
}

.text-yellow {
  color: var(--yellow);
}

.mono-break {
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible,
.icon-btn:focus-visible,
.input:focus-visible,
.tab:focus-visible,
.switch:focus-visible {
  outline: 2px solid rgba(62, 224, 138, 0.55);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #5df0a7, #1dbd6a 55%, #0e9b57);
  border-color: rgba(255, 255, 255, 0.16);
  color: #04150b;
  box-shadow: 0 10px 28px rgba(43, 202, 117, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7df5b9, #23c977 55%, #0faf62);
  color: #04150b;
  box-shadow: 0 14px 34px rgba(43, 202, 117, 0.32);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(255, 119, 119, 0.13);
  border-color: rgba(255, 119, 119, 0.3);
  color: #ff9b9b;
}

.btn-danger:hover {
  background: rgba(255, 119, 119, 0.22);
  color: #ffc0c0;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: 8px;
  gap: 6px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  padding: 8px;
  width: 34px;
  height: 34px;
}

/* ── Stats ───────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent), var(--panel);
}

.stat-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: var(--green-soft);
}

.stat-icon.blue {
  color: var(--blue);
  background: rgba(125, 211, 252, 0.09);
}

.stat-icon.yellow {
  color: var(--yellow);
  background: rgba(245, 196, 81, 0.09);
}

.stat-icon.purple {
  color: var(--purple);
  background: rgba(196, 181, 253, 0.09);
}

.stat-value {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-label {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.stat-hint {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 1px;
}

/* ── Server cards ────────────────────────────────────────────────────── */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}

.server-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(62, 224, 138, 0.05), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent),
    var(--panel);
  padding: 17px;
  cursor: pointer;
  transition: 0.18s ease;
  overflow: hidden;
}

.server-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.server-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}

.server-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.server-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: var(--type-color, var(--green));
  background: color-mix(in srgb, var(--type-color, var(--green)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--type-color, var(--green)) 24%, transparent);
  text-shadow: 0 0 18px color-mix(in srgb, var(--type-color, var(--green)) 45%, transparent);
}

.server-title {
  min-width: 0;
  flex: 1;
}

.server-name {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 15px 0 14px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.addr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: #a9c0b3;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: 0.15s ease;
}

.addr-chip:hover {
  border-color: rgba(62, 224, 138, 0.35);
  color: var(--green);
}

.server-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.server-actions .btn {
  flex: 1;
}

.server-actions .btn-icon {
  flex: 0 0 auto;
}

/* ── Badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.badge.no-dot::before {
  display: none;
}

.status-running {
  color: #6ef0aa;
  background: rgba(62, 224, 138, 0.1);
  border-color: rgba(62, 224, 138, 0.22);
}

.status-running::before {
  animation: pulse 1.8s ease-in-out infinite;
}

.status-starting,
.status-stopping,
.status-installing {
  color: var(--yellow);
  background: rgba(245, 196, 81, 0.09);
  border-color: rgba(245, 196, 81, 0.2);
}

.status-starting::before,
.status-stopping::before,
.status-installing::before {
  animation: pulse 1.2s ease-in-out infinite;
}

.status-stopped {
  color: #9bac9f;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.09);
}

.status-crashed,
.status-error {
  color: #ff9b9b;
  background: rgba(255, 119, 119, 0.09);
  border-color: rgba(255, 119, 119, 0.22);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--green);
  animation: spin 0.75s linear infinite;
  flex: 0 0 auto;
}

.spinner.dark {
  border-color: rgba(0, 0, 0, 0.2);
  border-top-color: #04150b;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Empty / loading / error ─────────────────────────────────────────── */
.empty {
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background:
    radial-gradient(500px 240px at 50% 0%, rgba(62, 224, 138, 0.06), transparent 70%),
    rgba(255, 255, 255, 0.012);
  padding: 60px 24px;
  text-align: center;
}

.empty-art {
  margin: 0 auto 18px;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background: rgba(62, 224, 138, 0.07);
  border: 1px solid rgba(62, 224, 138, 0.14);
  filter: drop-shadow(0 16px 30px rgba(62, 224, 138, 0.15));
}

.empty h2 {
  font-size: 20px;
  margin-bottom: 7px;
}

.empty p {
  color: var(--muted);
  font-size: 13.5px;
  max-width: 470px;
  margin: 0 auto 20px;
}

.empty-actions {
  display: flex;
  gap: 9px;
  justify-content: center;
  flex-wrap: wrap;
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 40px 20px;
  justify-content: center;
  font-size: 13.5px;
}

.error-box {
  border: 1px solid rgba(255, 119, 119, 0.28);
  background: var(--red-soft);
  border-radius: var(--radius);
  padding: 22px;
  color: #ffc7c7;
}

.error-box h3 {
  color: #ffd5d5;
  margin-bottom: 6px;
}

.error-box p {
  color: #e9a5a5;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ── Layout panels ───────────────────────────────────────────────────── */
.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 40%),
    var(--panel);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 18px;
}

.panel-pad {
  padding: 18px;
}

.panel-link {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.panel-link:hover {
  color: var(--green);
}

/* ── Server page header ──────────────────────────────────────────────── */
.server-head {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.back-btn {
  margin-top: 2px;
}

.server-head .server-icon {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  font-size: 20px;
}

.server-head-info {
  min-width: 0;
  flex: 1;
}

.server-head-info h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.server-head-info .server-sub {
  font-size: 12.5px;
  margin-top: 5px;
}

.server-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Notices ─────────────────────────────────────────────────────────── */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  font-size: 13px;
  margin-bottom: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.notice .notice-content {
  flex: 1;
  min-width: 0;
}

.notice strong {
  color: var(--text);
  font-weight: 650;
}

.notice-info {
  border-color: rgba(125, 211, 252, 0.2);
  background: rgba(125, 211, 252, 0.055);
}

.notice-warn {
  border-color: rgba(245, 196, 81, 0.22);
  background: rgba(245, 196, 81, 0.055);
}

.notice-error {
  border-color: rgba(255, 119, 119, 0.25);
  background: var(--red-soft);
}

.notice-success {
  border-color: rgba(62, 224, 138, 0.22);
  background: var(--green-soft);
}

.notice-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}

/* ── Tabs ────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  border: 0;
  background: transparent;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: 0.15s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.tab-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.tab-count {
  font-size: 10.5px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  padding: 0 6px;
}

/* ── Address / connect ───────────────────────────────────────────────── */
.address-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-bottom: 10px;
}

.address-main {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #d9f7e7;
  flex: 1;
  overflow-wrap: anywhere;
}

.address-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  font-size: 11.5px;
  color: var(--muted-2);
}

.address-sub code {
  color: var(--muted);
  font-size: 11.5px;
}

.quick-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ── Chips / quick commands ──────────────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: 0.15s ease;
}

.chip-btn:hover {
  color: var(--green);
  border-color: rgba(62, 224, 138, 0.32);
  background: rgba(62, 224, 138, 0.06);
}

.chip-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Info list ───────────────────────────────────────────────────────── */
.info-list {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  font-size: 12.5px;
}

.info-row:last-child {
  border-bottom: 0;
}

.info-key {
  color: var(--muted-2);
}

.info-val {
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

.resource-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin: 9px 0 8px;
}

.resource-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-strong), var(--green));
}

.resource-caption {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted-2);
}

/* ── Mini console ────────────────────────────────────────────────────── */
.mini-console {
  background: #060a08;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  max-height: 230px;
  overflow: auto;
}

.mini-line {
  color: #8ca397;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mini-line.warn {
  color: #d9b45c;
}

.mini-line.err {
  color: #ef8d8d;
}

.mini-line.ok {
  color: #6ee7a5;
}

.mini-line.join {
  color: #8cc7e8;
}

/* ── Terminal ────────────────────────────────────────────────────────── */
.terminal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(62, 224, 138, 0.7);
}

.live-dot.off {
  background: var(--muted-2);
  box-shadow: none;
}

.terminal {
  height: min(56vh, 560px);
  overflow: auto;
  padding: 14px 16px;
  background: #050806;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}

.term-line {
  color: #9bb2a6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 1.6em;
}

.term-line.warn {
  color: #e4bc62;
}

.term-line.err {
  color: #ff9090;
}

.term-line.ok {
  color: #72eda9;
}

.term-line.join {
  color: #8ed0f2;
}

.term-line.cmd {
  color: #c8b9ff;
}

.term-line.system {
  color: #72887c;
  font-style: italic;
}

.term-input-row {
  display: flex;
  gap: 9px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.term-prompt {
  font-family: var(--mono);
  color: var(--green);
  font-weight: 700;
  padding-top: 9px;
}

.term-input {
  flex: 1;
  background: #060a08;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  padding: 9px 11px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.term-input:focus {
  outline: 2px solid rgba(62, 224, 138, 0.2);
  border-color: rgba(62, 224, 138, 0.4);
}

/* ── Forms ───────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label,
.label {
  font-size: 12px;
  font-weight: 600;
  color: #b9cbc0;
}

.hint {
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.45;
}

.input {
  width: 100%;
  background: #0a110d;
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 13.5px;
  transition: 0.15s ease;
}

.input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.input:focus {
  outline: none;
  border-color: rgba(62, 224, 138, 0.5);
  box-shadow: 0 0 0 3px rgba(62, 224, 138, 0.08);
}

.input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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: 30px;
}

textarea.input {
  resize: vertical;
  min-height: 90px;
}

.input-mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--green);
  cursor: pointer;
}

.check-row strong {
  color: var(--text);
  font-weight: 600;
}

.slider {
  width: 100%;
  accent-color: var(--green);
  height: 4px;
}

.slider-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.slider-value strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.memory-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.memory-chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  border-radius: 6px;
  padding: 3px 7px;
  cursor: pointer;
}

.memory-chip:hover {
  color: var(--green);
  border-color: rgba(62, 224, 138, 0.3);
}

/* ── Type picker ─────────────────────────────────────────────────────── */
.type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.type-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 11px;
  padding: 11px;
  color: var(--text);
  cursor: pointer;
  transition: 0.15s ease;
}

.type-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.035);
}

.type-card.active {
  border-color: rgba(62, 224, 138, 0.55);
  background: rgba(62, 224, 138, 0.065);
  box-shadow: inset 0 0 0 1px rgba(62, 224, 138, 0.18);
}

.type-dot {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--tc, var(--green));
  background: color-mix(in srgb, var(--tc, var(--green)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc, var(--green)) 25%, transparent);
}

.type-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.type-name {
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.2;
}

.type-desc {
  font-size: 10.5px;
  color: var(--muted-2);
  line-height: 1.35;
  margin-top: 0;
}

/* ── File manager ────────────────────────────────────────────────────── */
.files-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

.crumb {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 5px;
}

.crumb:hover {
  color: var(--green);
  background: rgba(255, 255, 255, 0.04);
}

.crumb.current {
  color: var(--text);
}

.crumb-sep {
  color: var(--muted-2);
  opacity: 0.6;
}

.scroll-x {
  overflow-x: auto;
}

.file-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.file-table th,
.data-table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  font-weight: 650;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.file-table td,
.data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--muted);
  vertical-align: middle;
}

.file-table tr:last-child td,
.data-table tr:last-child td {
  border-bottom: 0;
}

.file-table tbody tr:hover,
.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.022);
}

.file-name {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 550;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.file-name .icon {
  color: var(--muted-2);
}

.file-name.dir .icon {
  color: var(--yellow);
}

.row-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
  opacity: 0.45;
  transition: 0.15s ease;
}

tr:hover .row-actions {
  opacity: 1;
}

.files-panel {
  position: relative;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(62, 224, 138, 0.55);
  border-radius: var(--radius);
  background: rgba(8, 20, 13, 0.82);
  display: grid;
  place-items: center;
  z-index: 5;
  color: var(--green);
  font-weight: 600;
  backdrop-filter: blur(3px);
  pointer-events: none;
}

.empty-row {
  text-align: center;
  color: var(--muted-2);
  padding: 34px 16px !important;
}

/* ── Properties ──────────────────────────────────────────────────────── */
.prop-list {
  display: flex;
  flex-direction: column;
}

.prop-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.95fr) minmax(0, 1.05fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.prop-row:last-child {
  border-bottom: 0;
}

.prop-key {
  min-width: 0;
}

.prop-key .label {
  display: block;
  font-size: 12px;
  color: #c3d3c9;
}

.prop-code {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 1px;
  overflow-wrap: anywhere;
}

.prop-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prop-value .input {
  padding: 7px 9px;
  font-size: 12.5px;
}

.switch {
  width: 38px;
  height: 22px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  transition: 0.18s ease;
}

.switch::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #c3d3c9;
  transition: 0.18s ease;
}

.switch.on {
  background: rgba(62, 224, 138, 0.24);
  border-color: rgba(62, 224, 138, 0.5);
}

.switch.on::after {
  left: 18px;
  background: var(--green);
  box-shadow: 0 0 8px rgba(62, 224, 138, 0.6);
}

.danger-zone {
  border: 1px solid rgba(255, 119, 119, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 119, 119, 0.035);
  padding: 17px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.danger-zone h3 {
  color: #ffb3b3;
}

.danger-zone p {
  font-size: 12px;
  color: #c99595;
  margin-top: 3px;
}

/* ── Backups ─────────────────────────────────────────────────────────── */
.backup-list {
  display: flex;
  flex-direction: column;
}

.backup-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.backup-row:last-child {
  border-bottom: 0;
}

.backup-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--purple);
  background: rgba(196, 181, 253, 0.08);
  flex: 0 0 auto;
}

.backup-info {
  flex: 1;
  min-width: 0;
}

.backup-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.backup-meta {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 2px;
}

.backup-actions {
  display: flex;
  gap: 3px;
}

/* ── Tables (admin) ──────────────────────────────────────────────────── */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.table-head h2 {
  font-size: 14px;
}

.role-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 5px;
  margin-right: 4px;
  display: inline-block;
  vertical-align: middle;
  background: rgba(196, 181, 253, 0.1);
  color: var(--purple);
  border: 1px solid rgba(196, 181, 253, 0.2);
}
.role-super {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.5);
}

/* ── Forum: thread list / open view / create page ─────────────────────── */
.thread-row {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.thread-row:last-child { border-bottom: none; }
.thread-row-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}
.thread-row-letter {
  display: grid;
  place-items: center;
  background: var(--green);
  color: #090d0a;
  font-weight: 800;
  font-size: 16px;
}
.thread-row-main { flex: 1; min-width: 0; }
.thread-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.thread-row-title a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}
.thread-row-title a:hover { color: var(--green); }
.thread-row-excerpt {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thread-row-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.badge {
  display: inline-block;
  background: var(--green);
  color: #090d0a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 5px;
  padding: 3px 8px;
}
.badge-red {
  background: #ff4055;
  color: #fff;
}
.thread-post {
  display: grid;
  grid-template-columns: 200px 1fr;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  margin-bottom: 12px;
  overflow: hidden;
}
.thread-post.pinned { border-color: var(--green); }
.thread-author {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.thread-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.thread-avatar-letter {
  display: grid;
  place-items: center;
  background: var(--green);
  color: #090d0a;
  font-size: 30px;
  font-weight: 800;
}
.thread-nick {
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.thread-roles { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.thread-post-main { padding: 16px 20px; min-width: 0; }
.thread-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.thread-post-body { font-size: 15px; line-height: 1.8; }
.forum-body { white-space: pre-wrap; }
.forum-hl { color: #ff8a5f; font-weight: 700; }
.forum-h2 {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--green);
  margin: 16px 0 12px;
}
.forum-h3 { font-size: 16px; font-weight: 800; color: var(--green); margin: 14px 0 8px; }
.forum-img {
  max-width: 100%;
  border-radius: 10px;
  margin: 10px 0;
  border: 1px solid var(--border);
}
.thread-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #d26827;
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}
.required-tag {
  color: #ff5f57;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.thread-toolbar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 6px;
  background: rgba(255, 255, 255, 0.02);
}
.tb-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
}
.tb-btn:hover { border-color: var(--green); color: var(--green); }
.dropzone {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.015);
}
.dropzone.dragover { border-color: var(--green); background: rgba(62, 224, 138, 0.06); }
.dropzone-main {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.dropzone-main u { color: var(--green); }
.dropzone-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.dropzone-previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dropzone-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.thread-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}
@media (max-width: 880px) {
  .thread-post { grid-template-columns: 1fr; }
  .thread-author { border-right: none; border-bottom: 1px solid var(--border); }
  .thread-row-stats { display: none; }
}

/* ── Donate shop (fun-time-like, black/green) ───────────────────────── */
.main:has(.shop-layout) {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 30px 28px 70px;
  box-sizing: border-box;
}
.shop-layout {
  width: 100%;
  max-width: none;
  padding: 0 28px;
  box-sizing: border-box;
}
.shop-grid {
  display: grid;
  grid-template-columns: minmax(320px, 35%) 1fr;
  gap: 24px;
  align-items: stretch;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.shop-left {
  background: #151d17;
  border: 1px solid #1e2b21;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 12px;
  align-self: start;
  width: 100%;
  box-sizing: border-box;
}
.shop-search .input {
  background: #090d0a;
  border-color: #26352a;
  color: #f5fff7;
}
.shop-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.shop-cat {
  background: transparent;
  border: 1px solid #26352a;
  color: #a4b5a8;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.shop-cat.active {
  background: #39f57c;
  border-color: #39f57c;
  color: #090d0a;
  font-weight: 700;
}
.shop-cat:hover:not(.active) {
  border-color: #39f57c;
  color: #f5fff7;
}
.shop-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 600px;
  padding-right: 2px;
}
.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #090d0a;
  border: 1px solid #1e2b21;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  color: #f5fff7;
  transition: all 0.15s ease;
  width: 100%;
}
.shop-item:hover {
  border-color: #27d965;
}
.shop-item.selected {
  border-color: #39f57c;
  box-shadow: 0 0 12px rgba(57, 245, 124, 0.18);
  background: #0e1510;
}
.shop-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(57, 245, 124, 0.1);
  color: #39f57c;
  flex: 0 0 auto;
}
.shop-item-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.shop-item-name { font-size: 15px; font-weight: 600; min-width: 0; }
.shop-item-price { font-size: 13px; color: #39f57c; font-weight: 700; margin-left: auto; white-space: nowrap; }
.shop-detail {
  background: #151d17;
  border: 1px solid #1e2b21;
  border-radius: 16px;
  padding: 24px;
  min-height: 420px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.shop-terms {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  border-bottom: 1px solid #1e2b21;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.shop-term { flex: 0 0 auto; }
.shop-term {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #a4b5a8;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  cursor: pointer;
  text-transform: uppercase;
}
.shop-term:hover { color: #f5fff7; }
.shop-term.active {
  color: #39f57c;
  border-bottom-color: #39f57c;
}
.shop-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.shop-qty-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #26352a;
  background: #090d0a;
  color: #39f57c;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
.shop-qty-btn:hover { border-color: #39f57c; }
.shop-qty-input { width: 110px; text-align: center; }
.shop-qty-label { font-size: 13px; font-weight: 700; color: #a4b5a8; margin-top: 16px; text-transform: uppercase; letter-spacing: 0.05em; }
.shop-usage {
  margin-top: 14px;
  background: #090d0a;
  border: 1px solid #1e2b21;
  border-radius: 12px;
  padding: 12px 14px;
}
.shop-usage-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #39f57c; margin-bottom: 6px; }
.shop-usage-row { font-size: 14px; color: #a4b5a8; }
.shop-detail-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #1e2b21;
}
.shop-detail-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(57, 245, 124, 0.12);
  color: #39f57c;
  box-shadow: 0 0 18px rgba(57, 245, 124, 0.25);
}
.shop-detail h2 { margin: 0; font-size: 20px; color: #f5fff7; }
.shop-desc { margin-top: 12px; color: #a4b5a8; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.shop-price-line { margin-top: 16px; margin-bottom: 16px; }
.shop-price { font-size: 30px; font-weight: 800; color: #39f57c; }
.shop-buy {
  margin-top: auto;
  width: 100%;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 16px;
  padding: 14px;
  border-radius: 12px;
}
.shop-buy:disabled { opacity: 0.45; cursor: not-allowed; }
.modal.shop-modal {
  border-color: rgba(57, 245, 124, 0.55);
  box-shadow: 0 0 0 1px rgba(57, 245, 124, 0.2), 0 24px 60px rgba(0, 0, 0, 0.55);
  background: #101813;
}
@media (max-width: 880px) {
  .main:has(.shop-layout) { padding: 18px 12px 50px; }
  .shop-layout { padding: 0 12px; }
  .shop-grid { grid-template-columns: 1fr; }
  .shop-left { position: static; }
  .shop-list { max-height: 340px; }
  .shop-detail { min-height: 0; padding: 16px; }
  .shop-terms { overflow-x: auto; }
}

.role-badge.user {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-color: var(--line);
}

button.role-badge {
  cursor: pointer;
  font: inherit;
}

.role-badge.owner {
  background: rgba(245, 196, 81, 0.12);
  color: var(--yellow);
  border-color: rgba(245, 196, 81, 0.3);
}

.avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
}

.profile-avatar-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line-strong);
  flex: 0 0 auto;
}

.profile-avatar-letter {
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
  background: var(--panel-3);
  color: var(--green);
}

.profile-avatar-info {
  flex: 1;
  min-width: 0;
}

.shop-card {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(62, 224, 138, 0.06), rgba(255, 255, 255, 0.02));
  border-radius: 14px;
  padding: 16px;
}

.shop-card h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.shop-card p {
  color: var(--muted);
  font-size: 12.5px;
  min-height: 36px;
}

.shop-price {
  font-size: 22px;
  font-weight: 800;
  margin: 10px 0;
  color: var(--green);
}

.shop-price span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.ad-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 14px;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
}

.ad-banner img {
  width: 56px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
}

.ad-tag {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ad-placeholder {
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  padding: 12px 16px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.015);
}

.codes-list {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.24);
  padding: 10px 12px;
  max-height: 220px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}

.code-line {
  padding: 2px 0;
  word-break: break-all;
  color: var(--text);
}

.code-line.used {
  color: var(--muted-2);
  text-decoration: line-through;
}

.access-block {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.015);
}

.access-block h3 {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.access-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.access-form .input {
  flex: 1;
  min-width: 140px;
}

.access-form select.input {
  flex: 0 0 auto;
  min-width: auto;
}

.access-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.access-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.access-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.access-meta {
  font-size: 11px;
  color: var(--muted-2);
}

.owner-banner {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 11px;
  border: 1px solid rgba(245, 196, 81, 0.3);
  background: rgba(245, 196, 81, 0.07);
  border-radius: 11px;
  color: var(--yellow);
  font-size: 12px;
  line-height: 1.4;
}

.owner-banner strong {
  display: block;
  color: #f8dc96;
  font-size: 12.5px;
}

.owner-banner span {
  color: #d9c48a;
}

.public-card {
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, rgba(62, 224, 138, 0.08), rgba(20, 32, 24, 0.4));
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.public-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.public-card-head h2 {
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.public-card-head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.public-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.public-link-row code {
  flex: 1;
  min-width: 240px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 9px;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  color: #d9f7e7;
  font-family: var(--mono);
  font-size: 12.5px;
}

.meta-pill-offline {
  color: var(--yellow);
  border-color: rgba(245, 196, 81, 0.25);
  background: rgba(245, 196, 81, 0.07);
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.access-card {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 11px;
  padding: 11px;
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.4;
}

.access-card span span {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
  margin-top: 2px;
}

.access-card:has(input:checked) {
  border-color: rgba(62, 224, 138, 0.55);
  background: rgba(62, 224, 138, 0.065);
}

@media (max-width: 640px) {
  .access-grid {
    grid-template-columns: 1fr;
  }
  .public-card-head {
    flex-direction: column;
  }
}

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 8, 6, 0.72);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  animation: fadeIn 0.15s ease;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: #101813;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-wide {
  max-width: 780px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.modal-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}

.modal-close {
  margin: -2px -4px 0 0;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

/* ── Toasts ──────────────────────────────────────────────────────────── */
.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(390px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: #121c16;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 11px 13px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  font-size: 12.5px;
  color: var(--text);
  animation: toastIn 0.2s ease;
}

.toast .icon {
  margin-top: 1px;
}

.toast-success {
  border-color: rgba(62, 224, 138, 0.3);
}

.toast-success .icon {
  color: var(--green);
}

.toast-error {
  border-color: rgba(255, 119, 119, 0.32);
  background: #1c1213;
}

.toast-error .icon {
  color: var(--red);
}

.toast-info .icon {
  color: var(--blue);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ── Auth ────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
}

.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 46px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 34px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(800px 600px at 0% 100%, rgba(62, 224, 138, 0.13), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(125, 211, 252, 0.06), transparent 55%),
    #0a110d;
}

.hero-art {
  position: absolute;
  right: -80px;
  top: 40px;
  width: 430px;
  height: 430px;
  opacity: 0.5;
  pointer-events: none;
  transform: rotate(-8deg);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(62, 224, 138, 0.24);
  background: rgba(62, 224, 138, 0.07);
  color: #a2f3c8;
  border-radius: 99px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: fit-content;
}

.auth-hero h1 {
  max-width: 620px;
  font-size: clamp(38px, 4.6vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin: 20px 0 18px;
  font-weight: 800;
}

.auth-hero h1 em {
  font-style: normal;
  color: var(--green);
  text-shadow: 0 0 40px rgba(62, 224, 138, 0.3);
}

.hero-lead {
  max-width: 520px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 600px;
  margin-top: 30px;
}

.hero-feature {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.022);
}

.hero-feature .icon {
  color: var(--green);
  margin-top: 1px;
}

.hero-feature strong {
  display: block;
  font-size: 12px;
  font-weight: 650;
}

.hero-feature span {
  display: block;
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 1px;
  line-height: 1.35;
}

.hero-foot {
  font-size: 11px;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 2;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 26px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-brand-mobile {
  display: none;
  margin-bottom: 24px;
}

.auth-card h2 {
  font-size: 26px;
  letter-spacing: -0.03em;
  margin: 0 0 5px;
}

.auth-card .sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}

.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.auth-tab.active {
  background: rgba(62, 224, 138, 0.11);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(62, 224, 138, 0.2);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-form .btn {
  margin-top: 4px;
  padding: 11px 16px;
}

.auth-note {
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.6;
}

.form-error {
  display: none;
  font-size: 12px;
  color: #ffabab;
  background: rgba(255, 119, 119, 0.08);
  border: 1px solid rgba(255, 119, 119, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
}

.form-error.show {
  display: block;
}

/* ── Misc ────────────────────────────────────────────────────────────── */
.hr {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.right {
  margin-left: auto;
}

.section-gap {
  margin-top: 16px;
}

.text-sm {
  font-size: 12px;
}

.text-xs {
  font-size: 11px;
}

.nowrap {
  white-space: nowrap;
}

.kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.sep-dot::before {
  content: "·";
  margin-right: 6px;
  color: var(--muted-2);
}

.host-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.host-tile {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
  border-radius: 10px;
  padding: 10px 12px;
}

.host-tile .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-2);
}

.host-tile .value {
  font-size: 14px;
  font-weight: 650;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.java-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.java-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  font-size: 11.5px;
}

.java-version {
  font-weight: 750;
  color: var(--green);
  flex: 0 0 auto;
}

.java-path {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10.5px;
  overflow-wrap: anywhere;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1120px) {
  .layout-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 12, 10, 0.9);
  }
  .brand-mark {
    width: 30px;
    height: 30px;
  }
  .brand-mark svg {
    width: 30px;
    height: 30px;
  }
  .brand-sub {
    display: none;
  }
  .brand-name {
    font-size: 15px;
  }
  .side-create {
    display: none;
  }
  .nav {
    flex-direction: row;
    margin-left: auto;
    gap: 2px;
  }
  .nav-link {
    padding: 7px 9px;
    font-size: 12.5px;
  }
  .nav-badge {
    display: none;
  }
  .sidebar-note {
    display: none;
  }
  .sidebar-foot {
    margin-left: 0;
  }
  .user-card {
    border: 0;
    background: transparent;
    padding: 0;
    gap: 6px;
  }
  .user-meta {
    display: none;
  }
  .avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  .user-actions .icon-btn:first-child {
    display: none;
  }
  .main {
    padding: 22px 18px 60px;
  }
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    display: none;
  }
  .auth-brand-mobile {
    display: block;
  }
  .auth-panel {
    min-height: 100vh;
    padding: 30px 20px;
  }
}

@media (max-width: 640px) {
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .page-head h1 {
    font-size: 24px;
  }
  .stats-grid {
    gap: 8px;
  }
  .stat-card {
    padding: 12px;
    gap: 9px;
  }
  .stat-icon {
    width: 32px;
    height: 32px;
  }
  .stat-value {
    font-size: 18px;
  }
  .servers-grid {
    grid-template-columns: 1fr;
  }
  .type-grid,
  .form-grid,
  .host-grid {
    grid-template-columns: 1fr;
  }
  .server-head-actions {
    width: 100%;
  }
  .server-head-info h1 {
    font-size: 21px;
  }
  .nav-link span:not(.nav-icon):not(.nav-badge) {
    display: none;
  }
  .nav-link {
    padding: 8px;
  }
  .brand-name {
    display: none;
  }
  .terminal {
    height: 58vh;
  }
  .prop-row {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 11px 0;
  }
  .prop-value {
    width: 100%;
  }
  .backup-row {
    flex-wrap: wrap;
  }
  .backup-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }
  .modal {
    max-height: 92vh;
    border-radius: 16px;
  }
  .address-main {
    font-size: 15px;
  }
  .auth-card h2 {
    font-size: 23px;
  }
  .hero-features {
    grid-template-columns: 1fr;
  }
  .page-actions {
    width: 100%;
  }
  .page-actions .btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Warning system (варны) ──────────────────────────────────────────── */
.warning-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}

.warning-badge.red {
  color: #ff9b9b;
  background: rgba(255, 119, 119, 0.12);
  border-color: rgba(255, 119, 119, 0.35);
}

.warning-badge.verbal {
  color: var(--yellow);
  background: rgba(245, 196, 81, 0.1);
  border-color: rgba(245, 196, 81, 0.3);
}

.warning-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.warning-row {
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--yellow);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
}

.warning-row.red {
  border-left-color: var(--red);
}

.warning-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.warning-row-head .btn {
  margin-left: auto;
}

.warning-reason {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.warning-row .hint {
  font-size: 11px;
}

/* -- �������������� ����� �������: ��� ��������� ----------------------- */
.tab-perm-group {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.perm-label {
  font-size: 13px;
  color: var(--text);
}

.tri-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.tri-opt {
  display: block;
  cursor: pointer;
  position: relative;
}

.tri-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.tri-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 30px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: var(--muted-2);
  border-right: 1px solid var(--line);
  transition: background 0.15s ease, color 0.15s ease;
}

.tri-opt:last-child .tri-mark {
  border-right: 0;
}

.tri-opt:hover .tri-mark {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.tri-opt input:checked + .tri-mark.deny {
  background: rgba(255, 119, 119, 0.18);
  color: #ff8a8a;
}

.tri-opt input:checked + .tri-mark.inherit {
  background: rgba(149, 172, 160, 0.18);
  color: var(--text);
}

.tri-opt input:checked + .tri-mark.allow {
  background: rgba(62, 224, 138, 0.18);
  color: #4ef09c;
}

.tri-opt input:focus-visible + .tri-mark {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.tri-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 8px 0 12px;
  font-size: 12px;
  color: var(--muted);
}

.tri-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tri-legend .tri-mark {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.tri-legend .tri-mark.deny { background: rgba(255, 119, 119, 0.16); color: #ff8a8a; }
.tri-legend .tri-mark.inherit { background: rgba(149, 172, 160, 0.16); color: var(--text); }
.tri-legend .tri-mark.allow { background: rgba(62, 224, 138, 0.16); color: #4ef09c; }

/* -- �������� ����������� (������-������) ------------------------------- */
.presence-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  flex: 0 0 auto;
  background: #ff5c5c;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.45);
}

.presence-dot.active { background: #3ee08a; box-shadow: 0 0 6px rgba(62, 224, 138, 0.55); }
.presence-dot.away { background: #f0c24b; box-shadow: 0 0 6px rgba(240, 194, 75, 0.5); }
.presence-dot.offline { background: #ff5c5c; box-shadow: none; }

/* -- Свежие темы форума на дашборде ------------------------------------ */
.recent-thread {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.recent-thread:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
}

.recent-thread-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-2, #0d1411);
}

.recent-thread-avatar-ph {
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
}

.recent-thread-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.recent-thread-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-thread-meta {
  font-size: 10.5px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-thread-arrow {
  flex: 0 0 auto;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.recent-thread:hover .recent-thread-arrow { opacity: 1; color: var(--green); }

.community-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

.community-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.community-stats .icon { color: var(--green); opacity: 0.8; }
