/* ═══════════════════════════════════════════════════════════
   KickOt Dashboard — CSS
   Premium dark sidebar layout
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700;14..32,800;14..32,900&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Variables ── */
:root {
  --bg-base: #07070D;
  --bg-surface: #0D0D17;
  --bg-elevated: #12121E;
  --bg-card: #171728;
  --bg-sidebar: #0A0A16;
  --bg-overlay: rgba(7, 7, 13, 0.95);

  --kick-green: #53FC18;
  --kick-green-dim: rgba(83, 252, 24, 0.1);
  --app-primary: #8B5CF6;
  --app-primary-dim: rgba(139, 92, 246, 0.1);
  --app-secondary: #6366F1;
  --app-gradient: linear-gradient(135deg, #8B5CF6 0%, #6366F1 60%, #4F46E5 100%);

  --text-primary: #FFFFFF;
  --text-secondary: #D1D1EB;
  --text-muted: #9393B5;

  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-normal: rgba(139, 92, 246, 0.15);
  --border-accent: rgba(139, 92, 246, 0.4);

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.7);
  --shadow-purple: 0 4px 32px rgba(139, 92, 246, 0.18);
  --shadow-green: 0 4px 32px rgba(83, 252, 24, 0.15);

  --sidebar-w: 240px;
  --topbar-h: 56px;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.12s var(--ease-smooth);
  --transition-base: 0.22s var(--ease-smooth);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-violet, #8B5CF6) transparent;
}

/* WebKit pregledači (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-violet, #8B5CF6), var(--color-green, #53FC18));
  border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-green, #53FC18);
}

::selection {
  background: rgba(139, 92, 246, 0.2);
  color: var(--text-primary);
}

a {
  text-decoration: none;
  color: inherit;
}

input,
textarea,
select,
button {
  font-family: inherit;
}

button {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button:focus {
  outline: none;
}

button:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.55);
  outline-offset: 2px;
}

/* ── Auth Gate ── */
.auth-gate {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-gate-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.auth-gate-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.auth-gate-logo .logo-icon {
  width: 44px;
  height: 44px;
  background: var(--app-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.auth-gate-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-normal);
  border-top-color: var(--app-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.auth-gate-msg {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.text-muted {
  color: var(--text-muted);
}

/* ── App Layout ── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ══════════ SIDEBAR ══════════ */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: width var(--transition-base);
  position: relative;
  z-index: 50;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  flex-shrink: 0;
  gap: 8px;
}

.sidebar-header-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  cursor: pointer;
}

.sidebar-header-btn:hover {
  background: var(--app-primary-dim);
  color: var(--text-primary);
  border-color: var(--border-normal);
}

.sidebar-header-btn.back-btn:hover {
  color: var(--kick-green);
  border-color: rgba(83, 252, 24, 0.35);
  background: rgba(83, 252, 24, 0.08);
  box-shadow: 0 0 12px rgba(83, 252, 24, 0.15);
}

.sidebar-header-btn.coffee-btn:hover {
  color: #F59E0B;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.sidebar-logo .logo-img {
  height: 40px;
  max-height: 42px;
  object-fit: contain;
  transition: transform var(--transition-fast);
}

.sidebar-logo:hover .logo-img {
  transform: scale(1.05);
}

/* ── Channel Switcher ── */
.channel-switcher {
  padding: 0.875rem 0.875rem 0.5rem;
  flex-shrink: 0;
  position: relative;
}

.channel-current {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-subtle);
}

.channel-current:hover,
.channel-switcher:has(.channel-menu.open) .channel-current {
  background: var(--app-primary-dim);
  border-color: var(--border-normal);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
}

.channel-switcher:has(.channel-menu.open) .channel-chevron {
  transform: rotate(180deg);
  color: var(--app-primary);
}

.channel-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--app-gradient);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.channel-info {
  flex: 1;
  overflow: hidden;
}

