:root {
  --bg: #111214;
  --surface: #1a1b1f;
  --surface2: #22232a;
  --border: rgba(255,255,255,0.08);
  --text: #f2f3f5;
  --muted: #949ba4;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --success: #3ba55d;
  --danger: #ed4245;
  --warning: #faa81a;
  --radius: 10px;
  --sidebar-w: 260px;
}

html {
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Curseur custom */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none !important;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.12s;
  will-change: transform;
}

#custom-cursor .cursor-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(88, 101, 242, 0.8);
}

#custom-cursor .cursor-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 2px solid rgba(88, 101, 242, 0.45);
  border-radius: 50%;
  transition: width 0.15s, height 0.15s, margin 0.15s, background 0.15s, border-color 0.15s;
}

#custom-cursor.is-pointer .cursor-ring {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-color: var(--accent);
  background: rgba(88, 101, 242, 0.08);
}

#custom-cursor.is-click .cursor-ring {
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  background: rgba(88, 101, 242, 0.25);
  border-color: #fff;
}

#custom-cursor.is-click .cursor-dot {
  transform: scale(0.7);
}

body.custom-cursor-active,
body.custom-cursor-active *:not(:disabled) {
  cursor: none !important;
}

button {
  font-family: inherit;
  color: inherit;
}

.hidden { display: none !important; }

/* Login — toujours au-dessus, clics garantis */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#login-screen.hidden {
  display: none !important;
  pointer-events: none !important;
}

.screen {
  min-height: auto;
  display: contents;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-logo { text-align: center; margin-bottom: 0.5rem; }
.login-logo .logo-icon { font-size: 2.5rem; }
.login-logo h1 { font-size: 1.4rem; margin-top: 0.25rem; }
.login-logo p { color: var(--muted); font-size: 0.9rem; }

.login-card label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.login-card input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.25);
}

.login-card .btn-primary {
  width: 100%;
  margin-top: 0.25rem;
}

/* Buttons — base partagée */
.btn,
.btn-primary,
.btn-ghost,
.btn-sm,
.nav-btn,
.module-card,
.menu-toggle,
.btn-icon,
.dd-trigger,
.dd-option {
  cursor: pointer;
}

.btn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}

.btn-ghost:hover { color: var(--text); background: var(--surface2); }

.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 0.45rem 0.8rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s;
}

.btn-sm:hover { background: var(--accent-hover); }
.btn-sm.btn-danger { background: var(--danger); }
.btn-sm.btn-danger:hover { background: #c03537; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c03537; }

/* Layout */
#app { display: flex; min-height: 100vh; }

#app.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
}

.sidebar-top { padding: 1rem; border-bottom: 1px solid var(--border); }

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.brand .logo-icon { font-size: 1.5rem; }
.brand strong { display: block; font-size: 0.95rem; }
.brand small { color: var(--muted); font-size: 0.72rem; }

.bot-widget {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.85rem;
}

