:root {
  --bg-0: #07090f;
  --bg-1: #0e121d;
  --bg-glass: rgba(15, 19, 31, 0.76);
  --bg-glass-strong: rgba(20, 25, 40, 0.88);
  --bg-2: #151a2a;
  --bg-3: #1c2337;
  --bg-hover: #252e47;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --highlight-top: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --text-0: #f4f6fc;
  --text-1: #b4bfd8;
  --text-2: #77839e;
  --accent: #5865f2;
  --accent-2: #8b5cf6;
  --accent-hover: #4752c4;
  --accent-soft: rgba(88, 101, 242, 0.16);
  --green: #23c567;
  --green-soft: rgba(35, 197, 103, 0.15);
  --yellow: #f5b938;
  --yellow-soft: rgba(245, 185, 56, 0.15);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.15);
  --cyan: #06b6d4;
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.28);
  --font: 'Plus Jakarta Sans', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

* {
  box-sizing: border-box;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

.hidden {
  display: none !important;
}

code {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: #cdd8ff;
}

/* ================= AMBIENT BACKGROUND ================= */
.ambient-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.26;
  animation: floatOrb 22s ease-in-out infinite alternate;
}

.orb-1 {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, #5865f2, transparent 70%);
}

.orb-2 {
  width: 460px;
  height: 460px;
  bottom: -160px;
  right: -100px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  animation-delay: -7s;
}

.orb-3 {
  width: 380px;
  height: 380px;
  top: 40%;
  left: 52%;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
  opacity: 0.16;
  animation-delay: -13s;
}

@keyframes floatOrb {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(35px, -28px) scale(1.08); }
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s ease;
  color: var(--text-0);
  background: var(--bg-3);
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--bg-hover);
  transform: translateY(-1px);
}

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

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

.btn-primary {
  background: linear-gradient(135deg, #5865f2, #6f5cf6);
  color: #fff;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.32), var(--highlight-top);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #6470f8, #7b68fb);
  box-shadow: 0 8px 26px rgba(88, 101, 242, 0.45), var(--highlight-top);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-success {
  background: linear-gradient(135deg, #1ea958, #23c567);
  color: #fff;
  box-shadow: 0 6px 18px rgba(35, 197, 103, 0.26);
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #22b961, #2ad471);
}

.btn-danger {
  background: var(--red-soft);
  border-color: rgba(239, 68, 68, 0.34);
  color: #ff9494;
}

.btn-danger:hover:not(:disabled) {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.btn-ghost {
  background: transparent;
  color: var(--text-1);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.065);
  color: var(--text-0);
}

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

.btn-lg {
  padding: 11px 18px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-1);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.icon-btn:hover {
  background: var(--bg-3);
  color: var(--text-0);
  border-color: var(--border-strong);
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  transition: all 0.15s;
}

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

.danger-text {
  color: #ff8e91 !important;
}

/* ================= LOGIN ================= */
.login-screen {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(22px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px 34px;
  box-shadow: var(--shadow), var(--highlight-top);
  animation: fadeUp 0.32s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #5865f2, #8b5cf6 60%, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 10px 26px rgba(88, 101, 242, 0.42), var(--highlight-top);
}

.brand-badge.sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.login-brand h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.login-brand p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-2);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.input-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-ico {
  position: absolute;
  left: 12px;
  color: var(--text-2);
  display: inline-flex;
  pointer-events: none;
}

.input-icon-wrap input {
  padding-left: 38px;
  padding-right: 38px;
}

.input-action-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  display: inline-flex;
}

.input-action-btn:hover {
  color: var(--text-0);
  background: rgba(255, 255, 255, 0.07);
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  background: rgba(7, 9, 15, 0.72);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-0);
  font-family: inherit;
  font-size: 13.5px;
  padding: 9.5px 12px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: rgba(7, 9, 15, 0.92);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.22);
}

select option {
  background: var(--bg-1);
  color: var(--text-0);
}

.help-text {
  font-size: 12px;
  color: var(--text-2);
}

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger {
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ffb4b4;
}

.alert-info {
  background: var(--accent-soft);
  border: 1px solid rgba(88, 101, 242, 0.35);
  color: #cbd2ff;
}