.channel-name {
  font-size: 0.875rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.channel-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-on {
  background: var(--kick-green);
  box-shadow: 0 0 6px rgba(83, 252, 24, 0.6);
  animation: pulse-dot 2s infinite;
}

.status-off {
  background: var(--text-muted);
}

.channel-status span:last-child {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.channel-chevron {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.channel-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0.75rem;
  right: 0.75rem;
  background: rgba(13, 13, 23, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-lg);
  padding: 0.625rem;
  z-index: 200;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(139, 92, 246, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transition: all var(--transition-base);
}

.channel-menu.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

.channel-group-header {
  padding: 6px 10px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 4px;
}

.channel-empty-text {
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.channel-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.channel-option:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.15);
  color: var(--text-primary);
  transform: translateX(2px);
}

.channel-option.selected {
  background: var(--app-primary-dim);
  border-color: var(--border-accent);
  color: #fff;
  font-weight: 700;
}

.channel-option .ch-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-option .ch-check {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kick-green);
  flex-shrink: 0;
}

.channel-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(83, 252, 24, 0.06);
  border: 1px dashed rgba(83, 252, 24, 0.3);
  color: var(--kick-green);
  font-size: 0.8125rem;
  font-weight: 700;
  margin-top: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.channel-add-btn:hover {
  background: rgba(83, 252, 24, 0.14);
  border-color: var(--kick-green);
  box-shadow: 0 4px 12px rgba(83, 252, 24, 0.15);
  transform: translateY(-1px);
}

/* ── Sidebar Nav ── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 0.625rem 0.375rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  transition: var(--transition-fast);
  position: relative;
  letter-spacing: -0.01em;
}

.nav-item svg {
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--app-primary-dim);
  color: var(--text-secondary);
}

.nav-item.active {
  background: var(--app-primary-dim);
  color: var(--text-primary);
  border: 1px solid var(--border-normal);
}

.nav-item.active svg {
  color: var(--app-primary);
}

.nav-badge {
  margin-left: auto;
  background: var(--app-gradient);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.user-menu-sm {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0.5rem;
  right: 0.5rem;
  background: rgba(14, 10, 29, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-lg);
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.25);
}

.user-menu-sm.open {
  opacity: 1;
  pointer-events: all;
  transform: none;
}

.user-menu-sm .dropdown-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: var(--text-muted);
  padding: 8px 12px 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s, padding-left 0.2s, background-color 0.2s, color 0.2s;
}

.user-menu-sm .dropdown-item:hover {
  color: var(--text-primary);
  background-color: rgba(83, 252, 24, 0.04);
  border-left-color: var(--kick-green);
  padding-left: 14px;
}

.user-menu-sm .dropdown-item.danger {
  color: #FCA5A5;
}

.user-menu-sm .dropdown-item.danger:hover {
  background-color: rgba(239, 68, 68, 0.05);
  border-left-color: #EF4444;
  padding-left: 14px;
  color: #FCA5A5;
}

.user-menu-sm .dropdown-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.06);
  margin: 4px 6px;
}
.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  position: relative;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.user-pill:hover,
.user-pill:has(.user-menu-sm.open) {
  background: var(--app-primary-dim);
  box-shadow: rgba(139, 92, 246, 0.15) 0px 0px 10px;
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--app-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-display-name {
  font-size: 0.875rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.user-plan {
  font-size: 0.6875rem;
  color: var(--app-primary);
  font-weight: 600;
  margin-top: 1px;
}



/* ══════════ MAIN ══════════ */
.main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.topbar-hamburger {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.topbar-hamburger:hover {
  border-color: var(--border-normal);
  color: var(--text-primary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.bc-sep {
  color: var(--text-muted);
  opacity: 0.5;
}

#breadcrumbPage {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.bot-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.bot-toggle-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
}

.topbar-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.topbar-btn:hover {
  border-color: var(--border-normal);
  color: var(--text-primary);
}

.topbar-channel-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.875rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.kick-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--kick-green);
  box-shadow: 0 0 6px rgba(83, 252, 24, 0.5);
}

/* ── Toggle Switch ── */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  display: none;
}

.toggle-track {
  width: 36px;
  height: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #94a3b8;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Prilagođeno rastezanje za manju dimenziju */
.toggle-switch:active .toggle-track::after {
  width: 17px;
}

.toggle-switch input:checked + .toggle-track {
  background: rgba(0, 255, 136, 0.08);
  border-color: rgba(0, 255, 136, 0.3);
  box-shadow: inset 0 2px 4px rgba(0, 255, 136, 0.05);
}

.toggle-switch input:checked + .toggle-track::after {
  left: calc(100% - 16px);
  background: #00ff88;
  box-shadow: 0 0 10px #00ff88, 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ══════════ PANELS ══════════ */
.main, .panels-wrap {
  background-color: var(--bg-base) !important;
}

.panels-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.5rem 1.5rem;
  background-color: var(--bg-base);
  scroll-behavior: smooth;
  min-height: 0;
}

.panel {
  display: none;
  background-color: transparent;
}

.panel.active {
  display: block;
  animation: panel-fade-in 0.22s var(--ease-smooth) forwards;
}

@keyframes panel-fade-in {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Topbar Interactive Elements */
.topbar-btn:hover {
  background: rgba(139, 92, 246, 0.12) !important;
  border-color: rgba(139, 92, 246, 0.35) !important;
  color: #FFFFFF !important;
}

@keyframes badge-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg)
  }

  to {
    transform: rotate(360deg)
  }
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.4
  }
}

