/* Modern Styling Reset & Theming for Private Space v2 */
:root {
  --bg-darkest: #07070a;
  --bg-rail: #0e0e13;
  --bg-sidebar: #13131a;
  --bg-workspace: #181822;
  --bg-panel: #14141d;
  --bg-card: rgba(26, 26, 36, 0.85);

  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-hover: rgba(255, 255, 255, 0.05);
  --glass-active: rgba(255, 255, 255, 0.08);

  /* Violet Theme (Default) */
  --accent-color: #8b5cf6;
  --accent-glow: rgba(139, 92, 246, 0.35);
  --accent-hover: #a78bfa;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #6b7280;

  --online-color: #10b981;
  --idle-color: #f59e0b;
  --dnd-color: #ef4444;
  --offline-color: #6b7280;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --rail-width: 72px;
  --sidebar-width: 250px;
  --members-width: 240px;
}

/* Theme variations */
[data-theme='emerald'] {
  --accent-color: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.35);
  --accent-hover: #34d399;
}
[data-theme='rose'] {
  --accent-color: #f43f5e;
  --accent-glow: rgba(244, 63, 94, 0.35);
  --accent-hover: #fb7185;
}
[data-theme='amber'] {
  --accent-color: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.35);
  --accent-hover: #fbbf24;
}
[data-theme='cyan'] {
  --accent-color: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.35);
  --accent-hover: #22d3ee;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-darkest);
  color: var(--text-main);
  font-family: var(--font-body);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

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

.hidden {
  display: none !important;
}

/* App Layout Grid */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* 1. Left Server Rail */
.server-rail {
  width: var(--rail-width);
  background: var(--bg-rail);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 10px;
  z-index: 10;
  overflow-y: auto;
}

