/* ============================================================
   Kini Bot 2.0 Modern Design System
   ============================================================ */

:root {
  /* HSL Tailored Colors */
  --primary: #5865f2;
  --primary-hover: #4752c4;
  --primary-glow: rgba(88, 101, 242, 0.25);
  
  --success: #10b981;
  --success-hover: #059669;
  --success-glow: rgba(16, 185, 129, 0.2);
  
  --danger: #f43f5e;
  --danger-hover: #e11d48;
  --danger-glow: rgba(244, 63, 94, 0.2);
  
  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-glow: rgba(245, 158, 11, 0.2);
  
  --bg-darker: #05060b;
  --bg-dark: #090b11;
  --bg-card: rgba(17, 24, 39, 0.55);
  --border-light: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;
}

/* Global Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-darker);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

h1, h2, h3, h4, .brand h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

/* Background Gradients */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: radial-gradient(circle at 5% 5%, rgba(88, 101, 242, 0.18) 0%, transparent 40%),
              radial-gradient(circle at 95% 95%, rgba(16, 185, 129, 0.12) 0%, transparent 50%),
              radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 60%),
              var(--bg-darker);
}

/* Glassmorphism Utility */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
}

.glass-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  transition: var(--transition);
}

.glass-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
}

/* Landing Page */
.landing {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
}

.landing-container {
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  animation: fadeIn 0.6s ease-out;
}

.hero-header {
  text-align: center;
  margin-bottom: 8px;
}

.logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.logo-emoji {
  font-size: 3.8rem;
  filter: drop-shadow(0 0 15px var(--primary-glow));
}

.logo-text {
  font-size: 3.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  color: var(--primary);
  background: linear-gradient(135deg, #818cf8 0%, #5865f2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  color: var(--text-muted);
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: 0.01em;
}

.login-card {
  width: 100%;
  max-width: 480px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-card h2 {
  font-size: 2rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  width: 100%;
  outline: none;
}

.btn-discord {
  background: linear-gradient(135deg, #6366f1 0%, var(--primary) 100%);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-discord:hover {
  background: linear-gradient(135deg, #4f46e5 0%, var(--primary-hover) 100%);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, #34d399 0%, var(--success) 100%);
  color: white;
  box-shadow: 0 4px 12px var(--success-glow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, var(--success-hover) 100%);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.discord-svg {
  width: 22px;
  fill: currentColor;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  width: 100%;
  margin-top: 16px;
}

.feature-item {
  padding: 24px;
  text-align: center;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: var(--transition);
}

.feature-item:hover {
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-4px);
}

.feature-item h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.feature-item p {
  color: var(--text-muted);
  line-height: 1.5;
}

/* Dashboard Page Layout */
.dashboard-body {
  height: 100vh;
  overflow: hidden;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-left: none;
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  gap: 24px;
  overflow-y: auto;
  background: rgba(8, 10, 18, 0.85);
  border-right: 1px solid var(--border-light);
}

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

.brand h2 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.user-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-indicator {
  font-size: 0.75rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.selector-box label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.glass-select {
  width: 100%;
  padding: 12px 14px;
  background: #0f131e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.glass-select:hover, .glass-select:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-item {
  display: block;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  padding-left: 20px;
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.15) 0%, rgba(88, 101, 242, 0.02) 100%);
  border-left: 4px solid var(--primary);
  font-weight: 600;
  padding-left: 18px;
}

.nav-item.active-warn {
  border-left: 4px solid var(--warning);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.02) 100%);
  color: var(--warning);
  font-weight: 600;
  padding-left: 18px;
}

.nav-item.logout {
  color: #fb7185;
  margin-top: auto;
  border: 1px solid rgba(244, 63, 94, 0.1);
}

.nav-item.logout:hover {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.3);
  color: #f43f5e;
}