@keyframes pulse-red {

  0%,
  100% {
    opacity: 1;
    transform: scale(1)
  }

  50% {
    opacity: 0.4;
    transform: scale(1.2)
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(16px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.panel-title {
  font-size: 1.625rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.panel-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.panel-actions {
  display: flex;
  gap: 0.625rem;
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn:focus, .btn:active, .btn:focus-visible {
  outline: none !important;
  outline-offset: 0 !important;
}

.btn-primary {
  background: var(--app-gradient);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3), var(--shadow-purple);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.5), 0 8px 32px rgba(139, 92, 246, 0.3);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid var(--border-normal);
}

.btn-outline:hover {
  border-color: var(--border-accent);
  background: var(--app-primary-dim);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
}

.btn-ghost:hover {
  color: var(--text-primary);
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 0.4375rem 0.875rem;
  font-size: 0.8125rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--app-primary);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0;
}

.btn-text:hover {
  color: #C4B5FD;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.375rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  transition: var(--transition-base);
}

.stat-card:hover {
  border-color: var(--border-normal);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-purple {
  background: var(--app-primary-dim);
}

.stat-green {
  background: var(--kick-green-dim);
}

.stat-blue {
  background: rgba(99, 102, 241, 0.1);
}

.stat-pink {
  background: rgba(244, 114, 182, 0.1);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* ── Overview Grid ── */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.ov-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.375rem;
}

.ov-card-full {
  grid-column: 1 / -1;
}

.ov-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.125rem;
}

.ov-card-head h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── Mini List ── */
.mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mini-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.mini-item:hover {
  background: var(--app-primary-dim);
}

.mini-rank {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 800;
  flex-shrink: 0;
}

.mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--app-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ── Module Status Badges ── */
.module-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition-fast);
  user-select: none;
}

.module-status-badge.active {
  background: rgba(83, 252, 24, 0.08);
  border: 1px solid rgba(83, 252, 24, 0.22);
  color: var(--kick-green);
  box-shadow: 0 2px 8px rgba(83, 252, 24, 0.05);
}

.module-status-badge.active:hover {
  background: rgba(83, 252, 24, 0.14);
  border-color: rgba(83, 252, 24, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(83, 252, 24, 0.12);
}

.module-status-badge.inactive {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #F87171;
}

.module-status-badge.inactive:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.rank-1 {
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  color: #000;
}

.rank-2 {
  background: linear-gradient(135deg, #94A3B8, #64748B);
  color: #fff;
}

.rank-3 {
  background: linear-gradient(135deg, #92400E, #78350F);
  color: #FDE68A;
}

.rank-n {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.mini-username {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--app-primary);
  font-family: 'JetBrains Mono', monospace;
}

.mini-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ── Tables ── */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 2.375rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.table-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.table-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
  margin-bottom: 2rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead tr {
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  padding: 0.75rem 1.125rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1.125rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-secondary);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background: rgba(139, 92, 246, 0.04);
}

.table-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-style: italic;
}

.td-cmd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--kick-green);
  background: var(--kick-green-dim);
  border: 1px solid rgba(83, 252, 24, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(83, 252, 24, 0.03);
  transition: all var(--transition-fast);
}

.td-cmd:hover {
  background: rgba(83, 252, 24, 0.16);
  border-color: rgba(83, 252, 24, 0.3);
  transform: translateY(-1px);
}

.td-response {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.td-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-active {
  background: rgba(83, 252, 24, 0.1);
  color: var(--kick-green);
  border: 1px solid rgba(83, 252, 24, 0.2);
}

.status-inactive {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.actions-cell {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: var(--app-primary-dim);
  border-color: var(--app-primary);
  color: var(--text-primary);
  transform: scale(1.05);
}

.action-btn.danger:hover {
  border-color: rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.08);
}

/* ── Leaderboard Podium ── */
.lb-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  min-height: 160px;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.podium-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 900;
  border: 3px solid transparent;
}

.podium-1 .podium-avatar {
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  border-color: #FBBF24;
  color: #000;
  width: 64px;
  height: 64px;
}

