/* ============================================================
   Whats8eckPush – Ultra-Modern Dashboard Design System
   Sleek Dark Glassmorphism, Aurora Ambient Glow & Micro-Interactions
   ============================================================ */

:root {
  /* Grund- & Hintergrundfarben */
  --color-bg-deep: #07080d;
  --color-bg-primary: #0b0d14;
  --color-bg-secondary: #111420;
  --color-bg-card: rgba(17, 21, 34, 0.72);
  --color-bg-card-hover: rgba(24, 30, 48, 0.85);
  --color-bg-glass: rgba(255, 255, 255, 0.03);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-subtle: rgba(255, 255, 255, 0.04);
  --color-border-glow: rgba(34, 197, 94, 0.35);

  /* WhatsApp & Neon Akzente */
  --color-accent: #22c55e;
  --color-accent-light: #4ade80;
  --color-accent-dark: #16a34a;
  --color-accent-glow: rgba(34, 197, 94, 0.22);
  --color-accent-subtle: rgba(34, 197, 94, 0.1);

  /* Sekundär- & Gradient-Töne */
  --color-indigo: #6366f1;
  --color-indigo-glow: rgba(99, 102, 241, 0.25);
  --color-violet: #8b5cf6;
  --color-cyan: #06b6d4;

  /* Typografie-Farben */
  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-text-dim: #475569;

  /* Status-Farben */
  --color-status-connected: #22c55e;
  --color-status-connecting: #f59e0b;
  --color-status-disconnected: #64748b;
  --color-status-error: #ef4444;

  --color-status-connected-bg: rgba(34, 197, 94, 0.12);
  --color-status-connecting-bg: rgba(245, 158, 11, 0.12);
  --color-status-disconnected-bg: rgba(100, 116, 139, 0.14);
  --color-status-error-bg: rgba(239, 68, 68, 0.12);

  /* Typografie */
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radien */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Schatten & Tiefen */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow-accent: 0 0 24px var(--color-accent-glow);

  /* Animationen */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 240ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 350ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --sidebar-width: 270px;
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-deep);
  color: var(--color-text-primary);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Floating Glow Orbs */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.28;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
  top: -100px;
  left: 10%;
  animation-duration: 22s;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--color-indigo) 0%, transparent 70%);
  top: 40%;
  right: -100px;
  animation-duration: 28s;
  animation-delay: -5s;
}

.orb-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--color-violet) 0%, transparent 70%);
  bottom: -100px;
  left: 30%;
  animation-duration: 24s;
  animation-delay: -10s;
}

@keyframes floatOrb {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 70px) scale(0.95); }
}

/* ============================================================
   Typografie
   ============================================================ */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