.bot-widget-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.bot-widget-info { min-width: 0; }
.bot-widget-info strong {
  display: block;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-widget-status {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-widget-status.status-online { color: var(--success); }
.bot-widget-status.status-idle { color: var(--warning); }
.bot-widget-status.status-dnd { color: var(--danger); }

.guild-picker label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

#guild-select-container label,
#guild-select-container .form-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

#guild-select-container select {
  min-height: 38px;
  font-size: 0.84rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.86rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 2px;
}

.nav-btn:hover { background: var(--surface2); color: var(--text); }

.nav-btn.active {
  background: rgba(88, 101, 242, 0.18);
  color: #fff;
  font-weight: 600;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0.5rem;
}

.sidebar-footer { padding: 0.75rem; border-top: 1px solid var(--border); }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgba(17, 18, 20, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar h1 { font-size: 1.15rem; font-weight: 700; }
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.topbar-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.menu-toggle {
  display: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
}

.page-content {
  flex: 1;
  width: 100%;
  max-width: none;
  padding: 1.25rem 1.5rem 2rem;
  overflow: visible;
}

/* Cards & forms */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 0.85rem;
  overflow: visible;
  position: relative;
}

.card h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.card-desc { margin: -0.25rem 0 0.85rem; }
.card-subtitle { font-size: 0.88rem; font-weight: 600; color: var(--muted); margin-bottom: 0.75rem; }

.hint-text { font-size: 0.8rem; color: var(--muted); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  align-items: end;
  overflow: visible;
}

.form-group { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; overflow: visible; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 0.78rem; font-weight: 600; color: var(--muted); }

input, select, textarea {
  width: 100%;
  background-color: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  position: relative;
  z-index: 1;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
textarea {
  cursor: text;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 42px;
  padding-right: 2.25rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3.5 5.25L7 8.75L10.5 5.25' stroke='%23949ba4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 14px;
}

select:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background-color: #2a2b33;
}

select option,
select optgroup {
  background: var(--surface);
  color: var(--text);
}

input[type="color"],
.color-picker {
  cursor: pointer;
}

input[type="file"] {
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  margin-right: 0.65rem;
  cursor: pointer;
  transition: background 0.15s;
}

input[type="file"]::file-selector-button:hover {
  background: var(--surface2);
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.25);
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* ─── Listes déroulantes custom ─── */
.dd-wrap { position: relative; z-index: 1; }
.dd-wrap:has(.dd-select.open) { z-index: 400; }

.dd-select {
  position: relative;
  width: 100%;
}

.dd-select.open { z-index: 401; }

.dd-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.7rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dd-trigger:hover {
  border-color: rgba(255,255,255,0.18);
  background: #2a2b33;
}

.dd-select.open .dd-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.3);
}

.dd-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dd-chevron {
  color: var(--muted);
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.dd-select.open .dd-chevron { transform: rotate(180deg); color: var(--accent); }

.dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #1e1f24;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: 0.3rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
  z-index: 402;
}

.dd-select.open .dd-menu { display: block; }

.dd-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
}

.dd-option:hover {
  background: rgba(88, 101, 242, 0.18);
  color: var(--text);
}

.dd-option.selected {
  background: rgba(88, 101, 242, 0.28);
  color: #fff;
  font-weight: 600;
}

.role-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.25);
}

textarea { min-height: 80px; resize: vertical; }

.toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  min-height: 42px;
}

.toggle input[type="checkbox"] {
  width: 42px;
  height: 24px;
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.15s;
}

.toggle input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input[type="checkbox"]:checked::after {
  transform: translateX(18px);
  background: #fff;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

/* Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  text-align: center;
}

.stat-card .value { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.stat-card .label { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
}

.module-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.module-card:hover {
  border-color: var(--accent);
  background: var(--surface2);
}

.module-icon { font-size: 1.4rem; }
.module-name { font-size: 0.85rem; font-weight: 600; }

.module-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
}

.module-card.on .module-badge { background: rgba(59, 165, 93, 0.2); color: var(--success); }
.module-card.off .module-badge { background: rgba(148, 155, 164, 0.15); color: var(--muted); }

.cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.cmd-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
}

.cmd-chip code { color: var(--accent); font-weight: 600; }

/* Lists */
.item-list { display: flex; flex-direction: column; gap: 0.5rem; }

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}

.list-item-body { min-width: 0; }
.list-item-body strong { display: block; font-size: 0.88rem; }

.add-form-card {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.ticket-categories-list { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 0.65rem; }

.ticket-cat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

.ticket-cat-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.ticket-cat-header strong { flex: 1; font-size: 0.88rem; }

.ticket-cat-header .module-badge { margin-left: auto; margin-right: 0.35rem; }

.achievement-card .ticket-cat-header strong { flex: 1; min-width: 0; }

/* Modération — cartes de filtres */
.mod-rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mod-rule-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.mod-rule-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.mod-rule-icon { font-size: 1.15rem; }
.mod-rule-header strong { font-size: 0.92rem; }

.mod-rule-body {
  align-items: end;
}

.mod-immune-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mod-immune-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: end;
}