.podium-2 .podium-avatar {
  background: linear-gradient(135deg, #94A3B8, #64748B);
  border-color: #94A3B8;
  color: #fff;
}

.podium-3 .podium-avatar {
  background: linear-gradient(135deg, #92400E, #78350F);
  border-color: #92400E;
  color: #FDE68A;
}

.podium-name {
  font-size: 0.8125rem;
  font-weight: 700;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-points {
  font-size: 1rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
}

.podium-1 .podium-points {
  font-size: 1.25rem;
  color: #FBBF24;
}

.podium-2 .podium-points {
  color: #94A3B8;
}

.podium-3 .podium-points {
  color: #92400E;
}

.podium-base {
  padding: 0.375rem 1rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  text-align: center;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.podium-1 .podium-base {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #FBBF24;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: none;
}

.podium-2 .podium-base {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94A3B8;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: none;
}

.podium-3 .podium-base {
  background: rgba(146, 64, 14, 0.15);
  border: 1px solid rgba(146, 64, 14, 0.25);
  color: #92400E;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: none;
}

/* ── Config ── */
.config-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.config-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.625rem;
}

.config-section-title {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.375rem;
}

.config-fields {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.config-label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.config-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-input {
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.06);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.6;
  font-size: 0.875rem;
}

.select-input {
  padding: 0.5rem 0.875rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.select-input:hover {
  border-color: var(--border-accent);
}

.select-input-sm {
  padding: 0.25rem 0.625rem;
  font-size: 0.8rem;
}

.select-input option,
select option {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  padding: 6px 12px;
}

.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.toggle-item:last-child {
  border-bottom: none;
}

.toggle-name {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.toggle-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

/* ── Builtin Commands ── */
.builtin-section {
  margin-top: 1.5rem;
}

.builtin-title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.builtin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.875rem;
}

.builtin-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-height: 92px;
}

.builtin-cmd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--kick-green);
  flex-shrink: 0;
  width: auto;
}

.builtin-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.status-neutral {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* ── Info Banner ── */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.info-banner svg {
  flex-shrink: 0;
  color: var(--app-primary);
  margin-top: 2px;
}

/* ── Command Input ── */
.cmd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cmd-prefix-badge {
  position: absolute;
  left: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--kick-green);
  pointer-events: none;
}

.cmd-input-wrap .form-input {
  padding-left: 2rem;
}

.char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.25rem;
}

/* ── Coming Soon Panel ── */
.coming-soon-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 40vh;
  gap: 1rem;
}

.cs-icon {
  font-size: 3.5rem;
}

.coming-soon-panel h3 {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.coming-soon-panel p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  max-width: 420px;
  line-height: 1.7;
}

/* ── Modals ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 3, 8, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#confirmModal {
  z-index: 1100;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

.modal-box {
  background: rgba(22, 22, 33, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: scale(0.96) translateY(12px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.modal-backdrop.open .modal-box {
  transform: scale(1) translateY(0);
}

.modal-sm {
  max-width: 380px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem 0.75rem 1.75rem;
}

.modal-head h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.modal-body {
  padding: 0.75rem 1.75rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.75rem 1.75rem 1.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.form-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(18, 18, 26, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0 solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  max-width: calc(100vw - 32px);
  width: max-content;
  white-space: nowrap;
  pointer-events: all;
  
  /* Initial hidden collapsed state */
  opacity: 0;
  transform: translateY(20px) scale(0.85);
  max-height: 0;
  padding: 0 18px;
  margin: 0;
  overflow: hidden;
  
  /* Smooth exit transitions (no bounce) */
  transition: 
    opacity 0.2s ease-in, 
    transform 0.2s ease-in, 
    max-height 0.25s ease, 
    padding 0.25s ease, 
    margin 0.25s ease,
    border-width 0.25s ease;
}

.toast.toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
  max-height: 160px;
  padding: 10px 18px;
  margin: 4px 0;
  border-width: 1px;
  
  /* Satisfying physics spring entry transitions (overshoot bounce) */
  transition: 
    opacity 0.35s ease-out, 
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), 
    max-height 0.3s ease-out, 
    padding 0.3s ease-out, 
    margin 0.3s ease-out,
    border-width 0.3s ease-out;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.05);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.05);
}

.toast-info {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.05);
}

.toast-icon-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-msg {
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  margin-left: 0.5rem;
  padding: 0;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.15s;
}

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

/* ── Responsive ── */
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .ov-card-full {
    grid-column: 1;
  }
}

@media (max-width: 768px) {
  .app {
    grid-template-columns: 0 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--transition-base);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    width: var(--sidebar-w);
  }

  .topbar-hamburger {
    display: flex;
  }

  .panels-wrap {
    padding: 1.25rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 769px) {
  .topbar-hamburger {
    display: none;
  }
}

/* ── Command Badges & Pills ── */
.badge-type {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  width: fit-content;
}

.badge-system {
  background: var(--app-primary-dim);
  color: #C084FC;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.badge-custom {
  background: rgba(16, 185, 129, 0.1);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-builtin {
  background: rgba(245, 158, 11, 0.1);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.cmd-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}

.cmd-badge-list .td-cmd {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* ── Fixed Table Layout & Word Wrapping to Prevent Scroll ── */
.data-table {
  table-layout: fixed;
  width: 100%;
}

.data-table th,
.data-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* Postavljanje prelamanja za odgovor komande */
.data-table td .td-response {
  max-width: 100%;
  display: block;
  white-space: normal;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Kolona sa komandama (aliasi) */
.data-table td .cmd-badge-list {
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* Prilagođavanje širina kolona u tabeli sa komandama */
#commandsTable th:nth-child(1),
#commandsTable td:nth-child(1) {
  width: 18%; /* Komanda */
}

#commandsTable th:nth-child(2),
#commandsTable td:nth-child(2) {
  width: 34%; /* Odgovor (najšira kolona koja se prelama) */
  word-break: break-word;
}

#commandsTable th:nth-child(3),
#commandsTable td:nth-child(3) {
  width: 12%; /* Dozvola */
}

#commandsTable th:nth-child(4),
#commandsTable td:nth-child(4) {
  width: 10%; /* Cooldown */
}