.btn-discord {
  background: linear-gradient(135deg, #5865f2, #4752c4);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.38), var(--highlight-top);
}

.btn-discord:hover:not(.disabled) {
  background: linear-gradient(135deg, #6571f7, #525ed4);
  box-shadow: 0 10px 30px rgba(88, 101, 242, 0.52), var(--highlight-top);
}

.btn-discord.disabled {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(0.2);
}

.discord-logo-svg {
  flex-shrink: 0;
}

.login-access-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  background: rgba(88, 101, 242, 0.1);
  border: 1px solid rgba(88, 101, 242, 0.28);
}

.login-access-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(88, 101, 242, 0.2);
  color: #b7c0ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-access-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 2px;
}

.login-access-desc {
  font-size: 12.2px;
  color: var(--text-1);
  line-height: 1.45;
}

.login-setup-box {
  background: rgba(245, 185, 56, 0.1);
  border: 1px solid rgba(245, 185, 56, 0.32);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: #ffe3a3;
}

.login-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.login-setup-title {
  font-weight: 700;
  font-size: 13px;
  color: #ffd67a;
}

.portal-link {
  color: #93c5fd !important;
  text-decoration: none;
}

.inline-link {
  color: #93c5fd;
  text-decoration: underline;
}

.login-setup-box p {
  margin: 0 0 10px;
  line-height: 1.5;
}

.login-guild-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guild-picker-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  font-size: 12.5px;
}

.guild-picker-user img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.guild-picker-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-0);
}

.guild-picker-sub {
  margin: -4px 0 4px;
  font-size: 12px;
  color: var(--text-2);
}

.guild-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.guild-pick-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-0);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s ease;
}

.guild-pick-btn:hover:not(:disabled) {
  background: rgba(88, 101, 242, 0.18);
  border-color: rgba(88, 101, 242, 0.55);
  transform: translateY(-1px);
}

.guild-pick-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: linear-gradient(135deg, #5865f2, #8b5cf6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.guild-pick-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.guild-pick-name {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guild-pick-meta {
  font-size: 11.5px;
  color: var(--text-2);
}

.redirect-copy-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.redirect-copy-label {
  font-size: 11.5px;
  color: var(--text-2);
  font-weight: 600;
}

.redirect-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.redirect-copy-row code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 9px;
}

.auth-roles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.auth-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.auth-role-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-0);
}

.auth-role-chip.selected {
  background: rgba(88, 101, 242, 0.22);
  border-color: rgba(88, 101, 242, 0.65);
  color: #fff;
}

.auth-role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.login-footnote {
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-2);
  text-align: center;
}

/* ================= APP SHELL ================= */
.app-shell {
  position: relative;
  z-index: 10;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  z-index: 35;
}

.sidebar {
  width: 288px;
  flex-shrink: 0;
  background: rgba(11, 14, 23, 0.86);
  backdrop-filter: blur(22px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.sidebar-top {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.brand-title {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
}

.guild-banner {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.14), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(88, 101, 242, 0.26);
  border-radius: 11px;
}

.guild-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg-3);
  flex-shrink: 0;
}

.guild-banner-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.guild-name {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guild-meta {
  font-size: 11px;
  color: var(--text-1);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(35, 197, 103, 0.2);
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 8px 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: var(--text-2);
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8.5px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-1);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  margin-bottom: 4px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-0);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.22), rgba(88, 101, 242, 0.08));
  border-color: rgba(88, 101, 242, 0.38);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--highlight-top);
}

