/* ============================================================
   Noyrexeon dashboard — modern design system
   ============================================================ */
:root {
  --bg:        #06070b;
  --bg-2:      #0b0e15;
  --card:      #10141d;
  --card-2:    #161c28;
  --card-hover:#1a2233;
  --border:    rgba(90,150,255,.10);
  --border-2:  rgba(120,175,255,.20);
  --text:      #eef4ff;
  --muted:     #8fa3c4;
  --muted-2:   #5f708c;
  --accent:    #2b8fff;
  --accent-2:  #12d0ff;
  --accent-grad: linear-gradient(135deg, #0b5cff 0%, #2b9bff 55%, #16d6ff 100%);
  --glow:      rgba(43,143,255,.55);
  --danger:    #ff4d5a;
  --success:   #29d17a;
  --warn:      #f0a020;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 10px 34px rgba(0,0,0,.5);
  --shadow-sm: 0 4px 14px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

/* Subtle, theme-matching scrollbars everywhere (no more bright/white bars). */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(43,143,255,.14), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, rgba(18,208,255,.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:40px}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}

/* ---------- Brand / logo ---------- */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px; letter-spacing: -.02em;
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: #0a1730 url('/img/logo.png') center / cover no-repeat;
  display: grid; place-items: center;
  font-size: 0; color: transparent; /* hide emoji fallback text */
  box-shadow: 0 0 0 1px rgba(120,175,255,.25), 0 4px 18px var(--glow);
}