.mod-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mod-type-check {
  font-size: 0.82rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.mod-restrict-card { margin-top: 0.5rem; }

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--danger);
  width: 30px;
  height: 30px;
  border-radius: 7px;
  cursor: pointer;
}

.btn-icon:hover { background: rgba(237, 66, 69, 0.12); }

.embed-fields-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

/* Bot manage */
.bot-profile-preview { overflow: hidden; padding: 0; }

.bot-profile-banner {
  height: 120px;
  background: linear-gradient(135deg, var(--accent), #7289da);
  background-size: cover;
  background-position: center;
}

.bot-profile-body {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  padding: 0 1.2rem 1.2rem;
  margin-top: -40px;
}

.bot-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  object-fit: cover;
}

.bot-profile-info h2 { font-size: 1.2rem; margin-bottom: 0.2rem; }
.bot-profile-tag { font-size: 0.85rem; color: var(--muted); }

.bot-status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.bot-status-online { background: var(--success); }
.bot-status-idle { background: var(--warning); }
.bot-status-dnd { background: var(--danger); }
.bot-status-invisible, .bot-status-offline { background: var(--muted); }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  background: var(--success);
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  pointer-events: none;
}

.toast.error { background: var(--danger); }

/* ─── Éditeur Embed ─── */
.embed-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
  gap: 1rem;
  align-items: start;
}

.embed-preview-panel { position: sticky; top: 4.5rem; }

.preview-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.discord-embed-preview { background: #2f3136; border-radius: 10px; padding: 0.85rem; }

.discord-embed {
  display: flex;
  border-left: 4px solid #5865f2;
  border-radius: 4px;
  background: #2b2d31;
  position: relative;
  overflow: hidden;
}

.discord-embed-body { padding: 0.55rem 0.75rem; flex: 1; min-width: 0; }
.embed-author { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.35rem; font-size: 0.8rem; font-weight: 600; }
.embed-author img { width: 20px; height: 20px; border-radius: 50%; }
.embed-title { font-size: 0.9rem; font-weight: 700; color: #00a8fc; margin-bottom: 0.3rem; }
.embed-description { font-size: 0.85rem; color: #dbdee1; line-height: 1.4; white-space: pre-wrap; }
.embed-fields { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.embed-field { flex: 1 1 100%; }
.embed-field.inline { flex: 1 1 30%; }
.embed-field-name { font-size: 0.78rem; font-weight: 700; color: #fff; }
.embed-field-value { font-size: 0.82rem; color: #dbdee1; }
.embed-thumb { position: absolute; top: 0.5rem; right: 0.65rem; width: 64px; height: 64px; border-radius: 6px; object-fit: cover; }
.embed-image { max-width: 100%; border-radius: 6px; margin-top: 0.5rem; }
.embed-footer { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.5rem; font-size: 0.7rem; color: #949ba4; }
.embed-footer img { width: 16px; height: 16px; border-radius: 50%; }

.color-input-wrap { display: flex; gap: 0.45rem; align-items: center; }
.color-picker { width: 42px; height: 38px; padding: 2px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); background: var(--surface2); }

.embed-fields-section { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.embed-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.45rem;
  padding: 0.55rem;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.inline-check { display: flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.range-input { accent-color: var(--accent); border: none; background: transparent; padding: 0; }
.range-val { font-size: 0.78rem; color: var(--accent); font-weight: 600; }

.welcome-card-preview-wrap { background: #1e1f22; border-radius: 10px; padding: 0.85rem; }
.welcome-card-preview { width: 100%; aspect-ratio: 3/1; min-height: 120px; position: relative; overflow: hidden; }
.wc-gradient { position: absolute; inset: 0; pointer-events: none; }
.wc-content { position: relative; display: flex; align-items: center; gap: 0.85rem; padding: 1rem; height: 100%; z-index: 1; }
.wc-avatar { border-radius: 50%; border: 3px solid; overflow: hidden; flex-shrink: 0; }
.wc-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Mobile */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .page-content { padding: 1rem; }
  .embed-editor-layout { grid-template-columns: 1fr; }
  .embed-preview-panel { position: static; }
}