.nav-svg {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item.active .nav-svg {
  background: var(--accent);
  color: #fff;
}

.nav-bot-avatar-wrap {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.nav-bot-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: var(--bg-3);
  border: 1px solid var(--border);
}

.nav-bot-status-ring {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #0b0e17;
}

.nav-bot-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.nav-sub {
  font-size: 10.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dot-online { background: var(--green); box-shadow: 0 0 8px rgba(35, 197, 103, 0.8); }
.dot-stopped { background: var(--red); }
.dot-errored { background: var(--yellow); }
.dot-unknown { background: #596580; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* ================= MAIN ================= */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  height: 58px;
  flex-shrink: 0;
  background: rgba(11, 14, 23, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.breadcrumb {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-pill.online {
  background: var(--green-soft);
  border-color: rgba(35, 197, 103, 0.3);
  color: #6df5a6;
}
.status-pill.stopped {
  background: var(--red-soft);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ff9999;
}
.status-pill.warn {
  background: var(--yellow-soft);
  border-color: rgba(245, 185, 56, 0.3);
  color: #ffd67a;
}
.status-pill.neutral {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  color: var(--text-1);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px 4px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-0);
}

.user-pill-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-3);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-pill-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.22);
  border: 1px solid rgba(88, 101, 242, 0.42);
  color: #c8d0ff;
}

.banner-warning {
  background: linear-gradient(90deg, rgba(245, 185, 56, 0.16), rgba(245, 185, 56, 0.08));
  border-bottom: 1px solid rgba(245, 185, 56, 0.3);
  color: #ffe29a;
  padding: 9px 24px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 110px;
}

/* ================= OVERVIEW HERO & KPI ================= */
.overview-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.18), rgba(15, 19, 31, 0.85) 55%, rgba(6, 182, 212, 0.14));
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--shadow-sm), var(--highlight-top);
}

.overview-hero-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.overview-guild-img {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.overview-guild-fallback {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #5865f2, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.overview-hero h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.overview-hero p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-1);
}

.overview-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 17px 18px;
  box-shadow: var(--highlight-top);
  transition: transform 0.16s, border-color 0.16s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
}

.stat-value {
  margin-top: 8px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-0);
}

.stat-bar {
  margin-top: 10px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

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

/* ================= BOT CARDS ================= */
.bot-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(335px, 1fr));
  gap: 16px;
}

.bot-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm), var(--highlight-top);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.bot-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--card-accent, #5865f2), transparent 85%);
  opacity: 0.9;
}

.bot-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.42), var(--highlight-top);
}

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

.bot-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.bot-avatar-shell {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.bot-avatar {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.bot-avatar-status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2.5px solid #0f131f;
}

.bot-card-title h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.bot-folder-name {
  font-size: 11.5px;
  color: var(--text-2);
  font-family: var(--mono);
  margin-top: 1px;
}

.bot-card-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-1);
  min-height: 38px;
}

.bot-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(7, 9, 15, 0.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.metric-item span {
  display: block;
  font-size: 10.5px;
  color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.metric-item strong {
  font-size: 13px;
  color: var(--text-0);
}

.mini-gauge {
  margin-top: 4px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.mini-gauge-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--card-accent, var(--accent));
}

.bot-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.empty-state {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 44px 26px;
  text-align: center;
  max-width: 600px;
  margin: 30px auto;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  color: var(--text-1);
  margin: 0 0 18px;
}

/* ================= BOT DETAIL HERO & TABS ================= */
.bot-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--bot-accent, #5865f2) 20%, rgba(15, 19, 31, 0.9)),
    rgba(15, 19, 31, 0.84) 65%
  );
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm), var(--highlight-top);
}

.bot-hero-left {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.bot-hero-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  letter-spacing: -0.3px;
}

.bot-hero-meta {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-1);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(7, 9, 15, 0.5);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 12px;
}

.bot-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

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

.tab-btn.active {
  color: #fff;
  background: color-mix(in srgb, var(--bot-accent, #5865f2) 24%, rgba(255, 255, 255, 0.06));
  border-color: color-mix(in srgb, var(--bot-accent, #5865f2) 55%, transparent);
  box-shadow: var(--highlight-top);
}

/* ================= VISUAL ENV EDITOR ================= */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}

.search-box input {
  padding-left: 38px;
}

.search-box .search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  display: inline-flex;
  pointer-events: none;
}

.group-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.group-pill {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-1);
  border-radius: 999px;
  padding: 5.5px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.group-pill:hover {
  background: var(--bg-3);
  color: var(--text-0);
}

.group-pill.active {
  background: var(--bot-accent, var(--accent));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--bot-accent, #5865f2) 45%, transparent);
}

.field-group-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--highlight-top);
}

.field-group-header {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-group-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bot-accent, var(--accent));
}

.field-group-count {
  font-size: 11.5px;
  color: var(--text-2);
  font-weight: 600;
}

.field-list {
  display: flex;
  flex-direction: column;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(290px, 1.4fr);
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.14s;
}