.rail-item {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rail-pill {
  position: absolute;
  left: -12px;
  width: 4px;
  height: 8px;
  background: white;
  border-radius: 0 4px 4px 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

.rail-item:hover .rail-pill {
  opacity: 1;
  height: 20px;
}

.rail-item.active .rail-pill {
  opacity: 1;
  height: 38px;
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
}

.server-icon-inner {
  width: 46px;
  height: 46px;
  border-radius: 23px;
  background: var(--bg-sidebar);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  border: 1px solid var(--glass-border);
  user-select: none;
}

.rail-item:hover .server-icon-inner {
  border-radius: 15px;
  background: var(--accent-color);
  color: white;
  box-shadow: 0 0 14px var(--accent-glow);
}

.rail-item.active .server-icon-inner {
  border-radius: 15px;
  background: var(--accent-color);
  color: white;
}

.dm-bubble-icon svg {
  transition: transform 0.2s ease;
}
.rail-item:hover .dm-bubble-icon svg {
  transform: scale(1.1);
}

.rail-separator {
  width: 32px;
  height: 2px;
  background: var(--glass-border);
  border-radius: 1px;
  margin: 4px 0;
}

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

.action-item .add-btn,
.action-item .join-btn {
  background: transparent;
  color: #10b981;
  border: 1px dashed rgba(16, 185, 129, 0.5);
  font-size: 1.4rem;
}
.action-item:hover .add-btn,
.action-item:hover .join-btn {
  background: #10b981;
  color: white;
  border-style: solid;
}

/* 2. Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-indicator {
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}
.status-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--online-color);
}
.status-indicator.offline::before {
  background: var(--offline-color);
}

.sidebar-scroll {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
}

.nav-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 6px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.05em;
}

.icon-btn-tiny {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
}
.icon-btn-tiny:hover {
  color: var(--text-main);
  background: var(--glass-hover);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-list li {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.nav-list li:hover {
  background: var(--glass-hover);
  color: var(--text-main);
}

.nav-list li.active {
  background: rgba(139, 92, 246, 0.15);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent-color);
}

.chan-prefix {
  color: var(--text-dark);
  font-size: 1.1rem;
}
.nav-list li.active .chan-prefix {
  color: var(--accent-color);
}

/* Voice Channel Extras */
.voice-list li {
  position: relative;
}
.voice-users-tray {
  margin-left: 28px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.voice-user-pill {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.voice-user-pill-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-color);
  font-size: 0.65rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* DM items */
.dm-nav-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dm-avatar {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dm-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
  background: var(--offline-color);
}
.dm-dot.online { background: var(--online-color); }
.dm-dot.idle { background: var(--idle-color); }
.dm-dot.dnd { background: var(--dnd-color); }

/* User Profile Footer */
.user-footer {
  padding: 12px 14px;
  background: rgba(10, 10, 15, 0.7);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  overflow: hidden;
}

.avatar-wrapper {
  position: relative;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.presence-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
  background: var(--offline-color);
}
.presence-dot.online { background: var(--online-color); }
.presence-dot.idle { background: var(--idle-color); }
.presence-dot.dnd { background: var(--dnd-color); }

.user-text-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-display-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-subtext {
  font-size: 0.72rem;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-btn-group {
  display: flex;
  gap: 4px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.icon-btn:hover {
  background: var(--glass-hover);
  color: var(--text-main);
}

/* 3. Main Workspace */
.chat-workspace {
  flex: 1;
  background: var(--bg-workspace);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.channel-title-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-icon {
  font-size: 1.5rem;
  color: var(--text-dark);
  font-weight: 300;
}

.channel-title-container h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.channel-description {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-left: 14px;
  margin-left: 14px;
  border-left: 1px solid var(--glass-border);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.messages-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Message Cards */
.message-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.1s ease;
}
.message-card:hover {
  background: var(--glass-hover);
}

.msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  cursor: pointer;
}

.msg-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.msg-metadata {
  display: flex;
  align-items: center;
  gap: 8px;
}

.msg-author {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}
.msg-author:hover {
  text-decoration: underline;
}

.msg-time {
  font-size: 0.72rem;
  color: var(--text-dark);
}

.msg-text {
  font-size: 0.94rem;
  line-height: 1.5;
  color: #e5e7eb;
  word-break: break-word;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 24px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.typing-dots {
  display: flex;
  gap: 4px;
}
.typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Chat Input */
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
}

.message-form {
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 6px 14px;
  align-items: center;
  transition: all 0.2s ease;
}
.message-form:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 12px var(--accent-glow);
}

.message-form input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 8px 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.message-form input:focus {
  outline: none;
}

.send-btn {
  background: var(--accent-color);
  border: none;
  color: white;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.send-btn:hover {
  background: var(--accent-hover);
}

/* 4. Active Members Pane */
.members-pane {
  width: var(--members-width);
  background: var(--bg-panel);
  border-left: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.members-header {
  padding: 18px 16px;
  border-bottom: 1px solid var(--glass-border);
}
.members-header h3 {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.05em;
}

.members-scroll {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
}

.members-category {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dark);
  padding: 4px 8px;
  margin-top: 6px;
}

.members-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.member-item:hover {
  background: var(--glass-hover);
}

.member-avatar-wrap {
  position: relative;
}
.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.member-presence-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--bg-panel);
  background: var(--offline-color);
}
.member-presence-dot.online { background: var(--online-color); }
.member-presence-dot.idle { background: var(--idle-color); }
.member-presence-dot.dnd { background: var(--dnd-color); }

.member-name-block {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.member-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-custom-status {
  font-size: 0.72rem;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 5. WebRTC Call Overlay */
.call-overlay {
  position: absolute;
  top: 70px;
  right: 20px;
  width: 440px;
  background: rgba(18, 18, 26, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  z-index: 50;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.call-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.call-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.call-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.2);
  color: var(--online-color);
}
.call-header h4 {
  font-family: var(--font-display);
  font-size: 1rem;
}
.call-timer {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.call-btn-mini {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
}

.call-streams-grid {
  height: 240px;
  background: #09090d;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
}
.video-cell {
  position: relative;
  background: #12121c;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-avatar-fallback {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.call-control-bar {
  padding: 12px;
  display: flex;
  justify-content: center;
  gap: 12px;
  background: rgba(12, 12, 18, 0.9);
}
.call-circle-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.call-circle-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.call-circle-btn.active {
  background: var(--accent-color);
}
.call-circle-btn.hangup-btn {
  background: var(--dnd-color);
}
.call-circle-btn.hangup-btn:hover {
  background: #dc2626;
}

/* Incoming Call Modal / Ring */
.incoming-call-modal {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}
.incoming-card {
  background: rgba(22, 22, 32, 0.95);
  border: 1px solid var(--accent-color);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px var(--accent-glow);
  border-radius: 16px;
  padding: 20px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(16px);
  animation: call-pulse 1.8s infinite;
}
@keyframes call-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
.ring-pulse-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 1.5s infinite;
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 16px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.incoming-actions {
  display: flex;
  gap: 14px;
  margin-top: 6px;
}
.call-action {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.call-action.accept {
  background: var(--online-color);
  color: white;
}
.call-action.decline {
  background: var(--dnd-color);
  color: white;
}

/* User Popover */
.user-popover {
  position: absolute;
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  z-index: 60;
  overflow: hidden;
}
.popover-banner {
  height: 64px;
  background: linear-gradient(135deg, var(--accent-color), #ec4899);
}
.popover-avatar-wrap {
  position: relative;
  margin-top: -30px;
  margin-left: 16px;
  width: 60px;
  height: 60px;
}
.popover-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 4px solid var(--bg-sidebar);
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
}
.popover-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--bg-sidebar);
}
.popover-body {
  padding: 12px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.popover-body h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.popover-custom-status {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.popover-bio {
  font-size: 0.82rem;
  color: #d1d5db;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: 8px;
}
.popover-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.primary-btn-sm, .secondary-btn-sm {
  flex: 1;
  padding: 7px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.primary-btn-sm {
  background: var(--accent-color);
  color: white;
}
.secondary-btn-sm {
  background: var(--glass-hover);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
}

/* Modals & Dialogs */
.custom-dialog {
  margin: auto;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 26px;
  width: 420px;
  color: var(--text-main);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
}
.custom-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
}
.custom-dialog h3 {
  font-family: var(--font-display);
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
}
.form-group select option {
  background: var(--bg-sidebar);
}

/* Theme & Gradient Palettes */
.theme-palette, .gradient-palette {
  display: flex;
  gap: 10px;
}
.theme-swatch, .gradient-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.theme-swatch:hover, .gradient-swatch:hover {
  transform: scale(1.15);
}
.theme-swatch.active, .gradient-swatch.active {
  border-color: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.primary-btn {
  background: var(--accent-color);
  border: none;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: var(--font-body);
}
.primary-btn:hover {
  background: var(--accent-hover);
}

.secondary-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.secondary-btn:hover {
  background: var(--glass-hover);
  color: var(--text-main);
}

/* Auth Screen */
.auth-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  background: rgba(8, 8, 12, 0.9);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 420px;
  background: rgba(20, 20, 30, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.auth-header {
  text-align: center;
  margin-bottom: 28px;
}
.auth-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.auth-error {
  color: var(--dnd-color);
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 14px;
}
.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}