/* ---------- Top navigation bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6,8,13,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  height: 66px; display: flex; align-items: center; justify-content: space-between;
}
.topbar-nav { display: flex; align-items: center; gap: 6px; }
.topbar-nav a {
  padding: 8px 14px; border-radius: 10px; color: var(--muted);
  font-weight: 600; font-size: 14px; transition: .15s;
}
.topbar-nav a:hover { color: var(--text); background: var(--card); }
.topbar-nav a.active { color: #fff; background: var(--card-2); }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 6px 6px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  cursor: pointer; transition: .15s;
}
.user-chip:hover { background: var(--card-2); }
.user-chip img { width: 32px; height: 32px; border-radius: 50%; }
.user-chip .name { font-weight: 600; font-size: 14px; }
.user-chip .caret { color: var(--muted); font-size: 12px; }

.menu-pop {
  position: absolute; right: 24px; top: 60px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
  min-width: 180px; display: none;
}
.menu-pop.open { display: block; }
.menu-pop a { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 600; font-size: 14px; }
.menu-pop a:hover { background: var(--card-2); }
.menu-pop a.danger { color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 11px 20px; border-radius: 11px; border: none; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 14px; color: #fff;
  background: var(--card-2); transition: .15s; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent-grad); box-shadow: 0 8px 22px rgba(43,143,255,.35); }
.btn-primary:hover { box-shadow: 0 10px 28px rgba(43,143,255,.5); }
.btn-ghost { background: var(--card); border: 1px solid var(--border-2); color: var(--text); }
.btn-ghost:hover { background: var(--card-2); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-discord { background: #2b8fff; }

/* ---------- Alerts ---------- */
.alert {
  padding: 14px 18px; border-radius: 12px; font-weight: 600; margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert-success { background: rgba(34,197,94,.12); color: #7ff2c4; border-color: rgba(34,197,94,.3); }
.alert-danger  { background: rgba(237,66,69,.12); color: #ffb4bb; border-color: rgba(237,66,69,.3); }

/* ============================================================
   LOGIN / LANDING
   ============================================================ */
.hero {
  min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 40px 20px;
}
.hero-card { max-width: 560px; }
.hero .logo-xl {
  width: 120px; height: 120px; border-radius: 28px; margin: 0 auto 26px;
  background: #0a1730 url('/img/logo.png') center / cover no-repeat;
  display: grid; place-items: center;
  font-size: 0; color: transparent;
  box-shadow: 0 0 0 1px rgba(120,175,255,.3), 0 0 70px var(--glow);
}
.hero h1 { font-size: 52px; line-height: 1.05; margin-bottom: 18px; }
.hero h1 .grad {
  background: var(--accent-grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p.lead { font-size: 18px; color: var(--muted); margin-bottom: 32px; }
.hero-feats {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 34px;
}
.hero-feats span {
  padding: 8px 14px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--border); color: var(--muted); font-size: 13px; font-weight: 600;
}

/* ============================================================
   PAGE SHELL
   ============================================================ */
.page-head { padding: 44px 0 8px; }
.page-head h1 { font-size: 32px; margin-bottom: 8px; }
.page-head p { color: var(--muted); font-size: 15px; }
.section { padding: 20px 0 80px; }

/* ---------- Server grid ---------- */
.server-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px;
}
.server-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center; transition: .18s; position: relative; overflow: hidden;
}
.server-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 64px;
  background: var(--accent-grad); opacity: .18;
}
.server-card:hover { transform: translateY(-3px); border-color: var(--border-2); background: var(--card-hover); }
.server-card .icon {
  width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 14px; position: relative;
  border: 4px solid var(--card); background: var(--card-2);
  object-fit: cover; display: block;
}
.server-card .icon-fallback {
  width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 14px; position: relative;
  border: 4px solid var(--card); background: var(--accent-grad);
  display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff;
}
.server-card h3 { font-size: 16px; margin-bottom: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty-state {
  background: var(--card); border: 1px dashed var(--border-2); border-radius: var(--radius);
  padding: 48px; text-align: center;
}
.empty-state .big { font-size: 44px; margin-bottom: 12px; }

/* ---------- Config layout (MEE6-style) ---------- */
.config-wrap { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: start; padding-bottom: 120px; }
.config-nav { position: sticky; top: 90px; }
.config-server {
  display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
}
.config-server img, .config-server .fb {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
}
.config-server .fb { background: var(--accent-grad); display: grid; place-items: center; font-weight: 800; }
.config-server .meta small { color: var(--muted); font-size: 12px; }
.config-server .meta strong { display: block; font-size: 15px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.config-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.config-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px;
  color: var(--muted); font-weight: 600; font-size: 14px; transition: .15s; cursor: pointer;
}
.config-nav a:hover { color: var(--text); background: var(--card); }
.config-nav a.active { color: #fff; background: var(--card-2); }
.config-nav a i { width: 18px; text-align: center; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 18px; }
.back-link:hover { color: var(--text); }

/* ---------- Feature cards ---------- */
.feature {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; margin-bottom: 22px; scroll-margin-top: 90px;
}
/* Tabbed config: show only the active category */
.config-main .feature { display: none; }
.config-main .feature.is-active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.feature-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.feature-head .fico {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  background: var(--card-2); display: grid; place-items: center; font-size: 19px; color: var(--accent-2);
}
.feature-head h2 { font-size: 19px; margin-bottom: 4px; }
.feature-head p { color: var(--muted); font-size: 14px; }

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.field .hint { color: var(--muted-2); font-size: 13px; margin-top: 6px; }
.field code { background: var(--card-2); padding: 2px 7px; border-radius: 6px; font-size: 12px; color: var(--accent-2); }

/* Inputs */
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 11px;
  background: var(--bg-2); border: 1px solid var(--border-2); color: var(--text);
  font-family: inherit; font-size: 14px; transition: .15s; appearance: none;
}
.input:focus, select.input:focus, textarea.input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,143,255,.2);
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239aa1ad' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
textarea.input { resize: vertical; min-height: 70px; }

/* Toggle switch */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer; background: var(--card-2);
  border: 1px solid var(--border-2); border-radius: 999px; transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--accent-grad); border-color: transparent; }
.switch input:checked + .slider::before { transform: translateX(22px); }

/* Segmented control (Text / Image) */
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); transition: .15s; }
.seg input:checked + span { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 12px rgba(43,143,255,.35); }

/* Welcome colour pickers */
.color-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.color-item label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 0 0 6px; }
.color-item input[type=color] {
  width: 100%; height: 42px; border: 1px solid var(--border-2); border-radius: 10px;
  background: var(--bg-2); cursor: pointer; padding: 4px;
}
input[type=range].range { width: 100%; accent-color: var(--accent); height: 6px; }

/* Welcome card live preview */
.welcome-preview {
  width: 100%; max-width: 560px; border-radius: 14px; border: 1px solid var(--border);
  display: block; background: var(--bg-2); aspect-ratio: 1024 / 450; object-fit: cover;
}
.preview-wrap { position: relative; max-width: 560px; }
.preview-wrap .spin {
  position: absolute; inset: 0; display: none; place-items: center; background: rgba(0,0,0,.35); border-radius: 14px;
  color: #fff; font-weight: 600; font-size: 13px;
}
.preview-wrap.loading .spin { display: grid; }