.field-row:hover {
  background: rgba(255, 255, 255, 0.018);
}

.field-row:last-child {
  border-bottom: none;
}

.field-row.modified {
  background: rgba(88, 101, 242, 0.085);
  box-shadow: inset 3px 0 0 var(--accent);
}

.field-meta-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-0);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.field-key-code {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
}

.field-comment {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-2);
}

.req-star {
  color: var(--red);
}

/* ================= ROLE / CHANNEL / EMOJI PICKER FIELD ================= */
.picker-field {
  background: rgba(7, 9, 15, 0.72);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  min-height: 42px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.picker-field:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.14);
}

.picker-placeholder {
  color: var(--text-2);
  font-size: 13px;
  padding: 2px 5px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 3.5px 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-0);
  max-width: 100%;
}

.chip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip-remove {
  background: none;
  border: none;
  color: var(--text-1);
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}

.chip-remove:hover {
  opacity: 1;
  color: #fff;
}

.emoji-preview-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
}

.picker-add-tag {
  margin-left: auto;
  font-size: 12px;
  color: #8f9bff;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(88, 101, 242, 0.12);
}

/* POPOVER */
.picker-popover {
  position: fixed;
  z-index: 200;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: rgba(18, 23, 37, 0.96);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popIn 0.14s ease-out;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.popover-head {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popover-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
}

.popover-cat {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-2);
  padding: 9px 9px 4px;
}

.popover-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7.5px 10px;
  border: none;
  background: transparent;
  color: var(--text-0);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  transition: background 0.12s;
}

.popover-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.popover-option.selected {
  background: var(--accent-soft);
}

.popover-option .opt-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popover-option .opt-check {
  color: var(--green);
  font-weight: 800;
}

.popover-foot {
  padding: 9px 10px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
  background: rgba(7, 9, 15, 0.6);
}

.popover-foot input {
  padding: 6px 9px;
  font-size: 12px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 6px;
  padding: 8px;
}

.emoji-btn {
  height: 40px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.12s;
}

.emoji-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: scale(1.06);
}

.emoji-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* TOGGLE SWITCH */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.switch input {
  display: none;
}

.switch-track {
  width: 46px;
  height: 25px;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  position: relative;
  transition: background 0.16s, border-color 0.16s;
}

.switch-track::after {
  content: '';
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.16s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.switch input:checked + .switch-track {
  background: var(--green);
  border-color: var(--green);
}

.switch input:checked + .switch-track::after {
  transform: translateX(21px);
}

.switch-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

/* SECRET FIELD */
.secret-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

/* ================= RAW EDITOR & LOGS & BACKUPS ================= */
.raw-editor-card,
.logs-card,
.backups-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--highlight-top);
}

.raw-textarea {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  min-height: 450px;
  resize: vertical;
  tab-size: 2;
}

.terminal-box {
  background: #05070c;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #d7e2fa;
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.terminal-box.err {
  color: #ffb2b5;
}

.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 9px;
  background: rgba(7, 9, 15, 0.55);
}

/* ================= FLOATING SAVE BAR ================= */
.save-bar {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 23, 38, 0.94);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(88, 101, 242, 0.55);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.62), var(--highlight-top);
  border-radius: 15px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  animation: fadeUp 0.2s ease;
}

.save-bar-info {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13.5px;
  font-weight: 600;
}

.save-bar-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  margin-top: 1px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(245, 185, 56, 0.22);
  flex-shrink: 0;
}

.save-bar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ================= MODALS ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.72);
  backdrop-filter: blur(6px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(22px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), var(--highlight-top);
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  animation: popIn 0.16s ease;
}

.modal-card.modal-lg {
  max-width: 660px;
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.modal-header p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-2);
}

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

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
}

.checkbox-row input {
  width: auto;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

.section-subhead h3 {
  margin: 0;
  font-size: 14px;
}

.section-subhead p {
  margin: 3px 0 12px;
  font-size: 12px;
  color: var(--text-2);
}

.pm2-mapping-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pm2-map-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  align-items: center;
  background: rgba(7, 9, 15, 0.55);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
}

/* ================= SKELETON ================= */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 10px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================= TOAST ================= */
.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 390px;
}