#commandsTable th:nth-child(5),
#commandsTable td:nth-child(5) {
  width: 8%; /* Korišćeno */
}

#commandsTable th:nth-child(6),
#commandsTable td:nth-child(6) {
  width: 10%; /* Status */
  overflow: visible;
  text-overflow: clip;
}

#commandsTable th:nth-child(7),
#commandsTable td:nth-child(7) {
  width: 8%; /* Akcije */
  overflow: visible;
  text-overflow: clip;
}

/* Sortabilna zaglavlja u tabelama */
.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.sortable-th:hover {
  color: var(--app-primary);
  background: rgba(255, 255, 255, 0.02);
}

.sortable-th .sort-icon {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.72rem;
  opacity: 0.4;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sortable-th:hover .sort-icon {
  opacity: 0.9;
}

.sortable-th.active-sort .sort-icon {
  opacity: 1;
  color: var(--app-primary);
  font-weight: bold;
}

/* Settings Modal Avatar styles */
.settings-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.avatar-preview-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--app-primary);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    margin-bottom: 10px;
    background: rgba(6, 4, 10, 0.6);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
    transition: all 0.2s;
}

.avatar-preview-container:hover {
    border-color: var(--kick-green);
    box-shadow: 0 0 15px rgba(83, 252, 24, 0.3);
}

.avatar-preview-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    font-family: var(--font-heading);
}

.avatar-preview-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(6, 4, 10, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.avatar-preview-container:hover .avatar-preview-overlay {
    opacity: 1;
}

.avatar-preview-overlay svg {
    color: var(--kick-green);
    filter: drop-shadow(0 0 5px var(--kick-green));
}

.preset-option:hover {
    transform: scale(1.15);
    border-color: var(--kick-green) !important;
    box-shadow: 0 0 8px rgba(83, 252, 24, 0.3);
    background: rgba(83, 252, 24, 0.05) !important;
}

.presets-grid {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 15px;
}

.preset-option {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s;
}

.preset-title {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Premium Form Input styling inside dashboard modals */
.form-control {
  width: 100%;
  background: rgba(6, 4, 10, 0.5) !important;
  border: 1px solid var(--border-normal) !important;
  border-radius: 8px !important;
  padding: 0.75rem 1rem !important;
  color: var(--text-primary) !important;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  transition: all var(--transition-fast) !important;
}

.form-control:focus {
  outline: none !important;
  border-color: var(--app-primary) !important;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25) !important;
  background: rgba(6, 4, 10, 0.8) !important;
}

.form-control::placeholder {
  color: var(--text-muted) !important;
  opacity: 0.7 !important;
}

.form-control:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

/* Tab selectors inside Settings Modal */
.settings-tab.active {
  background: var(--app-primary, #8B5CF6) !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3) !important;
}

/* Channel Manager styles inside Modal */
.modal-channel-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
  margin-bottom: 6px;
}

.modal-channel-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(139, 92, 246, 0.15);
}

.modal-channel-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-channel-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--app-primary, #8B5CF6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.modal-channel-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.modal-ch-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 100px;
  text-transform: uppercase;
}

.modal-ch-badge.primary {
  background: rgba(83, 252, 24, 0.1);
  color: var(--kick-green);
  border: 1px solid rgba(83, 252, 24, 0.2);
}

/* ── Marriage Flow ── */
.marriage-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(139, 92, 246, 0.03);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.flow-step {
  flex: 1;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.flow-step:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-purple);
}

.flow-step-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--app-primary-dim);
  border-radius: var(--radius-sm);
  color: var(--app-primary);
  border: 1px solid var(--border-normal);
}

.flow-step-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.flow-step-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.flow-step-content p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.flow-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border-accent);
  flex-shrink: 0;
}

@media (max-width: 992px) {
  .marriage-flow {
    flex-direction: column;
    align-items: stretch;
  }
  .flow-connector {
    transform: rotate(90deg);
    margin: 0.25rem 0;
  }
}

/* Hide numeric input spinners */
/* Standard i Firefox */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Chrome, Safari, Edge i Opera */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

/* Back to Router Button */
.back-to-router-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  transition: var(--transition-base);
  cursor: pointer;
}

.back-to-router-btn:hover {
  background: var(--app-primary-dim);
  color: var(--kick-green) !important;
  border-color: var(--kick-green) !important;
  box-shadow: 0 0 12px rgba(83, 252, 24, 0.2);
  transform: scale(1.05);
}

/* ── Built-in Commands Category Tabs & Card Enhancements ── */
.btn-category {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-category:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-category.active {
  background: var(--app-primary-dim);
  color: var(--app-primary);
  border-color: var(--app-primary-dim);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.15);
}