.system-mini-stats {
  font-size: 0.8rem;
  color: var(--text-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 18px;
}

.system-mini-stats p {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.system-mini-stats span {
  font-weight: 600;
  color: var(--text-muted);
}

/* Content Area */
.content-panel {
  padding: 40px;
  overflow-y: auto;
  height: 100vh;
  background: transparent;
  animation: fadeIn 0.4s ease-out;
}

.panel-header {
  margin-bottom: 32px;
}

.panel-header h2 {
  font-size: 2.2rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.panel-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 300;
}

.tab-content {
  display: none;
}

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

/* Config Grid */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
  height: calc(100vh - 210px);
}

.modules-column, .editor-column {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: hidden;
}

.modules-column h3, .editor-column h3 {
  font-size: 1.3rem;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 6px;
}

.placeholder-text {
  color: var(--text-dark);
  text-align: center;
  padding: 60px 0;
  font-style: italic;
}

/* Module List Item */
.module-item {
  padding: 18px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.module-item.selected {
  background: rgba(88, 101, 242, 0.07);
  border-color: rgba(88, 101, 242, 0.35);
  box-shadow: 0 0 15px rgba(88, 101, 242, 0.08);
}

.module-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.module-title-desc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.m-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-main);
}

.m-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 320px;
}

/* Toggle Switch Slider */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  transition: .3s;
}

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

input:checked + .slider {
  background-color: var(--success);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

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

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Config Code Editor */
.editor-box {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 18px;
}

.code-editor {
  flex-grow: 1;
  background: #07090e;
  color: #38bdf8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  resize: none;
  outline: none;
  transition: var(--transition);
}

.code-editor:focus {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.08);
}

.code-editor:disabled {
  opacity: 0.35;
  color: var(--text-dark);
  background: rgba(0, 0, 0, 0.2);
}

.editor-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.status-msg {
  font-size: 0.88rem;
  font-weight: 500;
}

.status-msg.ok { color: var(--success); }
.status-msg.err { color: var(--danger); }

/* System Logs Terminal */
.terminal-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #0b0e16;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: var(--danger); }
.dot.yellow { background: var(--warning); }
.dot.green { background: var(--success); }

.terminal-title {
  font-size: 0.88rem;
  color: var(--text-dark);
  font-family: var(--font-mono);
}

.terminal-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  transition: var(--transition);
}

.terminal-clear-btn:hover {
  color: white;
}

.terminal-output {
  flex-grow: 1;
  background: #040508;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-y: auto;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* Log level coloring */
.log-line {
  margin-bottom: 6px;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-time {
  color: var(--text-dark);
}

.log-lvl {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-block;
  margin-right: 6px;
  text-transform: uppercase;
}

.log-info .log-lvl { background-color: rgba(56, 189, 248, 0.12); color: #38bdf8; }
.log-warn .log-lvl { background-color: rgba(245, 158, 11, 0.12); color: var(--warning); }
.log-error .log-lvl { background-color: rgba(244, 63, 94, 0.12); color: var(--danger); }
.log-debug .log-lvl { background-color: rgba(148, 163, 184, 0.12); color: var(--text-muted); }

.term-system {
  color: var(--success);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ============================================================
   PREFIX & ALIAS SETTINGS PANEL
   ============================================================ */

.prefix-layout {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.prefix-card {
  padding: 32px;
  border-radius: 16px;
}

.prefix-card-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.prefix-card-icon {
  font-size: 2rem;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  flex-shrink: 0;
}

.prefix-card-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.prefix-card-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.prefix-global-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.prefix-global-row .btn {
  width: auto;
  flex-shrink: 0;
}

.prefix-input-wrap {
  display: flex;
  align-items: center;
  background: #0f131e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  flex: 1;
  transition: var(--transition);
}

.prefix-input-wrap:focus-within {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.prefix-badge {
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 44px;
  text-align: center;
}

.prefix-input {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  outline: none;
  width: 100%;
}

.prefix-input::placeholder {
  color: #334155;
}

.prefix-hint {
  font-size: 0.88rem;
  color: var(--text-dark);
}

.prefix-hint code {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

/* Per-command prefix list */
.prefix-search-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.prefix-search-row .prefix-input {
  flex: 1;
  background: #0f131e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 16px;
}

.prefix-search-row .prefix-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  outline: none;
}

.command-prefix-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 6px;
}

.cmd-prefix-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  transition: var(--transition);
}

.cmd-prefix-row:hover {
  background: rgba(99, 102, 241, 0.04);
  border-color: rgba(99, 102, 241, 0.18);
}

.cmd-prefix-row.modified {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.03);
}

.cmd-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-main);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmd-slash-tag {
  color: var(--primary);
  font-weight: 600;
}

.cmd-prefix-input {
  width: 110px;
  padding: 8px 12px;
  background: #0f131e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  text-align: center;
  outline: none;
  transition: var(--transition);
}

.cmd-prefix-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
}

.cmd-save-btn {
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.cmd-save-btn:hover {
  background: var(--primary);
  color: white;
}

.cmd-save-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cmd-override-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.cmd-default-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-dark);
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Module Grouping */
.prefix-module-group {
  margin-bottom: 10px;
}

.prefix-module-header {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  margin-bottom: 6px;
}

.prefix-module-header:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
}

