:root {
  --bg: #1e1f22;
  --bg-secondary: #2b2d31;
  --bg-tertiary: #313338;
  --bg-input: #1e1f22;
  --border: #3f4147;
  --text: #f2f3f5;
  --text-muted: #949ba4;
  --blurple: #5865f2;
  --blurple-hover: #4752c4;
  --danger: #da373c;
  --success: #248046;
  --secondary-btn: #4e5058;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'gg sans', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}

#app {
  min-height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
}

input,
textarea,
select {
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
}

textarea {
  resize: vertical;
  min-height: 70px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  margin-top: 12px;
}

.btn-primary {
  background: var(--blurple);
  color: white;
}
.btn-primary:hover {
  background: var(--blurple-hover);
}
.btn-secondary {
  background: var(--secondary-btn);
  color: white;
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

/* --- Login --- */
.login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.login-screen h1 {
  font-size: 20px;
}

/* --- Layout --- */
.layout {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sidebar-header h2 {
  font-size: 15px;
  margin: 0;
}
.menu-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.menu-list-item {
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 4px;
  color: var(--text-muted);
}
.menu-list-item:hover {
  background: var(--bg-tertiary);
}
.menu-list-item.active {
  background: var(--blurple);
  color: white;
}
.menu-list-item .status {
  font-size: 11px;
  opacity: 0.8;
}
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.editor-panel {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  max-width: 480px;
  border-right: 1px solid var(--border);
}
.preview-panel {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-tertiary);
}
.placeholder {
  color: var(--text-muted);
  padding: 40px;
  text-align: center;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 24px 0 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.section-title:first-child {
  margin-top: 0;
}

.row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.row > * {
  flex: 1;
}
.row-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
}

.button-row {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
}
.button-row .row {
  margin-top: 6px;
}
.button-row .role-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.error-banner {
  background: rgba(218, 55, 60, 0.15);
  border: 1px solid var(--danger);
  color: #ffb3b3;
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-size: 13px;
}

.warning-banner {
  background: rgba(240, 178, 50, 0.15);
  border: 1px solid #f0b232;
  color: #ffd989;
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-size: 13px;
}

.actions-bar {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.publish-status {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* --- Discord-style preview --- */
.discord-message {
  display: flex;
  gap: 16px;
}
.discord-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blurple);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
}
.discord-body {
  flex: 1;
  min-width: 0;
}
.discord-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.discord-username {
  font-weight: 600;
  color: var(--text);
}
.discord-bot-tag {
  background: var(--blurple);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
}
.discord-time {
  color: var(--text-muted);
  font-size: 12px;
}

.discord-embed {
  border-left: 4px solid var(--blurple);
  background: var(--bg-secondary);
  border-radius: 4px;
  padding: 12px 16px;
  max-width: 432px;
}
.discord-embed-title {
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  white-space: pre-wrap;
  word-break: break-word;
}
.discord-embed-desc {
  color: #dbdee1;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
}
.discord-embed-footer {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 8px;
}

.discord-buttons {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.discord-button-row {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}
.discord-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 3px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.discord-button img.emoji {
  width: 16px;
  height: 16px;
}
.discord-button.style-primary {
  background: var(--blurple);
}
.discord-button.style-secondary {
  background: var(--secondary-btn);
}
.discord-button.style-success {
  background: var(--success);
}
.discord-button.style-danger {
  background: var(--danger);
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
