:root {
  --bg-dark: #0b0d14;
  --bg-card: #141724;
  --bg-card-hover: #1a1e2f;
  --bg-input: #1a1e2f;
  --border-color: #252a3d;
  --border-focus: #5865F2;
  
  --primary: #5865F2;
  --primary-hover: #4752c4;
  --accent: #00d2ff;
  --success: #23A55A;
  --danger: #F23F43;
  --warning: #FEE75C;
  
  --text-main: #f2f3f5;
  --text-muted: #949ba4;
  --text-dim: #6d737f;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 20px rgba(88, 101, 242, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* NAVBAR */
.navbar {
  height: 70px;
  background: rgba(20, 23, 36, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

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

.brand-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #5865F2, #00d2ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

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

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.8px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(35, 165, 90, 0.12);
  border: 1px solid rgba(35, 165, 90, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.guild-select-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: #252b42;
  border-color: #38405e;
}

.btn-accent {
  background: linear-gradient(135deg, #5865F2, #00d2ff);
  color: #fff;
}
.btn-accent:hover {
  box-shadow: 0 4px 16px rgba(0, 210, 255, 0.4);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
}

/* LAYOUT */
.layout-container {
  display: flex;
  flex: 1;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: #10131d;
  border-right: 1px solid var(--border-color);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.sidebar-group-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  padding: 12px 14px 4px;
}

.sidebar-group-label:first-of-type {
  padding-top: 4px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.nav-item .icon {
  font-size: 18px;
}

.nav-item:hover {
  background: rgba(88, 101, 242, 0.08);
  color: #fff;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.35);
}

.sidebar-footer {
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.tech-badge {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

/* CONTENT AREA */
.content-area {
  flex: 1;
  padding: 32px 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

.tab-pane.active {
  display: block;
}

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

/* HERO CARD */
.hero-card {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.15), rgba(0, 210, 255, 0.08));
  border: 1px solid rgba(88, 101, 242, 0.3);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(88, 101, 242, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.hero-card h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #5865F2, #00d2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-card p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 600px;
  margin-bottom: 22px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 12px;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: #38405e;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.purple { background: rgba(88, 101, 242, 0.15); color: #5865F2; }
.stat-icon.blue { background: rgba(0, 210, 255, 0.15); color: #00d2ff; }
.stat-icon.green { background: rgba(35, 165, 90, 0.15); color: #23A55A; }
.stat-icon.orange { background: rgba(254, 231, 92, 0.15); color: #FEE75C; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

/* CARD COMPONENT */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.card-header {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h2 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 5px;
}

.card-header p {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.header-with-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.header-with-toggle > div:first-child {
  flex: 1;
  min-width: 0;
}

.highlight {
  color: var(--accent);
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.form-row {
  display: flex;
  gap: 16px;
  align-items: flex-start !important;
}

.form-row:has(label) > .btn,
.form-row:has(label) > button {
  margin-top: 24px;
}

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

.styled-select, .styled-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.styled-select:focus, .styled-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

/* TOGGLE SWITCH */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  min-width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2c3247;
  transition: .3s;
  border-radius: 34px;
  overflow: hidden;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--success);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.switch-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.switch-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* CHECKBOX GRID */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.category-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-pill:hover {
  background: #252b42;
  border-color: #3b4468;
}

.category-pill input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* GRID 2 COLUMNS */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

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

.toggle-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.toggle-info p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* INFO BOX */
.info-box {
  background: rgba(88, 101, 242, 0.08);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 14px;
}

.info-box.green-border {
  border-left-color: var(--success);
  background: rgba(35, 165, 90, 0.08);
}

.info-box h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.info-box p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.clean-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.clean-list strong {
  color: var(--text-main);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}
.badge.ready {
  background: rgba(35, 165, 90, 0.2);
  color: var(--success);
}
.badge.missing {
  background: rgba(242, 63, 67, 0.2);
  color: var(--danger);
}

/* BAD WORDS TAGS */
.tags-input-container {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 32px;
}

.tag-badge {
  background: rgba(242, 63, 67, 0.15);
  border: 1px solid rgba(242, 63, 67, 0.3);
  color: #ff7675;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tag-badge button {
  background: none;
  border: none;
  color: #ff7675;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

.tags-add-row {
  display: flex;
  gap: 10px;
}

/* ACTION BAR */
.action-bar {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
}

.mt-20 { margin-top: 20px; }

/* GLOBAL SAVE FOOTER */
.save-footer {
  position: sticky;
  bottom: 20px;
  background: rgba(20, 23, 36, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin-top: 30px;
}

.save-footer span {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* TOAST NOTIFICATION */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: #1c2133;
  color: #fff;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease forwards;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

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

/* RESPONSIVE */
@media (max-width: 900px) {
  .layout-container { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); }
  .form-row { flex-direction: column; align-items: stretch; }
  .grid-2 { grid-template-columns: 1fr; }
  .content-area { padding: 20px; }
  .save-footer { flex-direction: column; gap: 12px; text-align: center; }
}

/* ========================================================
   AUTHENTICATION OVERLAY & LOGIN SCREEN
   ======================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, #141724 0%, #0b0d14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s ease forwards;
}

.login-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, #5865F2, #00d2ff);
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 10px 25px rgba(88, 101, 242, 0.4);
}

.login-box h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 10px;
  color: #fff;
}

.login-box p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 28px;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-discord {
  background: #5865F2;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4);
}
.btn-discord:hover {
  background: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

.btn-owner {
  background: linear-gradient(135deg, #FEE75C, #ff9f43);
  color: #1a1600;
  font-weight: 800;
}
.btn-owner:hover {
  box-shadow: 0 4px 16px rgba(254, 231, 92, 0.4);
  transform: translateY(-1px);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  margin: 10px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}
.divider span {
  padding: 0 10px;
}

.demo-buttons-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* USER PROFILE BADGE IN NAVBAR */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name-label {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
}

.btn-icon-only {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.btn-icon-only:hover {
  background: rgba(242, 63, 67, 0.2);
}

/* INVITE BANNER */
.invite-banner {
  background: linear-gradient(135deg, rgba(254, 231, 92, 0.12), rgba(242, 63, 67, 0.08));
  border: 1px solid rgba(254, 231, 92, 0.4);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.invite-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.invite-icon {
  font-size: 36px;
}

.invite-banner h3 {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.invite-banner p {
  font-size: 13px;
  color: var(--text-muted);
}

/* OWNER TAB BUTTON */
.owner-tab-btn {
  background: linear-gradient(135deg, rgba(254, 231, 92, 0.15), rgba(255, 159, 67, 0.15)) !important;
  border: 1px solid rgba(254, 231, 92, 0.35) !important;
  color: #FEE75C !important;
  font-weight: 800 !important;
  box-shadow: 0 0 14px rgba(254, 231, 92, 0.2);
}

.owner-tab-btn:hover {
  background: linear-gradient(135deg, rgba(254, 231, 92, 0.25), rgba(255, 159, 67, 0.25)) !important;
  transform: translateY(-1px);
}

.admin-hero {
  border-color: rgba(254, 231, 92, 0.4) !important;
  background: linear-gradient(135deg, rgba(254, 231, 92, 0.12), rgba(255, 159, 67, 0.06)) !important;
}

.owner-health, .owner-billing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0 22px;
}
.owner-health-item, .owner-billing-stat {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(18, 23, 39, .76);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.owner-health-item span, .owner-billing-stat span, .owner-guild-results { color: var(--text-muted); font-size: 12px; }
.owner-health-item strong { font-size: 15px; }
.owner-billing-stat strong { font-size: 27px; line-height: 1; color: #c3b5ff; }
.owner-billing-card { border-color: rgba(150, 137, 255, .28); }
.owner-billing-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.owner-billing-grid { margin: 0; padding: 0 20px 16px; }
.owner-billing-note { margin: 0; padding: 0 20px 20px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.owner-guild-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.owner-guild-tools input { flex: 2 1 230px; }
.owner-guild-tools select { flex: 1 1 180px; }
.owner-guild-results { margin-left: auto; white-space: nowrap; }
.owner-plan-badge { display: inline-block; border-radius: 999px; padding: 5px 9px; background: rgba(116, 128, 157, .2); color: #b9c3d9; font-size: 12px; font-weight: 800; white-space: nowrap; }
.owner-plan-badge.paid { background: rgba(129, 102, 255, .24); color: #c8baff; }
.owner-plan-badge.trial { background: rgba(76, 180, 234, .18); color: #86dafa; }
.owner-plan-badge.free { background: rgba(87, 203, 142, .16); color: #84dcb0; }
.owner-plan-badge.expired { background: rgba(255, 151, 96, .17); color: #ffba8e; }
.owner-plan-badge.legacy { background: rgba(255, 214, 98, .16); color: #ffe296; }
.owner-plan-badge.unknown { background: rgba(241, 107, 110, .16); color: #ffb1b3; }
.owner-server-cell { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.owner-server-cell img { width: 30px; height: 30px; border-radius: 9px; }
.owner-server-cell small { display: block; color: var(--text-muted); font-size: 11px; font-weight: 500; }
.owner-modules { max-width: 270px; min-width: 180px; color: var(--text-muted); font-size: 12px; font-weight: 500; line-height: 1.5; }

/* TEXTAREA */
.styled-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  resize: vertical;
  transition: all 0.2s ease;
  line-height: 1.5;
}
.styled-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

/* TABLE */
.table-responsive {
  overflow-x: auto;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.styled-table th {
  background: #10131d;
  color: var(--text-muted);
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.styled-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 600;
}

.styled-table tr:hover td {
  background: rgba(88, 101, 242, 0.04);
}

/* RAFFLES & DATA TABLE STYLES */
.flex-2 {
  flex: 2;
}

.raffle-create-box {
  background: rgba(22, 27, 46, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  margin-top: 8px;
}

.data-table th {
  background: #10131d;
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 500;
}

.data-table tr:hover td {
  background: rgba(88, 101, 242, 0.05);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-danger {
  background: #ED4245;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: #c03537;
  transform: translateY(-1px);
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

/* =========================================================
   ROLE PICKER, WINDOW STYLES, THEMES & DISCORD EMBED PREVIEWS
   ========================================================= */

/* ROLES PICKER */
.roles-picker-wrapper {
  background: rgba(16, 19, 29, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.roles-search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.roles-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.25);
}

.roles-picker-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1e2235;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.role-pill:hover {
  background: #282d45;
  transform: translateY(-1px);
  border-color: rgba(88, 101, 242, 0.5);
}

.role-pill.selected {
  background: rgba(88, 101, 242, 0.25);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(88, 101, 242, 0.35);
}

.role-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.role-pill .role-check {
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.role-pill.selected .role-check {
  opacity: 1;
}

/* WINDOW STYLES GRID */
.window-styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.style-card {
  background: rgba(20, 23, 36, 0.85);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.style-card:hover {
  background: #1c2136;
  border-color: rgba(88, 101, 242, 0.6);
  transform: translateY(-2px);
}

.style-card.selected {
  border-color: #00d2ff;
  background: linear-gradient(145deg, rgba(20, 23, 36, 0.95), rgba(0, 210, 255, 0.08));
  box-shadow: 0 0 18px rgba(0, 210, 255, 0.25);
}

.style-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.style-card-icon {
  font-size: 26px;
}

.style-card-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.style-card.selected .style-card-badge {
  background: rgba(0, 210, 255, 0.2);
  color: #00d2ff;
}

.style-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.style-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.style-card-radio {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.style-card.selected .style-card-radio {
  border-color: #00d2ff;
  background: #00d2ff;
}

.style-card.selected .style-card-radio::after {
  content: '✓';
  font-size: 11px;
  color: #0b0d14;
  font-weight: 900;
}

/* THEME PALETTE GRID */
.embed-brand-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 26px 0;
}

.embed-color-input { display: flex; align-items: center; gap: 10px; }
.embed-color-input input[type="color"] {
  width: 48px; height: 44px; flex: 0 0 48px; padding: 4px;
  border-radius: 8px; border: 1px solid var(--border-color);
  background: var(--bg-card); cursor: pointer;
}
.embed-brand-fields small { display: block; margin-top: 7px; color: var(--text-muted); }
.embed-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr); gap: 24px; align-items: start; }
.embed-editor-controls { min-width: 0; }
.embed-editor-controls > .form-group { margin-bottom: 18px; }
.embed-editor-controls .form-group small { display: block; margin-top: 7px; color: var(--text-muted); line-height: 1.45; }
.embed-editor-controls .embed-brand-fields { grid-template-columns: 1fr; margin: 22px 0; gap: 14px; }
.embed-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 16px 0 24px; }
.embed-option-grid label { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-card); font-size: 13px; line-height: 1.4; cursor: pointer; }
.embed-option-grid input { flex: 0 0 auto; margin: 2px 0 0; accent-color: #5865f2; }
.embed-design-preview {
  margin: 0; padding: 20px; border: 1px solid var(--border-color);
  border-radius: 12px; background: #232428; position: sticky; top: 18px; min-width: 0;
}
.embed-preview-label { color: #b9bbbe; font-size: 12px; }
.embed-message-head { display: flex; align-items: center; gap: 9px; margin-top: 18px; color: #b69bff; font-size: 13px; }
.embed-message-head small { color: #adb0b9; font-size: 11px; }
.embed-message-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(145deg, #ac85fa, #49258c); color: #fff; font-size: 11px; font-weight: 800; flex: 0 0 auto; }
.embed-design-card {
  margin: 10px 0 0 41px; padding: 16px; border-left: 4px solid #5865f2;
  border-radius: 4px; background: #2b2d31; max-width: 550px; min-width: 0;
}
.embed-design-card strong { color: #f2f3f5; }
.embed-design-card p { margin: 8px 0 14px; color: #dbdee1; line-height: 1.5; font-size: 13px; }
.embed-design-card small { color: #a9aaaf; }
.embed-preview-author { color: #baa5f9; font-size: 11px; letter-spacing: .05em; margin-bottom: 7px; font-weight: 700; }
.embed-preview-image { display: flex; align-items: flex-end; padding: 18px; height: 135px; border-radius: 5px; background: radial-gradient(circle at 75% 80%, #f15b9a, transparent 48%), linear-gradient(135deg, #5334ae, #171b3a); background-position: center; background-size: cover; color: white; font-weight: 900; letter-spacing: .08em; margin: 13px 0; }
.embed-preview-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 0; margin: 10px 0; border-top: 1px solid #484a52; }
.embed-preview-details small, .embed-preview-details strong { display: block; font-size: 11px; }
.embed-preview-details strong { margin-top: 4px; }
.embed-preview-actions { margin: 9px 0 0 41px; }
.embed-preview-actions span { display: inline-block; background: #5865f2; color: white; border-radius: 4px; padding: 8px 12px; font-size: 12px; font-weight: 700; }
.embed-preview-note { color: #aeb2bd; font-size: 11px; line-height: 1.5; margin: 18px 0 0; }
.embed-preview-compact .embed-preview-image { display: none; }
@media (max-width: 980px) { .embed-editor-grid { grid-template-columns: 1fr; } .embed-design-preview { position: static; } }
@media (max-width: 550px) { .embed-option-grid { grid-template-columns: 1fr; } .embed-design-preview { padding: 14px; } .embed-design-card, .embed-preview-actions { margin-left: 0; } }

.theme-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.theme-pill-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.theme-pill-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.theme-pill-btn.selected {
  border-color: #fff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.25);
}

.theme-pill-color {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.theme-pill-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

/* LIVE DISCORD EMBED PREVIEW */
.preview-box {
  background: #1e1f22;
  border: 1px solid #313338;
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 18px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2b2d31;
}

.preview-header span {
  font-size: 13px;
  font-weight: 700;
  color: #dbdee1;
}

.preview-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(88, 101, 242, 0.2);
  color: #5865F2;
  font-weight: 700;
}

.discord-message-mock {
  display: flex;
  gap: 14px;
  font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.discord-avatar-col {
  flex-shrink: 0;
}

.discord-mock-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5865F2, #00d2ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

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

.discord-author-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.discord-username {
  font-weight: 600;
  font-size: 15px;
  color: #f2f3f5;
}

.discord-bot-badge {
  background: #5865F2;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
}

.discord-timestamp {
  font-size: 12px;
  color: #949ba4;
}

.discord-mock-text {
  font-size: 14px;
  color: #dbdee1;
  margin-bottom: 8px;
  line-height: 1.4;
}

.discord-embed-card {
  background: #2b2d31;
  border-left: 4px solid #5865F2;
  border-radius: 4px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 540px;
}

.discord-embed-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #dbdee1;
}

.discord-embed-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.discord-embed-title a {
  color: #00a8fc;
  text-decoration: none;
}

.discord-embed-desc {
  font-size: 13px;
  color: #dbdee1;
  line-height: 1.5;
  white-space: pre-line;
}

.discord-embed-desc blockquote,
.discord-embed-desc > .quote-block {
  border-left: 4px solid #4e5058;
  padding-left: 10px;
  margin: 4px 0;
  color: #b5bac1;
}

.discord-embed-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.discord-embed-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.discord-field-name {
  font-size: 12px;
  font-weight: 700;
  color: #b5bac1;
}

.discord-field-value {
  font-size: 13px;
  color: #dbdee1;
  word-break: break-word;
}

.discord-embed-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  float: right;
  margin-left: 12px;
  object-fit: cover;
}

.discord-embed-banner {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 4px;
  margin-top: 6px;
}

.discord-embed-footer {
  font-size: 11px;
  color: #949ba4;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.discord-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.discord-mock-btn {
  background: #4e5058;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: default;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.discord-mock-btn.primary {
  background: #5865F2;
}

.discord-mock-btn.success {
  background: #248046;
}

.discord-mock-btn.secondary {
  background: #4e5058;
}
/* News subscriptions are scoped to the selected Discord server. */
.source-help { color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.source-add-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 1fr 1.25fr 1.1fr 1.1fr auto;
  gap: 12px;
  align-items: start;
}
.source-add-grid label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-feed-card-wrap {
  background: rgba(16, 19, 29, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  transition: border-color 0.2s ease;
}
.news-feed-card-wrap:hover {
  border-color: rgba(88, 101, 242, 0.45);
}
.news-feed-row {
  display: grid;
  grid-template-columns: 1.15fr 1.6fr 1fr 1.25fr 1.1fr;
  align-items: start;
  gap: 12px;
}
.news-feed-heading { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.news-feed-heading small { color: var(--text-dim); overflow-wrap: anywhere; }
.news-feed-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-dim); min-width: 0; }
.news-feed-field > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.35px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-feed-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.feed-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}
.feed-active-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #5865F2;
  cursor: pointer;
}

.feed-styles-bar {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feed-styles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.feed-styles-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.feed-style-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.feed-style-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}
.feed-style-choice:hover {
  border-color: rgba(88, 101, 242, 0.55);
  background: rgba(88, 101, 242, 0.08);
}
.feed-style-choice.selected {
  border-color: #5865F2;
  background: rgba(88, 101, 242, 0.18);
  box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.4);
}
.feed-style-choice-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.feed-style-choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.feed-style-choice-text strong {
  font-size: 13px;
  color: #fff;
}
.feed-style-choice-text small {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.3;
}

.feed-custom-editor {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.feed-editor-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  align-items: start;
}
.feed-editor-header {
  margin-bottom: 12px;
}
.feed-editor-header h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #fff;
}
.feed-editor-header p {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}
.feed-editor-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 8px 0 12px;
}
.feed-toggle-chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.feed-editor-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1280px) {
  .source-add-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .source-add-grid .source-add-action { grid-column: 1 / -1; }
  .source-add-grid .source-add-action label { display: none; }
}
@media (max-width: 1000px) {
  .news-feed-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-add-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feed-style-pills { grid-template-columns: 1fr; }
  .feed-editor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .source-add-grid { grid-template-columns: minmax(0, 1fr); }
  .news-feed-row { grid-template-columns: minmax(0, 1fr); }
}

/* SUB-TABS BAR (FiveM Modules) */
.subtabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  margin-bottom: 20px;
}

.subtab-btn {
  flex: 1;
  min-width: 150px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.subtab-btn:hover {
  background: var(--bg-card-hover);
  color: #fff;
}

.subtab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.35);
}

/* ACTION BUTTONS ROW */
.action-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

/* 3-STEP QUICK GUIDE CARDS */
.step-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.step-card {
  background: rgba(26, 30, 47, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.step-badge {
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.18);
  color: #8ea1ff;
}

.step-card strong {
  font-size: 14px;
  color: #fff;
}

.step-card p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* WEBHOOK COPY BOX */
.webhook-copy-box {
  background: rgba(88, 101, 242, 0.08);
  border: 1px solid rgba(88, 101, 242, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.webhook-copy-box label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.webhook-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* SUB-PANELS */
.sub-panel {
  background: rgba(26, 30, 47, 0.55);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.sub-panel.danger-panel {
  background: rgba(237, 66, 69, 0.07);
  border-color: rgba(237, 66, 69, 0.28);
}

.sub-panel.success-panel {
  background: rgba(46, 204, 113, 0.06);
  border-color: rgba(46, 204, 113, 0.28);
}

@media (max-width: 900px) {
  .step-cards-grid {
    grid-template-columns: 1fr;
  }
  .webhook-input-row {
    flex-direction: column;
    align-items: stretch;
  }
}
.fdoc-command-summary { color: #a9b5c7; font-size: 13px; line-height: 1.6; }
.fdoc-command-filter { box-sizing: border-box; width: 100%; max-width: 460px; margin: 0 0 14px; padding: 10px 12px; border: 1px solid #35405a; border-radius: 8px; background: #111827; color: #e2e8f0; font: inherit; }
.fdoc-command-filter:focus-visible { outline: 2px solid #5865f2; outline-offset: 2px; }
.fdoc-command-table-wrap { max-width: 100%; overflow-x: auto; }
.fdoc-command-table { min-width: 650px; }
.fdoc-command-table td:first-child { min-width: 210px; }
.fdoc-command-table code { white-space: normal; overflow-wrap: anywhere; }
.fdoc-command-subrow { background: rgba(88, 101, 242, 0.05); }
.fdoc-command-table tr[hidden] { display: none; }

.premium-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 18px 0 24px; padding: 22px 24px; border: 1px solid rgba(139, 129, 255, .32); border-radius: 16px; background: linear-gradient(120deg, rgba(88, 101, 242, .15), rgba(20, 27, 43, .88)); }
.premium-card h2 { margin: 6px 0; font-size: 1.25rem; }
.premium-card p { margin: 0 0 5px; color: #bcc7dc; line-height: 1.5; }
.premium-card small { color: #a6b4cf; }
.premium-subscription { display: block; margin-top: 7px; }
.premium-card .btn { flex: none; }
.premium-card [hidden] { display: none !important; }
.nav-item.premium-locked { opacity: .62; }
.nav-item.premium-locked::after { content: '🔒 Pro'; margin-left: auto; font-size: .68rem; color: #a99cff; white-space: nowrap; }
@media (max-width: 640px) { .premium-card { align-items: flex-start; flex-direction: column; } }

/* Pro plan entry and details */
#mainApp .pro-nav-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 65px;
  margin: 0 0 14px;
  padding: 10px;
  gap: 9px;
  border: 1px solid rgba(143, 132, 255, .48);
  border-radius: 11px;
  background: linear-gradient(125deg, rgba(88, 101, 242, .25), rgba(27, 34, 51, .96));
  color: #f4f3ff;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
#mainApp .pro-nav-button:hover { border-color: #b4a9ff; background: linear-gradient(125deg, rgba(105, 94, 241, .36), rgba(37, 46, 67, .96)); transform: translateY(-1px); }
.pro-nav-mark { display: grid; place-items: center; width: 31px; height: 31px; flex: none; border-radius: 8px; background: linear-gradient(145deg, #9f8fff, #6557e8); color: #fff; font-size: 19px; }
.pro-nav-copy { display: grid; min-width: 0; gap: 3px; }
.pro-nav-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.pro-nav-copy small { color: #c5c1e7; font-size: 9px; line-height: 1.25; }
.pro-nav-status { margin-left: auto; padding: 4px 6px; border-radius: 5px; background: rgba(155, 143, 255, .18); color: #d8d1ff; font-size: 9px; font-weight: 800; white-space: nowrap; }
.premium-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }

.bot-nickname-card { border-color: rgba(166, 146, 255, .38); background: linear-gradient(125deg, rgba(98, 78, 190, .13), rgba(19, 27, 43, .94)); }
.bot-nickname-card h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.bot-nickname-badge { padding: 4px 8px; border-radius: 999px; background: rgba(169, 145, 255, .18); color: #c5b8ff; font-size: 10px; font-weight: 800; }
.bot-nickname-controls { display: flex; flex-wrap: wrap; gap: 9px; margin: 9px 0; }
.bot-nickname-controls .styled-input { flex: 1 1 260px; min-width: 0; }
.bot-nickname-controls .btn { flex: 0 0 auto; }
.bot-nickname-card small { display: block; color: var(--text-muted); line-height: 1.45; }
@media (max-width: 640px) { .bot-nickname-controls .btn { flex: 1 1 auto; } }

.pro-dialog {
  position: fixed;
  inset: 0;
  width: min(760px, calc(100vw - 28px));
  max-width: none;
  max-height: min(88dvh, 900px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #465176;
  border-radius: 18px;
  background: #111827;
  color: #f2f3f8;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .72);
}
.pro-dialog::backdrop { background: rgba(2, 5, 15, .78); backdrop-filter: blur(5px); }
.pro-dialog-shell { display: flex; flex-direction: column; max-height: min(88dvh, 900px); }
.pro-dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 22px; border-bottom: 1px solid #2b3650; }
.pro-dialog-eyebrow { color: #bcb2ff; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.pro-dialog-close { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid #33405a; border-radius: 8px; background: #1b2436; color: #c9d2e4; cursor: pointer; }
.pro-dialog-close:hover { background: #303b55; color: #fff; }
.pro-dialog-scroll { min-height: 0; overflow-y: auto; padding: 0 22px 22px; scrollbar-color: #536083 #111827; }
.pro-dialog-hero { position: relative; margin: 0 -22px 22px; padding: 25px 22px 24px; background: radial-gradient(circle at 92% 5%, rgba(69, 209, 229, .19), transparent 36%), linear-gradient(130deg, rgba(79, 72, 178, .36), rgba(19, 31, 49, .8)); border-bottom: 1px solid #34405d; }
.pro-dialog-chip { display: inline-block; padding: 5px 9px; border: 1px solid rgba(180, 169, 255, .42); border-radius: 999px; color: #d7d1ff; background: rgba(117, 101, 215, .18); font-size: 10px; font-weight: 800; }
.pro-dialog-hero h2 { max-width: 580px; margin: 13px 0 8px; font-size: clamp(22px, 4vw, 29px); letter-spacing: -.04em; line-height: 1.2; }
.pro-dialog-hero p { max-width: 615px; color: #c2cbdd; font-size: 13px; line-height: 1.55; }
.pro-dialog-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 15px 0 5px; }
.pro-dialog-price strong { font-size: 25px; letter-spacing: -.04em; }
.pro-dialog-price span { color: #c4cadd; font-size: 12px; }
.pro-dialog-hero small { color: #aab6cd; font-size: 10px; line-height: 1.4; }
.pro-dialog-section-title { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.pro-dialog-section-title h3 { font-size: 15px; }
.pro-dialog-section-title span { color: #98a6bf; font-size: 10px; }
.pro-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pro-feature { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 13px; border: 1px solid #303a50; border-radius: 11px; background: #172133; }
.pro-feature > span { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 7px; background: #273451; font-size: 15px; }
.pro-feature strong { display: block; margin: 1px 0 5px; color: #f0f2fc; font-size: 11px; line-height: 1.4; }
.pro-feature p { color: #afbdd3; font-size: 10.5px; line-height: 1.5; }
.pro-dialog-trial-note { display: flex; align-items: flex-start; gap: 11px; margin-top: 14px; padding: 13px; border: 1px solid rgba(82, 193, 169, .35); border-radius: 10px; background: rgba(33, 118, 105, .12); }
.pro-dialog-trial-note > span { font-size: 19px; }
.pro-dialog-trial-note p { color: #c2d4d3; font-size: 11px; line-height: 1.55; }
.pro-dialog-trial-note strong { color: #e1fff4; }
.pro-dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 22px; border-top: 1px solid #34405d; background: #131c2c; }
.pro-dialog-footer > span { max-width: 245px; color: #b9c8df; font-size: 11px; line-height: 1.4; }
.pro-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.pro-dialog-actions .btn { padding: 9px 12px; font-size: 11px; white-space: normal; text-align: center; }
.pro-dialog-actions [hidden] { display: none !important; }
.pro-dialog :is(button, a):focus-visible, #mainApp .pro-nav-button:focus-visible { outline: 2px solid #88dcff; outline-offset: 2px; }
.pro-dialog button:disabled { opacity: .55; cursor: wait; }

/* Give paid access (Emerald Green) and the trial (Golden Amber) separate, readable visual identities. */
#mainApp .premium-card.is-pro {
  border-color: rgba(16, 185, 129, .72);
  background: radial-gradient(circle at 95% 8%, rgba(16, 185, 129, .24), transparent 42%), linear-gradient(120deg, #0d3327, #13222e 75%);
  box-shadow: inset 4px 0 #10b981, 0 12px 32px rgba(16, 185, 129, .14);
}
#mainApp .premium-card.is-pro .section-kicker,
#mainApp .premium-card.is-pro h2 { color: #6ee7b7; }
#mainApp .premium-card.is-pro #premiumSubscription { color: #a7f3d0; font-weight: 600; }
#mainApp .premium-card.is-trial {
  border-color: rgba(245, 181, 76, .68);
  background: radial-gradient(circle at 95% 8%, rgba(245, 181, 76, .22), transparent 40%), linear-gradient(120deg, #332714, #1b2130 75%);
  box-shadow: inset 4px 0 #f59e0b, 0 12px 32px rgba(0, 0, 0, .16);
}
#mainApp .premium-card.is-trial .section-kicker,
#mainApp .premium-card.is-trial h2 { color: #fde68a; }
#mainApp .premium-card.is-trial #premiumDate:not(:empty) {
  display: inline-block;
  margin-top: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(251, 191, 36, .48);
  border-radius: 7px;
  background: rgba(217, 119, 6, .24);
  color: #fef08a;
  font-weight: 750;
}
#mainApp .premium-card.is-trial #premiumTrialButton {
  border-color: #fbbf24;
  background: #f59e0b;
  color: #1f1402;
  font-weight: 800;
}
#mainApp .premium-card.is-trial #premiumTrialButton:hover { background: #fbbf24; }
#mainApp .pro-nav-button {
  border-color: rgba(245, 194, 104, .58);
  background: linear-gradient(125deg, rgba(160, 104, 36, .35), rgba(43, 34, 34, .96));
}
#mainApp .pro-nav-button:hover {
  border-color: #ffd58e;
  background: linear-gradient(125deg, rgba(187, 125, 43, .44), rgba(51, 40, 38, .96));
}
#mainApp .pro-nav-button .pro-nav-mark { background: linear-gradient(145deg, #ffe09b, #d49235); color: #302007; }
#mainApp .pro-nav-button .pro-nav-copy small { color: #e8cb9a; }
#mainApp .pro-nav-button .pro-nav-status { background: rgba(233, 178, 84, .2); color: #ffe0a5; }
#mainApp .pro-nav-button.is-pro {
  border-color: rgba(16, 185, 129, .72);
  background: linear-gradient(125deg, rgba(16, 185, 129, .32), rgba(13, 45, 36, .96));
  box-shadow: 0 0 18px rgba(16, 185, 129, .18);
}
#mainApp .pro-nav-button.is-pro:hover {
  border-color: #34d399;
  background: linear-gradient(125deg, rgba(16, 185, 129, .44), rgba(18, 56, 45, .96));
}
#mainApp .pro-nav-button.is-pro .pro-nav-mark { background: linear-gradient(145deg, #6ee7b7, #10b981); color: #052e16; }
#mainApp .pro-nav-button.is-pro .pro-nav-copy small { color: #a7f3d0; }
#mainApp .pro-nav-button.is-pro .pro-nav-status { background: rgba(16, 185, 129, .28); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, .45); font-weight: 700; }
#mainApp .pro-nav-button.is-trial {
  border-color: rgba(245, 194, 104, .68);
  background: linear-gradient(125deg, rgba(180, 114, 28, .38), rgba(43, 34, 24, .96));
}
#mainApp .pro-nav-button.is-trial .pro-nav-mark { background: linear-gradient(145deg, #fde68a, #d97706); color: #302007; }
#mainApp .pro-nav-button.is-trial .pro-nav-copy small { color: #fde68a; }
#mainApp .pro-nav-button.is-trial .pro-nav-status { background: rgba(245, 158, 11, .25); color: #fde68a; border: 1px solid rgba(251, 191, 36, .45); font-weight: 700; }
.pro-dialog { border-color: #9b7749; }
.pro-dialog.is-pro { border-color: #10b981; }
.pro-dialog.is-pro .pro-dialog-eyebrow { color: #6ee7b7; }
.pro-dialog.is-pro .pro-dialog-hero {
  background: radial-gradient(circle at 92% 5%, rgba(16, 185, 129, .24), transparent 39%), linear-gradient(130deg, rgba(13, 62, 48, .65), rgba(19, 31, 49, .85));
  border-bottom-color: rgba(16, 185, 129, .45);
}
.pro-dialog.is-pro .pro-dialog-chip { border-color: rgba(52, 211, 153, .5); background: rgba(16, 185, 129, .22); color: #a7f3d0; }
.pro-dialog-eyebrow { color: #ffda95; }
.pro-dialog-hero {
  background: radial-gradient(circle at 92% 5%, rgba(245, 184, 82, .22), transparent 39%), linear-gradient(130deg, rgba(104, 71, 45, .58), rgba(19, 31, 49, .82));
  border-bottom-color: #6b543e;
}
.pro-dialog-chip { border-color: rgba(255, 215, 147, .46); background: rgba(174, 116, 49, .2); color: #ffe3b2; }
@media (max-width: 640px) {
  .premium-card-actions { justify-content: flex-start; }
  .pro-dialog, .pro-dialog-shell { max-height: 92dvh; }
  .pro-dialog-top { padding: 12px 16px; }
  .pro-dialog-scroll { padding: 0 16px 16px; }
  .pro-dialog-hero { margin: 0 -16px 18px; padding: 20px 16px; }
  .pro-feature-grid { grid-template-columns: 1fr; }
  .pro-dialog-footer { display: grid; padding: 12px 16px; }
  .pro-dialog-footer > span { max-width: none; }
  .pro-dialog-actions { justify-content: stretch; }
  .pro-dialog-actions .btn { flex: 1; }
}

/* =========================================================
   УНИВЕРСАЛЕН МЕНИДЖЪР НА КАНАЛИ И ПРАВА (Channel Creator & Perms)
   ========================================================= */
.channel-quick-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}
.channel-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid rgba(88, 101, 242, 0.45);
  background: rgba(88, 101, 242, 0.14);
  color: #dbe2ff;
  transition: all 0.18s ease;
  line-height: 1.25;
}
.channel-quick-btn:hover {
  background: rgba(88, 101, 242, 0.28);
  border-color: #7983f5;
  color: #ffffff;
  transform: translateY(-1px);
}
.channel-quick-btn.is-perms {
  border-color: rgba(46, 204, 113, 0.45);
  background: rgba(46, 204, 113, 0.12);
  color: #bbf7d0;
}
.channel-quick-btn.is-perms:hover {
  background: rgba(46, 204, 113, 0.26);
  border-color: #2ecc71;
  color: #ffffff;
}

.cm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 11, 20, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cm-modal-box {
  width: min(820px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(155deg, #151b2b, #0e1320);
  border: 1px solid rgba(114, 137, 218, 0.35);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}
.cm-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(88, 101, 242, 0.08);
}
.cm-modal-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(88, 101, 242, 0.24);
  color: #a5b4fc;
  margin-bottom: 5px;
}
.cm-modal-header h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #ffffff;
}
.cm-modal-header p {
  margin: 0;
  font-size: 13px;
  color: #a6b0cf;
}
.cm-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.cm-modal-close:hover {
  background: rgba(237, 66, 69, 0.25);
  border-color: #ed4245;
  color: #fff;
}
.cm-mode-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 22px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cm-mode-btn {
  flex: 1;
  padding: 9px 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.cm-mode-btn.active {
  background: linear-gradient(135deg, #5865f2, #4752c4);
  border-color: #7983f5;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
}
.cm-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}
.cm-target-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.4);
  color: #d1fae5;
  font-size: 13.5px;
  margin-bottom: 14px;
}
.cm-target-notice strong {
  color: #4ade80;
  font-size: 14px;
}
.cm-section-label {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 8px;
}
.cm-presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.cm-preset-card {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.16s ease;
}
.cm-preset-card:hover {
  border-color: rgba(88, 101, 242, 0.6);
  background: rgba(88, 101, 242, 0.09);
}
.cm-preset-card.active {
  border-color: #5865f2;
  background: rgba(88, 101, 242, 0.18);
  box-shadow: inset 0 0 0 1px #5865f2;
}
.cm-preset-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}
.cm-preset-desc {
  font-size: 12px;
  color: #a6b0cf;
  line-height: 1.4;
}
.cm-perms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.cm-perm-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}
.cm-perm-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: #5865f2;
  flex-shrink: 0;
}
.cm-perm-item strong {
  display: block;
  font-size: 12.8px;
  color: #f1f5f9;
  margin-bottom: 2px;
}
.cm-perm-item span {
  display: block;
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.35;
}
.cm-bot-safe-note {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: 9px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #bfdbfe;
  font-size: 12.2px;
  line-height: 1.45;
}
.cm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
}
@media (max-width: 680px) {
  .cm-presets-grid,
  .cm-perms-grid {
    grid-template-columns: 1fr;
  }
  .cm-mode-tabs {
    flex-direction: column;
  }
}
.health-card { margin: 22px 0; padding: 22px; border: 1px solid rgba(148,163,184,.25); border-radius: 16px; background: rgba(33,39,57,.65); }
.health-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.health-header h2 { margin: 0 0 6px; font-size: 1.15rem; }
.health-header p, #serverHealthSummary { margin: 4px 0 0; opacity: .85; }
.health-results { display: grid; gap: 8px; margin-top: 12px; }
.health-result { padding: 12px; border: 1px solid rgba(148,163,184,.22); border-radius: 10px; }
.health-result strong { display: block; }
.health-result p { margin: 5px 0 0; }
.health-result[data-status="ok"] { border-left: 4px solid #3bbf82; }
.health-result[data-status="warning"] { border-left: 4px solid #e6ad45; }
.health-result[data-status="error"] { border-left: 4px solid #ef6767; }
.starter-kit .health-header { margin-bottom: 20px; }
.starter-kit .health-header p { max-width: 76ch; line-height: 1.5; }
.starter-kit-controls { display: flex; align-items: flex-end; gap: 14px; }
.starter-kit-field { flex: 1; min-width: 0; }
.starter-kit-field label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .35px; }
.starter-kit-field select { min-height: 44px; }
.starter-kit-controls > .btn { flex: 0 0 auto; min-width: 220px; min-height: 44px; }
.starter-kit-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.starter-kit-preview:empty, #starterKitStatus:empty { display: none; }
.starter-kit-preview-group { min-width: 0; padding: 14px 16px; border: 1px solid rgba(148,163,184,.22); border-radius: 12px; background: rgba(10,16,30,.25); }
.starter-kit-preview-group.wide, .starter-kit-note { grid-column: 1 / -1; }
.starter-kit-preview-group strong { display: block; margin-bottom: 10px; font-size: 13px; }
.starter-kit-preview-items { display: flex; flex-wrap: wrap; gap: 7px; }
.starter-kit-preview-items span { max-width: 100%; padding: 5px 9px; border: 1px solid rgba(148,163,184,.25); border-radius: 8px; background: rgba(88,101,242,.12); font-size: 12.5px; overflow-wrap: anywhere; }
.starter-kit-note { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
#starterKitStatus { margin: 14px 0 0; line-height: 1.5; }
@media (max-width: 700px) {
  .starter-kit-controls { flex-direction: column; align-items: stretch; }
  .starter-kit-controls > .btn { width: 100%; }
  .starter-kit-preview { grid-template-columns: minmax(0, 1fr); }
}
.ticket-queue-panel { margin-bottom: 22px; padding: 22px; border: 1px solid rgba(148,163,184,.25); border-radius: 16px; background: rgba(33,39,57,.65); }
.ticket-queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ticket-queue-heading h2 { margin: 0 0 6px; font-size: 1.15rem; }
.ticket-queue-heading p, #ticketQueueSummary, #ticketDutyList { margin: 4px 0 0; opacity: .85; }
.ticket-queue-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ticket-queue-list { display: grid; gap: 10px; margin-top: 14px; }
.ticket-queue-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px; border: 1px solid rgba(148,163,184,.2); border-radius: 10px; }
.ticket-queue-item.needs-attention { border-left: 4px solid #ef6767; }
.ticket-queue-item strong { display: block; }
.ticket-queue-item small { display: block; margin-top: 5px; opacity: .85; }
.community-events-list { display: grid; gap: 12px; margin-top: 18px; }
.community-event-item { padding: 14px; border: 1px solid rgba(148,163,184,.25); border-radius: 12px; background: rgba(33,39,57,.45); }
.community-event-item h3 { margin: 0 0 6px; font-size: 1rem; }
.community-event-item p { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.community-event-item .event-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.game-style-settings { margin-top: 10px; padding-top: 22px; border-top: 1px solid rgba(148,163,184,.2); }
.game-style-settings h3 { margin: 0 0 6px; font-size: 1rem; }
.game-style-settings > p { margin: 0 0 16px; color: var(--text-muted); line-height: 1.5; }
.game-style-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.game-style-choice { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 15px; border: 1px solid rgba(148,163,184,.26); border-radius: 12px; cursor: pointer; background: rgba(16,23,39,.46); }
.game-style-choice:has(input:checked) { border-color: #8474f5; box-shadow: 0 0 0 2px rgba(132,116,245,.2); }
.game-style-choice:focus-within { outline: 2px solid #8474f5; outline-offset: 2px; }
.game-style-choice input { margin: 3px 0 0; accent-color: #8474f5; }
.game-style-choice span { min-width: 0; }
.game-style-choice strong { display: block; margin-bottom: 4px; }
.game-style-choice small { display: block; color: var(--text-muted); line-height: 1.4; }
.game-style-preview { margin-top: 18px; padding: 18px; border: 1px solid rgba(148,163,184,.23); border-radius: 14px; background: rgba(10,16,30,.3); }
.game-style-preview > strong { display: block; margin-bottom: 12px; }
.game-style-preview > p { margin: 12px 0 0; color: var(--text-muted); font-size: 13px; }
.game-style-demo { max-width: 570px; padding: 16px; border-radius: 10px; background: #303338; color: #f2f3f5; }
.game-style-demo-sender { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-size: 14px; font-weight: 700; }
.game-style-demo-sender small { margin-left: 5px; padding: 2px 5px; border-radius: 3px; background: #5865f2; font-size: 10px; }
.game-style-demo-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #5865f2; font-size: 11px; }
.game-style-demo-embed { display: grid; gap: 9px; padding: 14px; border-left: 4px solid #2ed573; border-radius: 4px; background: #232428; }
.game-style-demo-embed[data-style="classic"] { border-color: #00ff88; }
.game-style-demo-embed[data-style="compact"] { border-color: #2ed573; }
.game-style-demo-embed > span { color: #2ed573; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.game-style-demo-embed strong { font-size: 17px; overflow-wrap: anywhere; }
.game-style-demo-embed p { margin: 0; color: #c9cbd1; font-size: 13px; line-height: 1.5; }
.game-style-demo-cover { display: flex; align-items: flex-end; justify-content: space-between; min-height: 105px; padding: 13px; border-radius: 6px; background: linear-gradient(115deg,#121b35,#42368d 56%,#2ebc88); color: #fff; font-size: 18px; font-weight: 800; letter-spacing: .06em; }
.game-style-demo-cover span { font-size: 11px; }
.game-style-demo-details { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; }
.game-style-demo-details strong { font-size: 12px; }
.game-style-demo-button { display: inline-block; margin: 10px 0 0 14px; padding: 8px 13px; border-radius: 4px; background: #5865f2; color: #fff; font-size: 13px; }
.game-style-demo-embed[data-style="compact"] .game-style-demo-cover { width: 95px; min-height: 70px; padding: 8px; font-size: 10px; }
.game-style-demo-embed[data-style="compact"] .game-style-demo-cover span { display: none; }
.game-style-demo-button[hidden], .game-style-demo-embed > span[hidden] { display: none; }
@media (max-width: 760px) { .game-style-options { grid-template-columns: minmax(0, 1fr); } }


.composer-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px; }
#composerForm label {display:block;margin-bottom:14px;line-height:1.6}
#composerForm input:not([type=checkbox]):not([type=color]), #composerForm textarea, #composerForm select {display:block;width:100%;margin-top:5px}
.composer-preview {min-width:0;align-self:start;position:sticky;top:20px;color:#b5bac1;font-size:13px}
.composer-card {background:#2b2d31;border-radius:8px;border-left:4px solid #5865f2;padding:20px;margin:14px 0;overflow-wrap:anywhere;color:#dbdee1;display:flow-root}
.composer-card h3 {color:#f2f3f5;font-size:20px;margin:8px 0}
.composer-card p {white-space:pre-wrap;line-height:1.6}
#previewLogo {float:right;width:80px;height:80px;object-fit:contain;margin:0 0 14px 14px}
#previewImage {display:block;max-width:100%;max-height:300px;object-fit:contain;margin:16px 0}
#previewLogo[hidden],#previewImage[hidden] {display:none}
@media(max-width:850px){.composer-grid{grid-template-columns:1fr}.composer-preview{position:static}}
