:root {
  --bg: #0a0b0e;
  --bg-2: #0f1115;
  --panel: #13151a;
  --panel-2: #191c22;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .12);
  --text: #eceef2;
  --muted: #8b909c;
  --faint: #5d626d;
  --accent: #ff8a3d;
  --accent-soft: rgba(255, 138, 61, .12);
  --ok: #3ddc97;
  --bad: #ff5d6c;
  --info: #5aa9ff;
  --radius: 14px;
  --sidebar: 264px;
  --display: 'Sora', 'Segoe UI', sans-serif;
  --body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  font: 14.5px/1.6 var(--body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 138, 61, .09), transparent 60%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 70%);
  z-index: 0;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; }
h1 { font-size: 26px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 18px; }
.muted { color: var(--muted); font-size: 13px; }
code { font-family: var(--mono); font-size: 12.5px; color: #c9ccd4; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 16px; padding: 0 8px; }
.brand small { display: block; font: 500 11px var(--body); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; margin-top: 34px; flex: 1; }
.nav-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 0 12px 10px; }
.sidebar nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  transition: color .15s, background .15s;
}
.sidebar nav a:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.sidebar nav a.current { color: var(--text); background: var(--accent-soft); }
.sidebar nav a.current .icon { color: var(--accent); }
.sidebar nav a.current::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.profile { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-strong); font: 600 13px var(--display); color: var(--accent); }
.profile-text { flex: 1; min-width: 0; line-height: 1.3; }
.profile-text strong { display: block; font-size: 13px; font-weight: 600; }
.profile-text small { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); transition: .15s; }
.icon-btn:hover { color: var(--bad); background: rgba(255, 93, 108, .1); }