.toast {
  background: rgba(18, 23, 38, 0.95);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  color: var(--text-0);
  padding: 11px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.2s ease-out;
}

.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--yellow); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ================= RESPONSIVE ================= */
.mobile-only {
  display: none;
}

@media (max-width: 920px) {
  .mobile-only {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .field-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .save-bar {
    flex-direction: column;
    align-items: stretch;
    width: calc(100vw - 24px);
    gap: 12px;
  }
  .page-container {
    padding: 16px 14px 130px;
  }
}


/* ================= STOREFRONT & CUSTOMER PORTAL ================= */
.btn-reset {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.store-shell,
.portal-shell {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.store-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 10, 18, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.store-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.store-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text-0);
}

.store-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.store-links a {
  color: var(--text-1);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.store-links a:hover {
  color: var(--text-0);
}

.store-nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

.store-alert-wrap {
  max-width: 1200px;
  width: 100%;
  margin: 16px auto 0;
  padding: 0 24px;
}

.store-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

/* HERO */
.hero-section {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 44px;
  align-items: center;
  padding: 28px 0 64px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.14);
  border: 1px solid rgba(88, 101, 242, 0.34);
  color: #cbd2ff;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 18px;
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(32px, 4.4vw, 48px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.9px;
}

.gradient-text {
  background: linear-gradient(135deg, #818cf8, #60a5fa 45%, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 0 26px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-1);
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}

.hero-actions a {
  text-decoration: none;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.hero-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-metric strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-0);
}

.hero-metric span {
  font-size: 12px;
  color: var(--text-2);
}

/* HERO VISUAL MOCKUP */
.hero-mock-card {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(22px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow), var(--highlight-top);
}

.mock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.mock-dots {
  display: flex;
  gap: 6px;
}

.mock-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.mock-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-1);
}

.mock-bot-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mock-bot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
}

.mock-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.mock-bot-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mock-bot-info strong {
  font-size: 13.5px;
}

.mock-bot-info span {
  font-size: 11.5px;
  color: var(--text-2);
}

.mock-ping {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #6df5a6;
  background: var(--green-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

.mock-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-2);
}

.mock-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: #c8d0ff;
  background: rgba(88, 101, 242, 0.2);
  padding: 2px 8px;
  border-radius: 6px;
}

/* SECTIONS */
.store-section {
  padding: 56px 0;
  scroll-margin-top: 76px;
}

.section-heading {
  text-align: center;
  max-width: 660px;
  margin: 0 auto 36px;
}

.section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #a5b4fc;
  background: rgba(88, 101, 242, 0.14);
  border: 1px solid rgba(88, 101, 242, 0.3);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-heading p {
  margin: 0;
  color: var(--text-1);
  font-size: 14.5px;
}

/* BOT CARDS */
.store-bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.store-bot-card {
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.18s ease, border-color 0.18s ease;
  box-shadow: var(--highlight-top);
}

.store-bot-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.store-bot-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-bot-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.store-bot-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.store-bot-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.store-bot-tagline {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-1);
}

.store-bot-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-1);
}

.store-bot-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.store-bot-list li::before {
  content: '✓';
  color: #6df5a6;
  font-weight: 800;
  flex-shrink: 0;
}

/* PRICING */
.store-packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.package-card {
  position: relative;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-sm), var(--highlight-top);
}

.package-card.popular {
  background: linear-gradient(180deg, rgba(88, 101, 242, 0.16), rgba(15, 19, 31, 0.92) 48%);
  border-color: rgba(88, 101, 242, 0.55);
  box-shadow: 0 18px 46px rgba(88, 101, 242, 0.22), var(--highlight-top);
}

.package-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-1);
}

.package-card.popular .package-badge {
  background: linear-gradient(135deg, #5865f2, #8b5cf6);
  color: #fff;
}

.package-name {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
}

.package-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.package-price strong {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
}

.package-price span {
  font-size: 14px;
  color: var(--text-2);
}

.package-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-1);
}

.package-bots-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.package-bot-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-1);
}

.package-features {
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
  font-size: 13px;
  color: var(--text-1);
}

.package-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.package-features li::before {
  content: '✓';
  color: #6df5a6;
  font-weight: 800;
}