/* Background template gallery */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 8px;
  max-height: 420px; overflow-y: auto; padding: 2px 6px 2px 2px;
}
.gallery-grid::-webkit-scrollbar { width: 8px; }
.gallery-grid::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; }
.gallery-thumb {
  position: relative; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; aspect-ratio: 1024 / 450; background: var(--bg-2);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb:hover { border-color: var(--border-2); }
.gallery-thumb.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,143,255,.3); }
.gallery-thumb.selected::after {
  content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center;
}
.gallery-thumb.gallery-create {
  display: grid; place-items: center; border: 2px dashed var(--border-2); background: var(--card-2);
}
.gallery-thumb.gallery-create:hover { border-color: var(--accent); background: var(--card-hover); }
.gallery-thumb.gallery-create .gc-inner { text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; padding: 4px; line-height: 1.3; }
.gallery-thumb.gallery-create .gc-inner i { display: block; font-size: 22px; margin-bottom: 5px; color: var(--accent-2); }
.gallery-thumb.gallery-folder .gf-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: linear-gradient(180deg, rgba(6,7,11,.30), rgba(6,7,11,.78));
  color: #fff; font-weight: 700; font-size: 13px; text-align: center; padding: 6px; line-height: 1.25;
}
.gallery-thumb.gallery-folder .gf-overlay i { font-size: 22px; margin-bottom: 3px; color: var(--accent-2); }
.gallery-thumb.gallery-folder .gf-overlay span { text-transform: capitalize; }
.gallery-thumb.gallery-folder .gf-overlay em { font-style: normal; font-size: 11px; color: #b9c6de; font-weight: 600; }
.gallery-thumb.gallery-folder:hover .gf-overlay { background: linear-gradient(180deg, rgba(6,7,11,.20), rgba(6,7,11,.68)); }

/* Entry cards (Twitch streams / YouTube feeds) */
.entry-card {
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px;
}
.entry-card .ec-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--card-2); display: grid; place-items: center; color: var(--accent-2); flex: none; }
.entry-card .ec-main { flex: 1; min-width: 0; }
.entry-card .ec-main strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-card .ec-main small { color: var(--muted); font-size: 12px; }
.entry-del {
  flex: none; width: 40px; height: 36px; border: 1px solid var(--border-2); background: var(--card-2);
  color: var(--muted); border-radius: 10px; cursor: pointer; font-size: 18px; line-height: 1;
}
.entry-del:hover { color: var(--danger); border-color: var(--danger); }
.btn-twitch { background: #9146ff; box-shadow: 0 6px 18px rgba(145,70,255,.35); }
.btn-youtube { background: #ff0000; box-shadow: 0 6px 18px rgba(255,0,0,.3); }

/* Discord-style panel preview */
.discord-preview { background: #313338; border-radius: 10px; padding: 16px; max-width: 520px; }
.discord-embed { border-left: 4px solid var(--accent); background: #2b2d31; border-radius: 4px; padding: 12px 16px; }
.discord-embed .de-title { font-weight: 700; color: #fff; margin-bottom: 6px; font-size: 15px; }
.discord-embed .de-desc { white-space: pre-wrap; color: #dbdee1; font-size: 14px; line-height: 1.4; }
.dp-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dp-btn { background: #4e5058; color: #fff; border: none; border-radius: 4px; padding: 8px 14px; font-size: 14px; font-weight: 500; }
.dp-select {
  margin-top: 12px; background: #1e1f22; color: #949ba4; border: 1px solid #232428; border-radius: 4px;
  padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; font-size: 14px;
}

/* Modal dialog */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200;
  display: none; place-items: center; padding: 20px; backdrop-filter: blur(3px);
}
.modal-overlay.open { display: grid; }
.modal {
  background: var(--card); border: 1px solid var(--border-2); border-radius: 16px;
  width: 100%; max-width: 480px; box-shadow: var(--shadow); overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.modal-x { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-body label { display: block; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.modal-body .field-gap { margin-top: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }

/* Sub-category menu (inside a feature, e.g. Security) */
.sec-menu { display: grid; gap: 10px; }
.sec-menu-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; cursor: pointer; transition: .15s;
}
.sec-menu-item:hover { background: var(--card-2); border-color: var(--border-2); transform: translateY(-1px); }
.sec-menu-item .ic {
  width: 44px; height: 44px; border-radius: 12px; background: var(--card-2);
  display: grid; place-items: center; color: var(--accent-2); font-size: 18px; flex: none;
}
.sec-menu-item .txt { flex: 1; min-width: 0; }
.sec-menu-item .txt strong { display: block; font-size: 15px; }
.sec-menu-item .txt small { color: var(--muted); font-size: 13px; }
.sec-menu-item .arrow { color: var(--muted-2); }

.sec-back {
  display: inline-flex; align-items: center; gap: 8px; color: var(--muted);
  font-weight: 600; font-size: 14px; cursor: pointer; margin-bottom: 20px;
}
.sec-back:hover { color: var(--text); }

.subpanel { display: none; }
.subpanel.is-active { display: block; }
.sec-menu.is-hidden { display: none; }

select[multiple].input { min-height: 130px; padding: 8px; background-image: none; }
select[multiple].input option { padding: 6px 8px; border-radius: 6px; }

/* Anti-Nuke protection rows */
.an-row {
  display: flex; align-items: flex-end; gap: 18px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 10px;
}
.an-row .an-name {
  flex: 1; min-width: 0; font-weight: 700; font-size: 14px;
  text-transform: uppercase; letter-spacing: .02em; padding-bottom: 9px;
}
.an-field { display: flex; flex-direction: column; gap: 6px; }
.an-field > label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; text-align: center; margin: 0;
}
.an-field .an-limit { width: 88px; text-align: center; padding: 9px 10px; }
/* Hide the number-input spinner arrows */
.an-limit { -moz-appearance: textfield; appearance: textfield; }
.an-limit::-webkit-outer-spin-button,
.an-limit::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.an-field select.input { min-width: 150px; padding: 9px 32px 9px 12px; font-size: 13px; }

/* Checkmark toggle button */
.an-check { position: relative; cursor: pointer; flex: none; }
.an-check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.an-check-box {
  width: 46px; height: 40px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--border-2);
  display: grid; place-items: center; color: transparent; font-size: 15px; transition: .15s;
}
.an-check input:checked + .an-check-box {
  background: var(--accent); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px var(--glow);
}

@media (max-width: 680px) {
  .an-row { flex-wrap: wrap; align-items: center; }
  .an-row .an-name { flex-basis: 100%; padding-bottom: 0; }
  .an-field { flex: 1; }
  .an-field select.input, .an-field .an-limit { width: 100%; min-width: 0; }
}

/* Command toggle grid */
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 10px; }
.cmd-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px;
}
.cmd-item .cmd-name { font-weight: 600; font-size: 14px; }
.cmd-item .cmd-name b { color: var(--accent-2); }

/* Sticky save bar */
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  transform: translateY(130%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.savebar.show { transform: translateY(0); }
.savebar-inner {
  max-width: 900px; margin: 0 auto 22px; padding: 14px 18px 14px 22px;
  background: var(--card-2); border: 1px solid var(--border-2); border-radius: 14px;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.savebar-inner .txt { font-weight: 600; font-size: 14px; }
.savebar-inner .txt i { color: var(--warn); margin-right: 8px; }
.savebar-actions { display: flex; gap: 10px; }

/* ---------- Overview header ---------- */
/* ---------- Server overview ---------- */
.ov-hero {
  position: relative; border-radius: 18px; overflow: hidden; margin-bottom: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(11,92,255,.28), rgba(22,214,255,.12)), var(--card);
}
.ov-hero.has-banner::before { content: ""; position: absolute; inset: 0; background: var(--ov-banner) center / cover no-repeat; opacity: .5; }
.ov-hero.has-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,7,11,.30), rgba(6,7,11,.86)); }
.ov-hero-inner { position: relative; display: flex; align-items: center; gap: 18px; padding: 22px 24px; flex-wrap: wrap; }
.ov-hero .ov-ic {
  width: 84px; height: 84px; border-radius: 22px; object-fit: cover; flex: none;
  border: 3px solid rgba(255,255,255,.14); box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.ov-hero .ov-ic-fb { display: grid; place-items: center; background: var(--accent-grad); font-size: 34px; font-weight: 800; color: #fff; }
.ov-hero .ov-meta { min-width: 0; }
.ov-hero .ov-meta h2 { font-size: 26px; letter-spacing: -.02em; }
.ov-hero .ov-meta p { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: #c9d6ee; font-size: 14px; font-weight: 600; }
.ov-hero .ov-meta p i { color: var(--accent-2); margin-right: 5px; }
.ov-owner-badge { background: rgba(43,143,255,.18); color: var(--accent-2); border: 1px solid var(--border-2); padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.ov-status { margin-left: auto; display: flex; align-items: center; gap: 12px; background: rgba(6,7,11,.4); border: 1px solid var(--border); border-radius: 14px; padding: 11px 16px; flex: none; }
.ov-status small { display: block; color: var(--muted); font-size: 11px; }
.ov-status strong { display: block; font-size: 13px; margin-top: 1px; }
.ov-status-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(41,209,122,.18), 0 0 10px rgba(41,209,122,.6); flex: none; }

.ov-stats { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1150px) { .ov-stats { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 560px) { .ov-stats { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.ov-stat { display: flex; align-items: center; gap: 13px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 15px 16px; transition: .15s; }
.ov-stat:hover { border-color: var(--border-2); background: var(--card-hover); transform: translateY(-2px); }
.ov-stat .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(43,143,255,.14); color: var(--accent-2); font-size: 17px; flex: none; }
.ov-stat .value { font-size: 23px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.ov-stat .label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }

.ov-two { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1150px) { .ov-two { grid-template-columns: minmax(0,1.12fr) minmax(0,1fr); } }
.ov-panel { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 22px; }
.ov-panel-head { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.ov-panel-head .ov-bar { width: 4px; height: 20px; border-radius: 2px; background: var(--accent-grad); flex: none; }
.ov-panel-head h3 { font-size: 18px; }
.ov-panel-head .ov-action { margin-left: auto; font-size: 12px; padding: 6px 12px; }

.ov-info { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
@media (max-width: 460px) { .ov-info { grid-template-columns: 1fr; } }
.ov-info-tile { display: flex; align-items: center; gap: 13px; background: var(--card-2); border: 1px solid var(--border); border-radius: 13px; padding: 13px 15px; transition: .15s; }
.ov-info-tile:hover { border-color: var(--border-2); }
.ov-info-tile .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(43,143,255,.14); color: var(--accent-2); font-size: 15px; flex: none; }
.ov-info-tile .txt { flex: 1; min-width: 0; }
.ov-info-tile small { display: block; color: var(--muted); font-size: 12px; }
.ov-info-tile strong { display: block; font-size: 14.5px; overflow-wrap: anywhere; }
.ov-copy { background: var(--card); border: 1px solid var(--border); color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; flex: none; transition: .15s; }
.ov-copy:hover { color: var(--text); border-color: var(--border-2); }

.ov-note { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 13px 16px; border-radius: 12px; background: rgba(43,143,255,.07); border: 1px solid var(--border); color: var(--muted); font-size: 13px; line-height: 1.45; }
.ov-note i { color: var(--accent-2); font-size: 17px; flex: none; }

.ov-timeline { display: flex; flex-direction: column; gap: 22px; }
.ov-tl-item { display: flex; gap: 14px; position: relative; align-items: flex-start; }
.ov-tl-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative; z-index: 1; font-size: 15px; }
.ov-tl-ico.green { background: rgba(41,209,122,.15); color: var(--success); }
.ov-tl-ico.blue { background: rgba(43,143,255,.15); color: var(--accent-2); }
.ov-tl-item:not(:last-child) .ov-tl-ico::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: 2px; height: 22px; background: var(--border-2); }
.ov-tl-body { flex: 1; min-width: 0; }
.ov-tl-body strong { display: block; font-size: 14px; }
.ov-tl-body small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.ov-tl-time { color: var(--muted-2); font-size: 12px; white-space: nowrap; flex: none; }

/* ---------- Owner panel ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 16px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; position: relative; overflow: hidden;
}
.stat .ico {
  width: 40px; height: 40px; border-radius: 11px; background: var(--card-2);
  display: grid; place-items: center; color: var(--accent-2); font-size: 17px; margin-bottom: 14px;
}
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.stat .value { font-size: 28px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }

.list-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px;
}
.list-row img, .list-row .fb {
  width: 42px; height: 42px; border-radius: 11px; object-fit: cover; flex: none;
}
.list-row .fb { background: var(--accent-grad); display: grid; place-items: center; font-weight: 800; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .grow small { color: var(--muted); font-size: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--card-2); color: var(--muted);
}
.badge.on { background: rgba(34,197,94,.15); color: #7ff2c4; }
.badge.off { background: rgba(237,66,69,.15); color: #ffb4bb; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn-danger { background: var(--danger); }

.owner-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: rgba(18,208,255,.15); color: #9fe8ff; font-size: 12px; font-weight: 700; margin-bottom: 18px;
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted-2); font-size: 13px; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .config-wrap { grid-template-columns: 1fr; }
  .config-nav { position: static; }
  .config-nav ul { flex-direction: row; flex-wrap: wrap; }
  .hero h1 { font-size: 40px; }
  .topbar-nav { display: none; }
}