h2 { font-size: 1.75rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

.gradient-text {
  background: linear-gradient(135deg, var(--color-accent-light) 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-mono {
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

/* ============================================================
   Glassmorphism Surfaces
   ============================================================ */

.glass {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.glass:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.btn:hover:not(:disabled) svg {
  transform: scale(1.1);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(40%);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: #041f0e;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--color-accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-accent-light) 0%, var(--color-accent) 100%);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.btn-glow {
  animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 14px var(--color-accent-glow); }
  50%      { box-shadow: 0 6px 28px rgba(34, 197, 94, 0.45); }
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--color-text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

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

.btn-glass:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
}

/* ============================================================
   Toast Notifications
   ============================================================ */

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  padding: 14px 18px;
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(24px);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: #fff;
  margin-bottom: 2px;
}

.toast-msg {
  font-size: 0.84rem;
  color: var(--color-text-secondary);
}

.toast.success { border-color: rgba(34, 197, 94, 0.4); }
.toast.error   { border-color: rgba(239, 68, 68, 0.4); }
.toast.info    { border-color: rgba(99, 102, 241, 0.4); }

/* ============================================================
   Login-Overlay
   ============================================================ */

.overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(13, 17, 28, 0.85) 0%, rgba(7, 8, 13, 0.98) 100%);
  backdrop-filter: blur(28px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 44px 38px;
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 60px rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95) translateY(15px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

.brand-icon-box {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #041f0e;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  stroke: #072212;
  fill: #072212;
}

.brand-version {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.login-header h1 {
  font-size: 2rem;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.login-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 30px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  color: var(--color-text-muted);
  pointer-events: none;
}

.input-prefix {
  position: absolute;
  left: 14px;
  font-size: 1.1rem;
  pointer-events: none;
}

.input-wrapper input {
  padding-left: 44px !important;
}

.form-group {
  margin-bottom: 22px;
  text-align: left;
}

.form-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.label-info {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

input[type="text"],
input[type="password"],
textarea,
select.select-input {
  width: 100%;
  background: rgba(14, 18, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--color-accent);
  background: rgba(18, 24, 40, 0.95);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

input::placeholder, textarea::placeholder {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

.error-msg {
  color: #f87171;
  font-size: 0.85rem;
  margin-top: 14px;
  background: rgba(239, 68, 68, 0.1);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.25);
  text-align: left;
}

.login-footer {
  margin-top: 26px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* ============================================================
   App Layout
   ============================================================ */

.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.mobile-header {
  display: none;
}

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  border-radius: 0;
  border-left: none;
  border-top: none;
  border-bottom: none;
  border-right: 1px solid var(--color-border);
  background: rgba(11, 14, 23, 0.78);
  backdrop-filter: blur(28px);
  z-index: 100;
}

.sidebar-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border-subtle);
  margin-bottom: 20px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-container {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border: 1px solid rgba(34, 197, 94, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo-icon {
  font-size: 1.35rem;
  filter: drop-shadow(0 0 8px var(--color-accent));
}

.logo-pulse {
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-accent);
  opacity: 0.4;
  animation: logoPulse 3s infinite ease-out;
}

@keyframes logoPulse {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 0; }
}

.logo-meta {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

.system-status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--color-text-secondary);
}

.mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 6px var(--color-accent);
}

.sidebar-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 12px 10px 8px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon-wrapper svg {
  width: 19px;
  height: 19px;
  stroke: var(--color-text-muted);
  transition: stroke var(--transition-fast);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav-item:hover .nav-icon-wrapper svg {
  stroke: #fff;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(99, 102, 241, 0.06) 100%);
  color: #fff;
  border: 1px solid rgba(34, 197, 94, 0.28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.nav-item.active .nav-icon-wrapper svg {
  stroke: var(--color-accent);
}

.nav-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-status-disconnected);
  margin-left: auto;
  transition: background var(--transition-fast);
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.sidebar-link-item svg {
  width: 15px;
  height: 15px;
}

.sidebar-link-item .external-icon {
  margin-left: auto;
  opacity: 0.5;
  font-size: 0.85rem;
}

.sidebar-link-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-secondary);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.connection-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.status-indicator-dot {
  position: relative;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}

.status-ping {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  opacity: 0;
}

.connection-badge.connected .status-dot {
  background: var(--color-status-connected);
  box-shadow: 0 0 8px var(--color-status-connected);
}
.connection-badge.connected .status-ping {
  border: 2px solid var(--color-status-connected);
  animation: pingAnimation 2s infinite cubic-bezier(0, 0, 0.2, 1);
}

.connection-badge.connecting .status-dot {
  background: var(--color-status-connecting);
  box-shadow: 0 0 8px var(--color-status-connecting);
}
.connection-badge.connecting .status-ping {
  border: 2px solid var(--color-status-connecting);
  animation: pingAnimation 1.2s infinite cubic-bezier(0, 0, 0.2, 1);
}

.connection-badge.disconnected .status-dot {
  background: var(--color-status-disconnected);
}

.connection-badge.error .status-dot {
  background: var(--color-status-error);
  box-shadow: 0 0 8px var(--color-status-error);
}

@keyframes pingAnimation {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.status-info-col {
  display: flex;
  flex-direction: column;
}

.status-title {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.status-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: #fff;
}

.btn-logout {
  width: 100%;
  justify-content: center;
}

/* ============================================================
   Main Content Layout
   ============================================================ */

.main-content {
  flex: 1;
  padding: 34px 40px 60px;
  max-width: 1280px;
  margin: 0 auto;
  width: calc(100% - var(--sidebar-width));
}

.page {
  display: none;
  animation: fadeInPage 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.page.active {
  display: block;
}

@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.page-title-group h2 {
  font-size: 1.85rem;
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
}

.refresh-icon {
  width: 15px;
  height: 15px;
}

/* ============================================================
   Stats Grid
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.stat-connection:hover::before { background: var(--color-accent); }
.stat-uptime:hover::before     { background: var(--color-cyan); }
.stat-sent:hover::before       { background: var(--color-indigo); }
.stat-failed:hover::before     { background: var(--color-status-error); }

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.stat-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrapper svg {
  width: 20px;
  height: 20px;
}

.icon-connection {
  background: rgba(34, 197, 94, 0.12);
  color: var(--color-accent);
}

.icon-time {
  background: rgba(6, 182, 212, 0.12);
  color: var(--color-cyan);
}

.icon-sent {
  background: rgba(99, 102, 241, 0.12);
  color: var(--color-indigo);
}

.icon-failed {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-status-error);
}

.stat-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  width: fit-content;
}

.status-pill.connected {
  background: var(--color-status-connected-bg);
  color: var(--color-status-connected);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-pill.connecting {
  background: var(--color-status-connecting-bg);
  color: var(--color-status-connecting);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.disconnected {
  background: var(--color-status-disconnected-bg);
  color: var(--color-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-pill.error {
  background: var(--color-status-error-bg);
  color: var(--color-status-error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================================
   Action & Recent Cards
   ============================================================ */

.action-card, .recent-card {
  padding: 26px 30px;
  margin-bottom: 26px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-subtitle {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.socket-info-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-indigo);
  box-shadow: 0 0 8px var(--color-indigo);
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ============================================================
   Verbindungsseite
   ============================================================ */

.connection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.connection-status-card, .qr-card {
  padding: 30px;
}

.security-chip {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.status-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 0 10px;
}

.status-indicator {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.status-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  transition: all var(--transition-base);
}

.status-center-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
  transition: all var(--transition-base);
}

.icon-svg-status {
  width: 28px;
  height: 28px;
}

.status-label-large {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Radar Animation bei Verbindungsaufbau */
.radar-emitter {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.radar-wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--color-status-connecting);
  opacity: 0;
}

.status-indicator.connecting .radar-wave.wave-1 {
  animation: radarWave 2s infinite ease-out;
}

.status-indicator.connecting .radar-wave.wave-2 {
  animation: radarWave 2s infinite 0.75s ease-out;
}

.status-indicator.connecting .status-ring {
  border-color: var(--color-status-connecting);
  animation: spinSlow 12s linear infinite;
}

.status-indicator.connected .status-ring {
  border-style: solid;
  border-color: var(--color-status-connected);
  box-shadow: 0 0 30px var(--color-accent-glow);
}

.status-indicator.connected .status-center-icon {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.status-indicator.disconnected .status-center-icon {
  color: var(--color-text-muted);
}

.status-indicator.error .status-ring {
  border-color: var(--color-status-error);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.25);
}

@keyframes radarWave {
  0%   { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.status-meta-card {
  width: 100%;
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
}

.meta-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.meta-divider {
  width: 1px;
  background: var(--color-border);
}

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

.meta-data {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
}

/* ============================================================
   QR Code Scanner Card
   ============================================================ */

.qr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.qr-secure-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.qr-secure-badge svg {
  width: 14px;
  height: 14px;
}

.qr-frame-wrapper {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 24px;
  background: rgba(8, 10, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

/* Futuristic Scanner Corners */
.scanner-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--color-accent);
  pointer-events: none;
}

.corner-tl { top: 8px; left: 8px; border-top: 2px solid; border-left: 2px solid; }
.corner-tr { top: 8px; right: 8px; border-top: 2px solid; border-right: 2px solid; }
.corner-bl { bottom: 8px; left: 8px; border-bottom: 2px solid; border-left: 2px solid; }
.corner-br { bottom: 8px; right: 8px; border-bottom: 2px solid; border-right: 2px solid; }

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--color-accent) 50%, transparent 100%);
  box-shadow: 0 0 12px var(--color-accent);
  opacity: 0;
  pointer-events: none;
}

.qr-frame-wrapper.scanning .scanner-laser {
  opacity: 1;
  animation: laserScan 2.4s infinite ease-in-out;
}

@keyframes laserScan {
  0%, 100% { top: 12px; }
  50%      { top: calc(100% - 14px); }
}

.qr-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
}

.qr-placeholder-icon {
  width: 54px;
  height: 54px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  opacity: 0.6;
}

.qr-placeholder-icon svg {
  width: 100%;
  height: 100%;
}

.placeholder-main {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.placeholder-sub {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.qr-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 10px;
}

.qr-connected {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.success-checkmark-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-accent-subtle);
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 0 24px var(--color-accent-glow);
}

.success-checkmark-box svg {
  width: 32px;
  height: 32px;
}

.qr-connected h4 {
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 4px;
}

.qr-connected p {
  font-size: 0.84rem;
  color: var(--color-text-secondary);
}

.qr-guide-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--color-text-secondary);
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   Nachrichtenseite
   ============================================================ */

.messages-grid {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 24px;
}

.send-form-card {
  padding: 28px;
  height: fit-content;
}

.badge-accent {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.quick-templates {
  margin-bottom: 20px;
}

.templates-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.template-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.label-with-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.char-counter {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}

.char-bar-wrapper {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  margin-top: 6px;
  overflow: hidden;
}

.char-bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  transition: width 0.15s ease, background-color 0.2s ease;
}

.send-result {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.4;
  animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.send-result.success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: var(--color-accent-light);
}

.send-result.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

/* History & Filters */
.history-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.filter-bar {
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.filter-title-group h3 {
  font-size: 1.15rem;
}

.filter-subtitle {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.select-wrapper {
  position: relative;
  min-width: 190px;
}

.select-input {
  padding: 8px 14px;
  font-size: 0.88rem;
  background: rgba(14, 18, 30, 0.9);
  cursor: pointer;
}

.message-history {
  padding: 20px;
}

.messages-list, .message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}

.message-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.message-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(2px);
}

.msg-status-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-recipient {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.msg-content {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin-bottom: 8px;
  word-break: break-word;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
}

.msg-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.msg-badge.sent      { background: var(--color-status-connected-bg); color: var(--color-status-connected); }
.msg-badge.pending   { background: var(--color-status-connecting-bg); color: var(--color-status-connecting); }
.msg-badge.sending   { background: rgba(99, 102, 241, 0.15); color: var(--color-indigo); }
.msg-badge.failed    { background: var(--color-status-error-bg); color: var(--color-status-error); }
.msg-badge.cancelled { background: var(--color-status-disconnected-bg); color: var(--color-text-secondary); }

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

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
  gap: 8px;
}

.empty-icon {
  font-size: 2rem;
  opacity: 0.5;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--color-text-secondary);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border-subtle);
}

.page-info-chip {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* ============================================================
   Scrollbars
   ============================================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

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

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

/* ============================================================
   Responsive Media Queries
   ============================================================ */

@media (max-width: 1080px) {
  .messages-grid {
    grid-template-columns: 1fr;
  }
  .connection-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 260px;
  }

  .app {
    flex-direction: column;
  }

  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 105;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mini-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
  }

  .mobile-menu-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
  }

  .mobile-menu-btn svg {
    width: 24px;
    height: 24px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -100%;
    transition: left var(--transition-smooth);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.8);
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .main-content {
    width: 100%;
    padding: 20px 16px 40px;
  }

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

/* ============================================================
   Integration & KI-Prompt Styles
   ============================================================ */

.nav-badge-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(99, 102, 241, 0.3));
  color: var(--color-accent-light);
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: auto;
}

.integration-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.prompt-card {
  padding: 30px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.08);
}

.prompt-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-indigo) 50%, var(--color-violet) 100%);
}

.prompt-title-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ai-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(34, 197, 94, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}

.prompt-content-box {
  background: rgba(8, 10, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  max-height: 420px;
  overflow-y: auto;
}

.prompt-pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}

.dynamic-server-url {
  color: var(--color-accent-light);
  font-weight: 600;
}

.code-examples-card {
  padding: 30px;
}

.code-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: 12px;
}

.code-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.code-tab:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  transform: translateY(-1px);
}

.code-tab.active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(99, 102, 241, 0.15) 100%);
  color: #fff;
  border-color: var(--color-accent);
  box-shadow: 0 0 14px var(--color-accent-glow);
}

.tab-pane {
  display: none;
  background: rgba(8, 10, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  overflow-x: auto;
}

.tab-pane.active {
  display: block;
  animation: fadeInDown 0.25s ease;
}

.code-block {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e2e8f0;
}