/* FEATURES & FAQ */
.store-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.store-feature-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}

.feature-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(88, 101, 242, 0.16);
  border: 1px solid rgba(88, 101, 242, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.store-feature-card h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
}

.store-feature-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-1);
}

.faq-list {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::after {
  content: '+';
  font-size: 18px;
  color: var(--text-2);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--text-1);
}

.store-footer {
  border-top: 1px solid var(--border);
  background: rgba(8, 10, 18, 0.7);
}

.store-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.store-footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.store-footer-links a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.store-footer-links a:hover {
  color: var(--text-0);
}

/* CUSTOMER PORTAL */
.portal-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 10px;
}

.portal-tab {
  background: transparent;
  border: none;
  color: var(--text-1);
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.portal-tab.active {
  background: var(--accent);
  color: #fff;
}

.portal-main {
  flex: 1;
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 72px;
}

.portal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.portal-header h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
}

.portal-header p {
  margin: 0;
  color: var(--text-1);
  font-size: 13.5px;
}

.portal-guilds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.portal-guild-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.portal-guild-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-guild-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  object-fit: cover;
  background: linear-gradient(135deg, #5865f2, #8b5cf6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

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

.portal-guild-meta strong {
  display: block;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-guild-meta span {
  font-size: 12px;
  color: var(--text-2);
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.order-card-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}

.order-id-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.order-note-box {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.04);
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.order-admin-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-admin-controls select {
  width: auto;
  min-width: 140px;
  padding: 7px 10px;
}

.empty-card {
  background: var(--bg-glass);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 36px 24px;
  text-align: center;
  color: var(--text-1);
}

@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 16px 0 36px;
  }
  .store-links {
    display: none;
  }
  .portal-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .store-nav-inner {
    flex-wrap: wrap;
  }
}


/* ================= SIGNATURE DISCORD RIGHT SERVER RAIL ================= */
.store-shell {
  padding-right: 74px;
}

.store-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.channel-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
}

.channel-hash {
  color: #818cf8;
  font-weight: 800;
}

.discord-rail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 74px;
  z-index: 60;
  background: rgba(9, 11, 19, 0.92);
  backdrop-filter: blur(22px);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 18px;
  gap: 10px;
}

.rail-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.rail-bottom {
  margin-top: auto;
}

.rail-sep {
  width: 32px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.rail-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-1);
  cursor: pointer;
}

.rail-pill {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 4px;
  height: 8px;
  border-radius: 5px 0 0 5px;
  background: #ffffff;
  transition: height 0.22s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s ease, background-color 0.2s ease;
}

.rail-item:hover .rail-pill {
  height: 22px;
  transform: translateY(-50%) scaleY(1);
}

.rail-item.active .rail-pill {
  height: 38px;
  transform: translateY(-50%) scaleY(1);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.65);
}

.rail-orb {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  transition:
    border-radius 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.22s ease,
    transform 0.18s ease;
}

.rail-item:hover .rail-orb,
.rail-item.active .rail-orb {
  border-radius: 16px;
  background: var(--rail-accent, #5865f2);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--rail-accent, #5865f2) 42%, transparent);
}

.rail-item:active .rail-orb {
  transform: translateY(1px);
}

.rail-orb-brand {
  background: linear-gradient(135deg, #5865f2, #8b5cf6 60%, #06b6d4);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.rail-orb-discord {
  background: rgba(88, 101, 242, 0.2);
  border-color: rgba(88, 101, 242, 0.45);
  color: #c7d2fe;
}

.rail-badge {
  position: absolute;
  left: -3px;
  bottom: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  border: 2.5px solid #090b13;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.rail-badge-pro {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  font-size: 8.5px;
  letter-spacing: 0.3px;
  padding: 0 5px;
}

/* RICH HOVER POPOUT CARD (OPENS TO THE LEFT FROM RIGHT RAIL) */
.rail-popout {
  position: absolute;
  right: 72px;
  top: 50%;
  transform: translateY(-50%) translateX(8px) scale(0.96);
  width: 238px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(14, 18, 30, 0.96);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.62), var(--highlight-top);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.16s;
  z-index: 90;
}

.rail-popout::before {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 11px;
  height: 11px;
  background: rgba(14, 18, 30, 0.96);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.rail-item:hover .rail-popout,
.rail-item:focus-visible .rail-popout {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0) scale(1);
}

.rail-popout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.rail-popout-head strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-0);
}