.shell { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.app .shell { margin-left: var(--sidebar); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 11, 14, .75);
  backdrop-filter: blur(14px);
}
.crumbs { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.crumbs strong { color: var(--text); font-weight: 500; }
.crumbs .sep { color: var(--faint); }
.status-pill { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }

main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 34px 36px 48px; flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 28px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: #1a0d03;
  font: 600 13.5px var(--body);
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
  box-shadow: 0 6px 18px -8px rgba(255, 138, 61, .7), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(255, 138, 61, .8), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn:active { transform: none; }
.btn .icon { width: 16px; height: 16px; }
.btn.ghost { background: var(--panel-2); border-color: var(--line-strong); color: var(--text); box-shadow: none; }
.btn.ghost:hover { border-color: rgba(255, 255, 255, .22); background: #1e2128; }
.btn.danger { background: transparent; border-color: rgba(255, 93, 108, .35); color: var(--bad); box-shadow: none; }
.btn.danger:hover { background: rgba(255, 93, 108, .12); }
.btn.small { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; height: 46px; }
.btn:disabled { opacity: .4; pointer-events: none; }

.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 40%), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
  animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel-head h2 { margin: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 20px 24px 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
}
.stat:nth-child(2) { animation-delay: .05s; }
.stat:nth-child(3) { animation-delay: .1s; }
.stat:nth-child(4) { animation-delay: .15s; }
.stat:nth-child(5) { animation-delay: .2s; }
.stat::after { content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--tone, var(--accent)) 0, transparent 70%); opacity: .12; }
.stat .stat-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; margin-bottom: 18px; color: var(--tone, var(--accent)); background: color-mix(in srgb, var(--tone, var(--accent)) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 25%, transparent); }
.stat strong { display: block; font: 600 30px/1.1 var(--display); letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.ok { --tone: var(--ok); }
.stat.bad { --tone: var(--bad); }
.stat.info { --tone: var(--info); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 7px; letter-spacing: .01em; }
input, select {
  width: 100%;
  height: 42px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 10px;
  padding: 0 13px;
  font: 14px var(--body);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { opacity: .55; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; align-items: end; }
.field { margin-bottom: 16px; }

.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search input { width: 280px; padding-left: 38px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); background: rgba(255, 255, 255, .015); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
tbody tr:last-child td { border-bottom: 0; }
.panel.flush table { margin-top: 18px; }
.panel.flush th:first-child, .panel.flush td:first-child { padding-left: 24px; }
.panel.flush th:last-child, .panel.flush td:last-child { padding-right: 24px; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.actions { display: flex; gap: 6px; }
.actions form, .inline-form { margin: 0; }
.inline-form { display: flex; gap: 6px; align-items: center; }
td input, td select { height: 34px; font-size: 13px; padding: 0 10px; border-radius: 8px; }
td select { width: 170px; }
td input[type="date"] { width: 140px; }
.inline-form input:not([type="date"]) { width: 170px; }

.key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 12.5px var(--mono);
  letter-spacing: .03em;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px dashed var(--line-strong);
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  transition: .15s;
}
.key .icon { width: 14px; height: 14px; color: var(--faint); }
.key:hover { border-color: var(--accent); }
.key.copied { border-color: var(--ok); color: var(--ok); border-style: solid; }
.key.copied .icon { color: var(--ok); }
.key.large { font-size: 16px; padding: 12px 16px; border-radius: 10px; }

.badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.on { color: var(--ok); background: rgba(61, 220, 151, .08); border-color: rgba(61, 220, 151, .22); }
.badge.off { color: var(--bad); background: rgba(255, 93, 108, .08); border-color: rgba(255, 93, 108, .22); }
.badge.warn { color: #f5b945; background: rgba(245, 185, 69, .08); border-color: rgba(245, 185, 69, .25); }
.badge.wait { color: var(--info); background: rgba(90, 169, 255, .08); border-color: rgba(90, 169, 255, .22); }
.server-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.server-head h3 { margin: 0 !important; }
.server-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.server-actions form { margin: 0; }
.announce-form { display: flex; gap: 10px; margin: 12px 0 6px; }
.announce-form .btn { height: 42px; }
.tag { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 6px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.tab { height: 36px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 600 13px var(--body); cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent-soft); color: var(--accent); }

.alert { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 11px; margin-bottom: 22px; border: 1px solid; font-weight: 500; animation: rise .3s both; }
.alert.success { background: rgba(61, 220, 151, .07); border-color: rgba(61, 220, 151, .25); color: var(--ok); }
.alert.error { background: rgba(255, 93, 108, .07); border-color: rgba(255, 93, 108, .25); color: var(--bad); }

.empty { text-align: center; color: var(--muted); padding: 48px 24px !important; }
.empty .icon { width: 30px; height: 30px; color: var(--faint); display: block; margin: 0 auto 10px; }

.license-card { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.license-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.license-title h2 { margin: 0; font-size: 19px; }
.license-meta { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 22px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.license-meta div { padding: 14px 16px; border-right: 1px solid var(--line); background: var(--bg-2); }
.license-meta div:last-child { border-right: 0; }
.license-meta span { display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.license-meta span .icon { width: 13px; height: 13px; }
.license-meta strong { font-weight: 500; font-size: 14px; }
.subsection { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.subsection h3 { font-size: 13px; color: var(--muted); font-weight: 500; margin: 0 0 6px; font-family: var(--body); }

.footer { text-align: center; color: var(--faint); font-size: 12px; padding: 22px; border-top: 1px solid var(--line); }

.public-bar { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; max-width: 1240px; margin: 0 auto; padding: 22px 36px; }
.public .shell { min-height: auto; }
.hero { text-align: center; padding: 90px 0 70px; animation: rise .6s both; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); padding: 6px 14px; border: 1px solid rgba(255, 138, 61, .3); border-radius: 99px; background: var(--accent-soft); margin-bottom: 26px; }
.hero h1 { font-size: clamp(36px, 5.5vw, 62px); line-height: 1.05; font-weight: 700; letter-spacing: -.04em; max-width: 820px; margin: 0 auto 20px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); font-size: 17px; max-width: 580px; margin: 0 auto 34px; }
.hero .btn { height: 48px; padding: 0 26px; font-size: 15px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.feature .stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; margin-bottom: 18px; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(255, 138, 61, .25); }
.feature h3 { margin: 0 0 8px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); }
.features .panel:nth-child(2) { animation-delay: .08s; }
.features .panel:nth-child(3) { animation-delay: .16s; }

.auth { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 980px; margin: 40px auto; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--panel); animation: rise .5s both; }
.auth-side { position: relative; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; background: radial-gradient(600px 400px at 0% 100%, rgba(255, 138, 61, .22), transparent 60%), linear-gradient(160deg, #17191f, #0e0f13); border-right: 1px solid var(--line); }
.auth-side h2 { font-size: 30px; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 12px; }
.auth-side p { color: var(--muted); margin: 0; }
.auth-points { display: grid; gap: 12px; }
.auth-points div { display: flex; align-items: center; gap: 10px; color: #c9ccd4; font-size: 14px; }
.auth-points .icon { color: var(--accent); }
.auth-form { padding: 44px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h1 { margin-bottom: 6px; }
.auth-form .muted { margin: 0 0 28px; }

@media (max-width: 980px) {
  .sidebar { position: static; width: auto; flex-direction: row; align-items: center; padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .sidebar nav { flex-direction: row; margin: 0; overflow-x: auto; order: 3; width: 100%; }
  .nav-label, .profile-text, .brand small, .sidebar nav a.current::before { display: none; }
  .profile { margin-left: auto; padding: 6px; }
  .app .shell { margin-left: 0; }
  .topbar, main { padding-left: 18px; padding-right: 18px; }
  .license-meta { grid-template-columns: repeat(2, 1fr); }
  .license-card, .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .search input { width: 100%; }
}

.theme-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.preview-box { position: relative; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: #fff; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted); border-radius: 99px; padding: 6px 14px; font: 500 12.5px var(--body); cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.current { color: var(--accent); border-color: rgba(255, 138, 61, .4); background: var(--accent-soft); }
.role-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.role-row:last-child { border-bottom: 0; }
.swatch { position: relative; width: 38px; height: 38px; margin: 0; border-radius: 10px; border: 2px solid var(--line-strong); cursor: pointer; flex-shrink: 0; }
.swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.role-text { flex: 1; min-width: 0; line-height: 1.35; }
.role-text strong { display: block; font-size: 14px; }
.slider { margin-top: 18px; }
.slider-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.slider input { height: auto; padding: 0; accent-color: var(--accent); border: 0; background: none; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.module-card { display: block; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); color: var(--text); transition: border-color .15s, transform .15s; }
.module-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.module-card strong { display: block; font-family: var(--display); margin-bottom: 4px; }
.module-card .dots { display: flex; gap: 5px; margin-top: 12px; }
.module-card .dots .dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-strong); }
.module-card.all { border-style: dashed; }
@media (max-width: 1100px) { .theme-layout { grid-template-columns: 1fr; } }

[hidden] { display: none !important; }
.preview-box:fullscreen { border-radius: 0; border: 0; }
#roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 28px; }
#roles .role-row:last-child { border-bottom: 1px solid var(--line); }
#sliders { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 28px; }
.btn.discord { background: #5865f2; color: #fff; box-shadow: none; }
.admin-login { margin-top: 26px; }
.admin-login summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 16px; }
