:root {
  /* Aetheric Dark Palette - Modern Premium */
  --bg-main: #0e0e10;
  --bg-surface: #0e0e10;
  --bg-surface-low: #131315;
  --bg-surface-main: #19191c;
  --bg-surface-high: #1f1f22;
  --bg-surface-highest: #262528;
  
  --primary: #9fa7ff;
  --primary-dim: #5764f1;
  --accent-gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-dim) 100%);
  
  --on-surface: #f9f5f8;
  --on-surface-variant: #adaaad;
  
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  
  --glass-bg: rgba(25, 25, 28, 0.4);
  --glass-blur: 20px;
  --glass-border: rgba(173, 170, 173, 0.1);
  --glass-glow: 0 8px 32px rgba(87, 100, 241, 0.08);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Legacy variable mapping for compatibility */
  --accent: var(--primary);
  --accent-hover: var(--primary-dim);
  --text-primary: var(--on-surface);
  --text-secondary: var(--on-surface-variant);
  --text-muted: #72767d;
  --bg-secondary: var(--bg-surface-low);
  --bg-card: var(--bg-surface-main);
  --border: var(--glass-border);
  --shadow-md: var(--glass-glow);
}

/* 토글 스위치 스타일 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.toggle-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: var(--radius-full);
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch.active::before {
  transform: translateX(24px);
  background: white;
}

.toggle-switch:hover {
  transform: scale(1.05);
}

.toggle-switch:active {
  transform: scale(0.95);
}

/* 기존 체크박스 숨기기 */
input[type="checkbox"].toggle-input {
  display: none;
}

/* 토글 라벨 스타일 */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.toggle-label:hover {
  color: var(--text-primary);
}