.builtin-card {
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease !important;
}

.builtin-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.35) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(139, 92, 246, 0.1) !important;
}

/* ── Stat Indigo (nedostajuća klasa) ── */
.stat-indigo {
  background: rgba(99, 102, 241, 0.1);
}

/* ── Pagination Bar ── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 10px;
}

.pagination-bar__left {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 120px;
}

.pagination-bar__center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 220px;
}

.pagination-bar__right {
  flex: 1;
  min-width: 120px;
}

.pagination-bar__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.pagination-bar__info {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 100px;
  text-align: center;
  white-space: nowrap;
}

.pagination-bar__btn {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* ── Skeleton Loader ── */
@keyframes skeleton-shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.07) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--border-subtle);
}

.skeleton-row:last-child {
  border-bottom: none;
}

.skeleton-cell {
  height: 14px;
  border-radius: 6px;
}

.skeleton-cell--sm { width: 60px; }
.skeleton-cell--md { width: 120px; }
.skeleton-cell--lg { width: 200px; }
.skeleton-cell--xl { width: 280px; }
.skeleton-cell--full { flex: 1; }

.skeleton-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  gap: 1rem;
  text-align: center;
}

.empty-state__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--app-primary-dim);
  border: 1px solid var(--border-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--app-primary);
  opacity: 0.7;
}

.empty-state__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: -0.02em;
}

.empty-state__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

/* ── Alert Card (Chat Alertovi uniformni stil) ── */
.alert-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.alert-card:hover {
  border-color: var(--border-normal);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.alert-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.alert-card__title {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.alert-card__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.alert-card__extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.alert-card__extra-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Announces Interval Card ── */
.announces-interval-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-subtle);
  padding: 1rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition-fast);
}

.announces-interval-card:hover {
  border-color: var(--border-normal);
}

.announces-interval-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.announces-interval-card__title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* ── Announces List Item ── */
.announce-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.announce-item:hover {
  border-color: var(--border-normal);
}

.announce-item__text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

.announce-item__drag {
  color: var(--text-muted);
  cursor: grab;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.announce-item:hover .announce-item__drag {
  opacity: 1;
}

/* ── Overview Grid (poboljšan layout) ── */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
}

.ov-card--full {
  grid-column: 1 / -1;
}

/* ── Bot Status Row ── */
.bot-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.bot-status-row__label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.bot-status-row__value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ── Builtin Command Card (poboljšan) ── */
.builtin-cmd-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.builtin-cmd-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-normal);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.builtin-cmd-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.builtin-cmd-card__name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--kick-green);
}

.builtin-cmd-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.builtin-cmd-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.builtin-cmd-card__desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Override overview-grid original ── */
/* (nova klasa iznad zamenjuje staru definiciju) */

/* ── Responsive za pagination-bar ── */
@media (max-width: 600px) {
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .pagination-bar__left,
  .pagination-bar__center,
  .pagination-bar__right {
    flex: none;
    width: 100%;
    justify-content: center;
    min-width: unset;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Leaderboard Podium Enhanced ── */
.lb-podium {
  min-height: 180px;
}



/* ── Input Validation State ── */
.form-input.input-error {
  border-color: rgba(239, 68, 68, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08) !important;
}

.form-input.input-success {
  border-color: rgba(83, 252, 24, 0.4) !important;
  box-shadow: 0 0 0 3px rgba(83, 252, 24, 0.06) !important;
}

.field-error-msg {
  font-size: 0.75rem;
  color: #FCA5A5;
  margin-top: 3px;
  display: none;
}

.field-error-msg.visible {
  display: block;
}

/* ── Leaderboard Tabs (pill style) ── */
.lb-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 1.5rem;
  background: var(--bg-surface);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  max-width: fit-content;
}

.lb-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: none;
  color: var(--text-muted);
}

.lb-tab-btn:hover {
  background: var(--app-primary-dim);
  color: var(--text-secondary);
}

.lb-tab-btn.active {
  background: var(--app-gradient);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3), var(--shadow-purple);
}

/* ── Autosave indicator ── */
.autosave-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(83, 252, 24, 0.04);
  border: 1px solid rgba(83, 252, 24, 0.2);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  color: var(--kick-green);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ── Module status badges section ── */
.module-badges-section {
  font-size: 0.8rem;
  margin-bottom: 16px;
}

.module-badges-label {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.module-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* ── Config grid 2-col variant ── */
.config-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ── Panel header action wrap ── */
.panel-header-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.panel-header-toggle__label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════
   REFAKTORING PATCH — Layout, Modali, Moduli, Scroll
   ═══════════════════════════════════════════════════ */

/* ── Overview Grid — jednake visine kartica ── */
.overview-grid {
  align-items: stretch;
}

.ov-card {
  display: flex;
  flex-direction: column;
}

/* Live feed unutar ov-card treba da popunjava ostatak prostora */
#botLiveFeed {
  flex: 1;
  min-height: 180px;
  max-height: 340px;
  overflow-y: auto;
}