.prefix-mod-title {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.prefix-mod-chevron {
  color: var(--primary);
  font-size: 0.8rem;
  transition: var(--transition);
  width: 14px;
}

.prefix-mod-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #c7d2fe;
}

.prefix-mod-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 10px;
}

.prefix-module-body {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding-left: 10px;
}

.prefix-module-body.open {
  display: flex;
}

.prefix-cmd-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Subcommands */
.prefix-subcmds {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cmd-prefix-row.is-subcmd {
  background: rgba(10, 15, 25, 0.2);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.03);
  padding: 10px 16px;
}

.subcmd-name {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ============================================================
   ALIAS MANAGER STYLES
   ============================================================ */

.alias-add-form {
  margin-bottom: 24px;
  padding: 20px;
  background: rgba(10, 15, 25, 0.2);
  border: 1px dashed rgba(99, 102, 241, 0.2);
  border-radius: 14px;
}

.alias-form-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.alias-form-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 150px;
}

.alias-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.alias-optional {
  font-weight: 400;
  opacity: 0.5;
  text-transform: none;
}

.alias-arrow {
  font-size: 1.4rem;
  color: var(--primary);
  padding-bottom: 6px;
  align-self: flex-end;
  margin-bottom: 6px;
}

/* Alias Table */
.alias-table-header {
  display: grid;
  grid-template-columns: 140px 24px 130px 130px 1fr 40px;
  gap: 10px;
  padding: 10px 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 8px;
}

.alias-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
}

.alias-row {
  display: grid;
  grid-template-columns: 140px 24px 130px 130px 1fr 40px;
  gap: 10px;
  align-items: center;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  transition: var(--transition);
}

.alias-row:hover {
  background: rgba(99, 102, 241, 0.03);
  border-color: rgba(99, 102, 241, 0.15);
}

.alias-key code {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.alias-sep {
  color: var(--primary);
  font-weight: 700;
}

.alias-cmd code, .alias-sub code {
  background: rgba(30, 41, 59, 0.6);
  color: var(--text-main);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.alias-example code {
  background: rgba(16, 185, 129, 0.08);
  color: #34d399;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.alias-equiv code {
  background: rgba(51, 65, 85, 0.25);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.alias-delete-btn {
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--danger);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.alias-delete-btn:hover {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.5);
  color: #f43f5e;
}

/* Image Upload CDN Helper */
.upload-cdn-helper {
  margin-top: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.upload-cdn-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.upload-cdn-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.upload-btn {
  width: auto !important;
  padding: 12px 20px !important;
  font-size: 0.88rem !important;
}

.upload-url-wrap {
  display: flex;
  align-items: center;
  background: #0f131e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  flex: 1;
  transition: var(--transition);
}

.upload-url-wrap:focus-within {
  border-color: rgba(99, 102, 241, 0.5);
}

.upload-url-input {
  border: none !important;
  background: transparent !important;
  padding: 12px 16px;
  font-size: 0.88rem !important;
  color: var(--text-muted) !important;
}

.copy-btn {
  width: auto !important;
  padding: 12px 18px !important;
  font-size: 0.85rem !important;
  border-radius: 0 9px 9px 0 !important;
}

/* Permissions Configuration */
.permissions-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 18px;
}

.perm-column {
  padding: 24px;
  background: rgba(13, 17, 28, 0.35);
  border-radius: 14px;
}

.roles-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
  margin-top: 12px;
}

.role-checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.role-checkbox-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.role-checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.role-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: #f1f5f9;
}

.role-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

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