.toggle-text {
  user-select: none;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--on-surface);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(159, 167, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(87, 100, 241, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3, h4, .logo, .section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.04em;
  color: var(--on-surface);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Layout Elements */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 5%;
  background: rgba(15, 17, 26, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav a:hover {
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  gap: 1rem;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  transition: var(--transition);
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: var(--accent);
  color: white;
}

.btn.ghost {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn.ghost:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn.outline {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.btn.outline:hover {
  background: rgba(88, 101, 242, 0.1);
}

/* Main Content */
main {
  padding: 4rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0 6rem;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  display: block;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 3rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

/* Dashboard Styles */
.dashboard-header {
  margin-bottom: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.dashboard-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.dashboard-header p {
  color: var(--text-secondary);
}

.dashboard-content {
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.04em;
  color: var(--on-surface);
}

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Layout Elements */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 5%;
  background: rgba(15, 17, 26, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav a:hover {
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  gap: 1rem;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 1px solid transparent;
  transition: var(--transition);
  font-family: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: var(--accent-gradient);
  color: white;
  border: none;
  box-shadow: 0 8px 24px rgba(87, 100, 241, 0.3);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(87, 100, 241, 0.4);
}

.btn.ghost {
  background: var(--bg-surface-low);
  border-color: var(--glass-border);
  color: var(--on-surface);
}

.btn.ghost:hover {
  background: var(--bg-surface-main);
  border-color: var(--on-surface-variant);
}

.btn.outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn.outline:hover {
  background: rgba(159, 167, 255, 0.1);
}

.btn-lg {
  padding: 1.15rem 2.5rem;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

.pulse-glow {
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(159, 167, 255, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(159, 167, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(159, 167, 255, 0); }
}

/* Main Content */
main {
  padding: 4rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0 6rem;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  display: block;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 3rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

/* Dashboard Styles */
.dashboard-header {
  margin-bottom: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.dashboard-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.dashboard-header p {
  color: var(--on-surface-variant);
}

/* Layouts */
.dashboard-layout, .server-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

.sidebar, .sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 6rem;
}

/* Sidebar Menu & Tab Bar */
.sidebar-menu, .tab-bar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-surface-low);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
}

.tab-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.tab-nav-heading {
  padding: 0.2rem 1rem 0.35rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.menu-item, .tab-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  color: var(--on-surface-variant);
  font-weight: 600;
  transition: var(--transition);
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 0.95rem;
}

.menu-item:hover, .tab-btn:hover {
  background: var(--bg-surface-high);
  color: var(--on-surface);
  transform: translateX(4px);
}

.menu-item.active, .tab-btn.active {
  background: var(--bg-surface-main);
  color: var(--primary);
  box-shadow: inset 2px 0 0 var(--primary);
}

.panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  height: fit-content;
  width: 100%;
  box-shadow: var(--glass-glow);
  transition: var(--transition);
  position: relative; /* Required for .locked-overlay positioning */
  overflow: hidden;   /* Ensure overlay doesn't spill out */
}

.panel:hover {
  background: rgba(25, 25, 28, 0.5);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

.panel-header {
  position: relative;
  z-index: 150; /* Stay above .locked-overlay (z-index 100) */
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel h3, .section-title {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--on-surface);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Server List */
.guild-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.guild-item {
  background: var(--bg-surface-main);
  border: 1px solid rgba(159, 167, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}

.guild-item:hover {
  background: var(--bg-surface-high);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(159, 167, 255, 0.2);
}

.guild-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--bg-surface-highest);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.guild-name {
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
  color: var(--on-surface);
}

.guild-status {
  font-size: 0.9rem;
  color: var(--on-surface-variant);
}

/* Forms & Inputs */
input, select, textarea {
  width: 100%;
  background: var(--bg-surface-low);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  color: var(--on-surface);
  font-family: inherit;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-surface-main);
  box-shadow: 0 0 0 4px rgba(159, 167, 255, 0.1);
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--on-surface-variant);
}

.content-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Utility Classes */
.flex-align-center {
  display: flex;
  align-items: center;
}

.flex-gap-1 { gap: 1rem; }
.flex-gap-1-5 { gap: 1.5rem; }
.flex-gap-2 { gap: 2rem; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(34, 197, 94, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.status-dot.online { background: #22c55e; }

.server-icon-large {
  width: 80px; height: 80px;
  border-radius: var(--radius-lg);
  background: var(--bg-main);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}


.tab-panel {
  display: none;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  animation: fadeIn 0.3s ease-out;
}


/* List Items (Voice, Pins, etc) */
.list-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.list-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.list-item strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.list-item .item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Config Section titles */
.section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.form-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  display: none;
}

.form-status.success {
  display: block;
  background: rgba(59, 165, 92, 0.1);
  color: var(--success);
  border: 1px solid var(--success);
}

.var-chip {
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: monospace;
  line-height: 1.4;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.var-chip:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.helper-text {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Auto Moderation UI */
.automod-card {
  border-color: rgba(88, 101, 242, 0.28);
  box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.08), var(--shadow-sm);
}

.automod-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.automod-rule {
  position: relative;
  overflow: hidden;
}

.automod-rule::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: rgba(88, 101, 242, 0.65);
}

.automod-rule > * {
  position: relative;
}

.automod-subcard {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

/* Multiple select for automod exemption */
select[multiple] {
  min-height: 10rem;
  vertical-align: top;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  padding: 0.5rem;
  color: var(--text);
}

select[multiple] option {
  padding: 0.4rem 0.6rem;
  margin: 0.2rem 0;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

select[multiple] option:hover {
  background: rgba(255, 255, 255, 0.1);
}

select[multiple] option:checked {
  background: rgba(100, 149, 237, 0.3);
  color: #fff;
  font-weight: 600;
}

/* 우측 선택된 항목 목록 */
#automod-exempt-roles-selected,
#automod-exempt-channels-selected {
  min-height: 10rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
}

#automod-exempt-roles-selected .list-item,
#automod-exempt-channels-selected .list-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.4rem;
  padding: 0.6rem 0.75rem;
  transition: all 0.2s;
}

#automod-exempt-roles-selected .list-item:hover,
#automod-exempt-channels-selected .list-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#automod-exempt-roles-selected .list-item .btn.ghost,
#automod-exempt-channels-selected .list-item .btn.ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--danger);
  font-weight: 600;
  transition: all 0.2s;
}

#automod-exempt-roles-selected .list-item .btn.ghost:hover,
#automod-exempt-channels-selected .list-item .btn.ghost:hover {
  background: var(--danger);
  color: #fff;
  transform: scale(1.05);
}
/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.close-modal:hover {
  color: var(--text-primary);
}

/* Emoji Picker Styles */
.emoji-picker-content {
  max-width: 400px;
}

.emoji-picker-tabs {
  display: flex;
  padding: 0.5rem;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
}

.picker-tab {
  flex: 1;
  padding: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.picker-tab.active {
  background: var(--bg-card);
  color: var(--accent);
}

.emoji-search {
  padding: 0.75rem;
}

.emoji-search input {
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
}

.emoji-grid {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 0.5rem;
  min-height: 300px;
}

.emoji-item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.emoji-item:hover {
  background: var(--bg-card-hover);
  transform: scale(1.1);
}

.emoji-item img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.emoji-choice {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

.emoji-choice:hover,
.emoji-choice:focus-visible {
  background: var(--bg-card-hover);
  outline: 2px solid var(--accent);
}

.emoji-choice img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Role/Ticket Option Styles */
.role-option {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* Dashboard List Scroll */
.guild-list-container {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-top: 1rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .dashboard-content {
    grid-template-columns: 1fr;
  }
  
  .dashboard-content aside {
    order: -1;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 1rem 1rem;
  }
  
  .nav {
    display: none; /* Hide top nav on mobile to save space */
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
  
  main {
    padding: 2rem 1rem;
  }

  /* Sidebar to Top Tabs */
  .server-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .sidebar-nav {
    position: sticky;
    top: 56px;
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
    z-index: 50;
    padding: 0.35rem;
    background: rgba(22, 25, 37, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 0;
    margin: -2rem -1rem 0.5rem;
    width: calc(100% + 2rem);
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-nav-group {
    display: contents;
  }

  .tab-nav-heading {
    display: none;
  }

  .tab-btn {
    width: auto;
    padding: 0.5rem 0.75rem;
    flex-shrink: 0;
    font-size: 0.8rem;
    gap: 0.35rem;
  }

  .tab-btn .tab-label {
    display: none;
  }

  .tab-btn.active .tab-label {
    display: inline;
  }
  
  .role-option {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
  }

  /* Stack grids on mobile */
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: repeat"] {
    grid-template-columns: 1fr !important;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Giveaway Variable Button Editor */
.msg-editor-group {
  margin-bottom: 0.25rem;
}

.var-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.var-btn {
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.3);
  color: var(--accent);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.var-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px var(--accent-glow);
}

.var-btn:active {
  transform: scale(0.95);
}

/* Locked Overlay */
.locked-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(15, 17, 26, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-label.feature-toggle {
  position: relative;
  z-index: 6;
}

.locked-overlay[style*="display: none"] {
  display: none !important;
}

.locked-overlay p {
  background: rgba(22, 25, 37, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Variable chips */
.variable-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.variable-chips .chip {
  appearance: none;
  background: rgba(88, 101, 242, 0.1);
  border: 1px solid rgba(88, 101, 242, 0.3);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.variable-chips .chip:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px var(--accent-glow);
}

.variable-chips .btn.primary {
  background: var(--accent-gradient);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(87, 100, 241, 0.3);
}

/* Range Input */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  border: none;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 6px var(--accent-glow);
  transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Small select */
.small-select {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

/* Full width button */
.full-width {
  width: 100%;
}

/* Option group */
.option-group {
  margin-bottom: 0.5rem;
}

.option-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Form help text */
.form-help {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Section title small variant */
.section-title.small {
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

/* Checkbox label */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-secondary);
}


.locked-overlay[style*="display: none"] {
  display: none !important;
}

.locked-overlay p {
  background: rgba(22, 25, 37, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Variable chips */
.variable-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.variable-chips .chip {
  background: rgba(88, 101, 242, 0.1);
  border: 1px solid rgba(88, 101, 242, 0.3);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.variable-chips .chip:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px var(--accent-glow);
}

/* Range Input */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  border: none;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 6px var(--accent-glow);
  transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Small select */
.small-select {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

/* Full width button */
.full-width {
  width: 100%;
}

/* Option group */
.option-group {
  margin-bottom: 0.5rem;
}

.option-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Form help text */
.form-help {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Section title small variant */
.section-title.small {
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

/* Checkbox label */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

/* Additional Layout Classes */
.subtitle-small {
  color: var(--text-secondary);
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

.overview-content {
  padding: 1rem 0;
}

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

.overview-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #fff, var(--text-secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.overview-meta {
  display: flex;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.overview-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.overview-toolbar,
.overview-refresh-group,
.overview-feature-heading,
.overview-card-actions,
.overview-bot-status,
.overview-bot-list,
.overview-bot-item {
  display: flex;
  align-items: center;
}

.overview-toolbar {
  justify-content: space-between;
  gap: 1rem;
}

.overview-toolbar .form-help {
  margin: -0.5rem 0 0;
}

.overview-refresh-group {
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.overview-updated-at {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.overview-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.overview-refresh svg {
  width: 1rem;
  height: 1rem;
}

.overview-bot-status {
  gap: 0.55rem;
  flex-wrap: wrap;
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  background: var(--bg-lighter);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.overview-bot-list {
  gap: 0.45rem 1rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.overview-bot-item {
  gap: 0.35rem;
  white-space: nowrap;
}

.overview-status-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #88909c;
}

.overview-status-dot.ready,
.overview-status-dot.online { background: #3ba55d; }
.overview-status-dot.offline,
.overview-status-dot.error { background: #ed4245; }
.overview-status-dot.needs-setup,
.overview-status-dot.checking,
.overview-status-dot.connecting { background: #faa61a; }

.overview-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.overview-summary-card {
  min-width: 0;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.overview-summary-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.overview-summary-card strong {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-primary);
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.overview-feature-heading {
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0.5rem 0 0.75rem;
}

.overview-feature-heading h3 {
  margin: 0;
}

.overview-feature-heading .form-help {
  margin: 0;
  text-align: right;
}

.overview-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr));
  gap: 0.75rem;
}

.overview-feature-group + .overview-feature-group {
  margin-top: 1.1rem;
}

.overview-feature-group-title {
  margin: 0 0 0.55rem;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.overview-feature-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.overview-feature-card[data-status="needs_setup"] {
  border-color: rgba(250, 166, 26, 0.35);
}

.overview-feature-card[data-status="empty"] {
  border-color: var(--border);
}

.overview-feature-card[data-status="error"] {
  border-color: rgba(237, 66, 69, 0.38);
}

.overview-feature-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
}

.overview-feature-card h4 {
  margin: 0;
  font-size: 0.98rem;
}

.overview-feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.overview-feature-card .overview-registration-count {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.overview-feature-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 0.76rem;
  white-space: nowrap;
}

.overview-requirement {
  color: #f0b44c !important;
}

.overview-requirement.is-error {
  color: #f18b8b !important;
}

.overview-card-actions {
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.overview-card-actions .btn {
  min-height: 2.15rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
}

.overview-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.5rem;
  color: var(--text-muted);
  text-align: center;
}

.overview-meta i {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.btn.icon-only {
  padding: 0.6rem;
  border-radius: 50%;
  aspect-ratio: 1/1;
}

/* Tab label for mobile hide */
.tab-label {
  white-space: nowrap;
}

/* ==========================================================================
   DASHBOARD GUILD LIST
   ========================================================================== */

.guild-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem 0;
}

.server-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.server-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(88, 101, 242, 0.3);
}

.server-icon-large {
  width: 72px;
  height: 72px;
  background: var(--bg-lighter);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 2px solid rgba(255, 255, 255, 0.05);
}

.server-icon-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #fff;
}

.server-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(88, 101, 242, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

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

/* Feature Locking Styles */
.locked-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(14, 14, 16, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(159, 167, 255, 0.2);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: all;
}

.locked-overlay p {
  color: var(--on-surface);
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface-high);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
  transform: translateY(0);
}

.locked-overlay[style*="display: none"] {
  opacity: 0;
  pointer-events: none;
}

/* Ensure parents of locking overlays have relative positioning */
.panel {
  position: relative;
}

.panel-header {
  position: relative;
  z-index: 110; /* Elevate toggles above .locked-overlay (z-index: 100) */
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel {
  position: relative;
}