.rail-popout-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.22);
  color: #c7d2fe;
}

.rail-popout p {
  margin: 0;
  font-size: 11.8px;
  line-height: 1.45;
  color: var(--text-1);
}

.rail-popout-emojis {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  letter-spacing: 3px;
}

.rail-popout-prices {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.rail-popout-prices span {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1);
}

.rail-popout-prices span.accent {
  background: rgba(88, 101, 242, 0.28);
  color: #fff;
}

/* MOBILE: FLOATING BOTTOM DISCORD DOCK */
@media (max-width: 768px) {
  .store-shell {
    padding-right: 0;
    padding-bottom: 84px;
  }

  .channel-indicator {
    display: none;
  }

  .discord-rail {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    height: 64px;
    flex-direction: row;
    justify-content: space-around;
    padding: 0 10px;
    border-left: none;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  }

  .rail-group {
    flex-direction: row;
    width: auto;
    gap: 8px;
  }

  .rail-bottom {
    margin-top: 0;
  }

  .rail-sep {
    width: 1px;
    height: 26px;
  }

  .rail-item {
    width: auto;
  }

  .rail-orb {
    width: 42px;
    height: 42px;
  }

  .rail-pill {
    right: auto;
    left: 50%;
    top: auto;
    bottom: -10px;
    transform: translateX(-50%) scaleX(0);
    width: 22px;
    height: 3.5px;
    border-radius: 4px 4px 0 0;
  }

  .rail-item.active .rail-pill,
  .rail-item:hover .rail-pill {
    height: 3.5px;
    transform: translateX(-50%) scaleX(1);
  }

  .rail-popout {
    display: none;
  }
}


/* ================= CUSTOMER GUILD BOT MANAGER ================= */
.manage-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.manage-guild-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.manage-workspace {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 18px;
  align-items: start;
}

.manage-bot-rail {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.manage-rail-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.9px;
  color: var(--text-2);
  padding: 4px 8px 8px;
}

.manage-bot-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-1);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.manage-bot-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-0);
}

.manage-bot-item.active {
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.22), rgba(88, 101, 242, 0.08));
  border-color: rgba(88, 101, 242, 0.42);
  color: #fff;
}

.manage-bot-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.manage-bot-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.manage-bot-text strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manage-bot-text span {
  font-size: 11px;
  color: var(--text-2);
}

.manage-editor-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.manage-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.manage-group-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.manage-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.manage-field-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.manage-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.manage-field-head label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-0);
}

.manage-field-group {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.manage-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.manage-switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

@media (max-width: 860px) {
  .manage-workspace {
    grid-template-columns: 1fr;
  }
}


/* ================= COMPACT SEARCHABLE MULTI-PICKER ================= */
.compact-picker {
  position: relative;
  width: 100%;
}

.compact-picker-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  background: rgba(7, 9, 15, 0.72);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.compact-picker-box:hover,
.compact-picker-box:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

.compact-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.compact-placeholder {
  font-size: 13px;
  color: var(--text-2);
  padding: 2px 2px;
}

.compact-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.22);
  border: 1px solid rgba(88, 101, 242, 0.45);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  max-width: 210px;
}

.compact-chip > span:nth-last-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-chip-rm {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 1px;
  display: inline-flex;
  align-items: center;
}

.compact-chip-rm:hover {
  color: #ff8e91;
}

.compact-picker-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.compact-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.28);
  color: #cbd2ff;
}

.compact-arrow {
  color: var(--text-2);
  font-size: 12px;
}

.compact-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 80;
  background: #101423;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.compact-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.compact-picker-search {
  padding: 7px 10px !important;
  font-size: 12.5px !important;
}

.compact-picker-list {
  max-height: 230px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.compact-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-1);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.compact-opt:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-0);
}

.compact-opt.selected {
  background: rgba(88, 101, 242, 0.2);
  color: #fff;
  font-weight: 600;
}

.compact-opt-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.compact-opt.selected .compact-opt-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.compact-opt-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