/* ── Topbar unapred ── */
.topbar {
  background: rgba(10, 10, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.12);
  box-shadow: 0 1px 0 rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.2);
}

.topbar-channel-badge {
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.18);
  transition: var(--transition-fast);
}

.topbar-channel-badge:hover {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.1);
}

.topbar-btn,
.topbar-hamburger {
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

/* ── Module badge — loading (spinner) stanje ── */
.module-status-badge.loading {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--app-primary);
  pointer-events: none;
  opacity: 0.75;
}

.module-status-badge.loading::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.5px solid rgba(139, 92, 246, 0.4);
  border-top-color: var(--app-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 4px;
  flex-shrink: 0;
}

/* ── Modal — close button rotate animacija ── */
.modal-close {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close:hover {
  transform: rotate(90deg) scale(1.1);
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
  color: #F87171 !important;
}

/* Modal zatvaranje animacija */
.modal-backdrop.closing .modal-box {
  transform: scale(0.95) translateY(8px);
  opacity: 0;
  transition: transform 0.2s var(--ease-smooth), opacity 0.2s ease;
}

.modal-backdrop.closing {
  opacity: 0;
  pointer-events: none !important;
  transition: opacity 0.22s ease;
}

/* Modal koji nije otvoren nikad ne blokira klikove */
.modal-backdrop:not(.open) {
  pointer-events: none !important;
}

/* ── Sortable table headers ── */
.sortable-th {
  cursor: pointer;
  user-select: none;
  position: relative;
  white-space: nowrap;
}

.sortable-th:hover {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.04);
}

.sortable-th .sort-icon {
  display: inline-flex;
  flex-direction: column;
  margin-left: 5px;
  opacity: 0.35;
  vertical-align: middle;
  gap: 2px;
}

.sortable-th.sort-asc .sort-icon,
.sortable-th.sort-desc .sort-icon {
  opacity: 1;
  color: var(--app-primary);
}

/* ── Scrollable queue list ── */
.song-queue-scroll {
  overflow-y: auto;
  max-height: 380px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.song-queue-scroll::-webkit-scrollbar {
  width: 5px;
}

.song-queue-scroll::-webkit-scrollbar-thumb {
  background: rgba(29, 185, 84, 0.4);
  border-radius: 4px;
}

/* ── Scroll indicator za live feed ── */
.live-feed-scroll-hint {
  position: absolute;
  bottom: 10px;
  right: 14px;
  background: rgba(139, 92, 246, 0.85);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  z-index: 5;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
  pointer-events: all;
  animation: slide-up 0.25s var(--ease-expo) forwards;
}

.live-feed-scroll-hint:hover {
  background: var(--app-primary);
  transform: translateY(-1px);
}

/* ── Live feed container (relative za hint button) ── */
.live-feed-wrap {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Spotify connect button pulse ── */
@keyframes spotify-pulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(29, 185, 84, 0.2); }
  50% { box-shadow: 0 4px 25px rgba(29, 185, 84, 0.5); }
}

#btnConnectSpotify:not([disabled]) {
  animation: spotify-pulse 2.5s ease-in-out infinite;
}

/* ── Economy Subpanel & Layout Enhancements ── */
.eco-subpanel {
  animation: panel-fade-in 0.22s var(--ease-smooth) forwards;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vinyl-disk-playing {
  animation: spin-slow 10s linear infinite;
}

/* ── Module Disabled State Overrides ── */
.panel.module-disabled-panel {
  position: relative !important;
  overflow: hidden !important;
}

.panel.module-disabled-panel > *:not(.module-disabled-overlay) {
  display: none !important;
}

.module-disabled-overlay {
  width: 100%;
  min-height: calc(100vh - 140px);
  background: #0a0614;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════
   PM-MODAL — Premium Modal Design System
   Consistent look for: Predlozi komandu, Pomoc, Docs, Referral
   ══════════════════════════════════════════════════════════ */

.pm-modal {
  background: linear-gradient(160deg, #0e0b1e 0%, #0a0717 100%);
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 24px 64px rgba(0,0,0,0.7),
    0 0 40px rgba(139,92,246,0.06);
  padding: 0;
}

/* ── PM Header ── */
.pm-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.015);
  position: relative;
}

.pm-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pm-icon-purple {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--app-primary);
}

.pm-icon-blue {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.28);
  color: #60A5FA;
}

.pm-icon-orange {
  background: rgba(234, 88, 12, 0.12);
  border: 1px solid rgba(234, 88, 12, 0.28);
  color: #FB923C;
}

.pm-icon-gold {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #FBBF24;
}

.pm-modal-title-wrap {
  flex: 1;
  min-width: 0;
}

.pm-modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

.pm-modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 3px 0 0 0;
  font-weight: 400;
}

.pm-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  flex-shrink: 0;
}

.pm-modal-close:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.28);
  color: #F87171;
  transform: rotate(90deg);
}

/* ── PM Body ── */
.pm-modal-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── PM Footer ── */
.pm-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.12);
}

.pm-btn-cancel {
  border-color: rgba(255,255,255,0.1) !important;
  color: var(--text-muted) !important;
  font-weight: 500;
}

.pm-btn-cancel:hover {
  border-color: rgba(255,255,255,0.2) !important;
  color: #fff !important;
}

.pm-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  padding: 9px 18px;
}

/* ── Shared helpers ── */
.pm-link {
  color: var(--app-primary);
  font-weight: 600;
  text-decoration: underline;
  transition: color 0.15s;
}

.pm-link:hover {
  color: #a78bfa;
}

.pm-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 7px 0;
  letter-spacing: 0.01em;
}

.pm-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pm-select {
  width: 100%;
}

.pm-textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
  padding: 10px 12px;
  line-height: 1.55;
}

.pm-code {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--app-primary);
}

/* ── Contact banner (Predlozi) ── */
.pm-contact-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-left: 3px solid var(--app-primary);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ── Help cards (Pomoc) ── */
.pm-help-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pm-help-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color 0.2s, background 0.2s;
}

.pm-help-card:hover {
  background: rgba(139, 92, 246, 0.04);
  border-color: rgba(139, 92, 246, 0.15);
}

.pm-help-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.pm-hci-green {
  background: rgba(83, 252, 24, 0.1);
  border: 1px solid rgba(83, 252, 24, 0.2);
  color: #53fc18;
}

.pm-hci-purple {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--app-primary);
}

.pm-hci-yellow {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.22);
  color: #FBBF24;
}

.pm-hci-blue {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.22);
  color: #60A5FA;
}

.pm-help-card-body {
  flex: 1;
  min-width: 0;
}

.pm-help-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.pm-help-card-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── Docs steps (Dokumentacija) ── */
.pm-docs-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pm-docs-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.045);
}

.pm-docs-step:last-child {
  border-bottom: none;
}

.pm-docs-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--app-gradient);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.pm-docs-step-content {
  flex: 1;
  min-width: 0;
}

.pm-docs-step-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 7px;
}

.pm-docs-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.pm-docs-list {
  margin: 8px 0 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.pm-code-block {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-left: 3px solid var(--app-primary);
  border-radius: 8px;
  padding: 9px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #c4b5fd;
  margin-top: 8px;
  letter-spacing: 0.02em;
}

/* ── Referral Header ── */
.pm-referral-header {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pm-referral-header-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 0%, rgba(234, 179, 8, 0.08) 0%, transparent 65%);
  pointer-events: none;
}

.pm-referral-header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 18px 24px;
  position: relative;
}

.pm-ref-pct {
  color: #53fc18;
  font-weight: 700;
}

/* ── Referral Stats Grid ── */
.pm-ref-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 520px) {
  .pm-ref-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pm-ref-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  transition: border-color 0.2s;
}

.pm-ref-stat:hover {
  border-color: rgba(139,92,246,0.2);
}

.pm-ref-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 5px;
}

.pm-ref-stat-green .pm-ref-stat-val { color: #53fc18; }
.pm-ref-stat-gold .pm-ref-stat-val   { color: #FBBF24; }
.pm-ref-stat-purple .pm-ref-stat-val { color: #a78bfa; }

.pm-ref-stat-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Referral Link Box ── */
.pm-ref-link-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-md);
  padding: 16px;
}

.pm-ref-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.pm-ref-code-input {
  flex: 1;
  font-weight: 700;
  color: #53fc18 !important;
  letter-spacing: 1.5px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.pm-ref-copy-btn {
  white-space: nowrap;
  font-weight: 600;
  padding: 8px 14px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pm-ref-link-full {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: #a78bfa;
  word-break: break-all;
}

/* ── Referral Custom Box ── */
.pm-ref-custom-box {
  background: rgba(139, 92, 246, 0.045);
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pm-ref-custom-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.pm-ref-custom-body {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pm-ref-email-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35) !important;
  color: #a78bfa !important;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.pm-ref-email-btn:hover {
  background: var(--app-primary) !important;
  color: #ffffff !important;
  border-color: var(--app-primary) !important;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.4);
  transform: translateY(-1px);
}

/* ── Referral Rewards ── */
.pm-ref-rewards {
  margin-top: 4px;
}

.pm-ref-rewards-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px 0;
}

.pm-ref-rewards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.pm-ref-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 18px;
  font-size: 0.83rem;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255,255,255,0.07);
}

/* ── Referral Withdraw ── */
.pm-ref-withdraw {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 16px;
  margin-top: 4px;
}

.pm-ref-withdraw-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.pm-ref-withdraw-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}