/* ===== DESIGN TOKENS (LIGHT THEME - DEFAULT) ===== */
:root {
  --font-primary: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colors */
  --color-bg: #f4f6fc;
  --color-bg-gradient: radial-gradient(circle at 50% 0%, #e5e9fd 0%, #f4f6fc 70%);
  --color-surface: rgba(255, 255, 255, 0.75);
  --color-surface-hover: rgba(255, 255, 255, 0.95);
  --color-border: rgba(0, 0, 0, 0.06);
  --color-border-hover: rgba(108, 92, 231, 0.35);

  --color-primary: #6c5ce7;
  --color-primary-gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  --color-primary-light: rgba(108, 92, 231, 0.08);
  --color-primary-glow: rgba(108, 92, 231, 0.2);

  --color-success: #00b894;
  --color-success-light: rgba(0, 184, 148, 0.1);
  --color-warning: #f1c40f;
  --color-warning-light: rgba(241, 196, 15, 0.12);
  --color-danger: #d63031;
  --color-danger-light: rgba(214, 48, 49, 0.1);
  --color-info: #0984e3;

  --color-text: #2d3748;
  --color-text-secondary: #4a5568;
  --color-text-muted: #a0aec0;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-blur: 20px;

  /* Shadows & Glows */
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.08);
  --shadow-primary-glow: 0 0 20px rgba(108, 92, 231, 0.2);
  --shadow-success-glow: 0 0 20px rgba(0, 184, 148, 0.2);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --sidebar-width: 260px;
  --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ===== DESIGN TOKENS (DARK THEME - OPTIONAL) ===== */
body.dark-theme {
  --color-bg: #070913;
  --color-bg-gradient: radial-gradient(circle at 50% 0%, #15103c 0%, #070913 70%);
  --color-surface: rgba(15, 18, 36, 0.7);
  --color-surface-hover: rgba(25, 29, 56, 0.85);
  --color-border: rgba(255, 255, 255, 0.07);
  --color-border-hover: rgba(108, 92, 231, 0.4);

  --color-primary: #7c4dff;
  --color-primary-gradient: linear-gradient(135deg, #7c4dff 0%, #b388ff 100%);
  --color-primary-light: rgba(124, 77, 255, 0.15);
  --color-primary-glow: rgba(124, 77, 255, 0.4);

  --color-success: #00e676;
  --color-success-light: rgba(0, 230, 118, 0.15);
  --color-warning: #ffd600;
  --color-warning-light: rgba(255, 214, 0, 0.15);
  --color-danger: #ff1744;
  --color-danger-light: rgba(255, 23, 68, 0.15);
  --color-info: #00e5ff;

  --color-text: #f1f3f9;
  --color-text-secondary: #a0aec0;
  --color-text-muted: #718096;

  --glass-bg: rgba(15, 18, 36, 0.5);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-blur: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-primary-glow: 0 0 20px rgba(124, 77, 255, 0.25);
  --shadow-success-glow: 0 0 20px rgba(0, 230, 118, 0.25);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; overflow-x: hidden; }
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body {
  font-family: var(--font-primary);
  background: var(--color-bg);
  background-image: var(--color-bg-gradient);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: clip;
  transition: background var(--transition), color var(--transition);
}

/* Background glowing blobs */
body::before {
  content: ''; position: absolute; top: -20%; left: -10%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.18) 0%, rgba(162, 155, 254, 0.05) 50%, transparent 70%);
  z-index: -1; pointer-events: none;
  filter: blur(60px);
  animation: float-blob 20s infinite alternate ease-in-out;
}
body.dark-theme::before {
  background: radial-gradient(circle, rgba(124, 77, 255, 0.25) 0%, rgba(179, 136, 255, 0.05) 50%, transparent 70%);
}

body::after {
  content: ''; position: absolute; bottom: -10%; right: -10%; width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(9, 132, 227, 0.15) 0%, rgba(116, 185, 255, 0.05) 50%, transparent 70%);
  z-index: -1; pointer-events: none;
  filter: blur(80px);
  animation: float-blob-reverse 25s infinite alternate ease-in-out;
}
body.dark-theme::after {
  background: radial-gradient(circle, rgba(0, 229, 255, 0.2) 0%, rgba(128, 222, 234, 0.05) 50%, transparent 70%);
}

@keyframes float-blob {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.1); }
}
@keyframes float-blob-reverse {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-80px, -50px) scale(1.05); }
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: #8395a7; }
body.dark-theme a:hover { color: #b388ff; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--color-text-secondary);
  background: var(--glass-bg);
  outline: none;
}
.theme-toggle-btn:hover {
  transform: scale(1.05) rotate(15deg);
  color: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-primary-glow);
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  transition: background var(--transition), border-color var(--transition);
}

/* ===== VIEWS ===== */
.view { display: none; min-height: 100vh; }
.view.active { display: flex; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 24px; border: none; border-radius: var(--radius-sm);
  font-weight: 600; cursor: pointer; transition: all var(--transition);
  font-size: 0.93rem; letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--color-primary-gradient); color: #fff;
  box-shadow: var(--shadow-primary-glow);
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 28px rgba(108, 92, 231, 0.4);
  transform: translateY(-2px);
}
body.dark-theme .btn-primary:hover {
  box-shadow: 0 0 28px rgba(124, 77, 255, 0.45);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: rgba(0, 0, 0, 0.02); color: var(--color-text-secondary); border: 1px solid var(--color-border); }
body.dark-theme .btn-ghost { background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { background: var(--color-primary-light); color: var(--color-primary); border-color: var(--color-primary); }
body.dark-theme .btn-ghost:hover { color: #fff; }
.btn-danger {
  background: linear-gradient(135deg, #ff5252 0%, #ff1744 100%); color: #fff;
  box-shadow: 0 0 15px rgba(255, 23, 68, 0.15);
}
.btn-danger:hover { filter: brightness(1.15); transform: translateY(-2px); box-shadow: 0 0 25px rgba(255, 23, 68, 0.35); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: 8px; }
.btn-full { width: 100%; justify-content: center; }
.btn-loader { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; }

/* ===== FORM INPUTS ===== */
.input-group { margin-bottom: 20px; }
.input-group label {
  display: block; margin-bottom: 8px;
  font-size: 0.85rem; font-weight: 600; color: var(--color-text-secondary);
  letter-spacing: 0.03em; text-transform: uppercase;
}
.input-group input, .input-group textarea, .input-group select {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--color-border); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95); color: var(--color-text);
  transition: all var(--transition);
  outline: none; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}
body.dark-theme .input-group input, body.dark-theme .input-group textarea, body.dark-theme .input-group select {
  background: rgba(10, 12, 22, 0.8);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}
.input-group input:focus, .input-group textarea:focus, .input-group select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
  background: #fff;
}
body.dark-theme .input-group input:focus, body.dark-theme .input-group textarea:focus, body.dark-theme .input-group select:focus {
  background: rgba(15, 18, 36, 0.9);
  box-shadow: 0 0 0 3px var(--color-primary-light), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}
.input-group input::placeholder { color: var(--color-text-muted); }

/* ===== LOGIN CARD ===== */
.login-container {
  width: 100%; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 1;
}
.login-card {
  width: 100%; max-width: 440px; padding: 48px 40px;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--glass-border);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative; overflow: hidden;
}
.login-card::after {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.03) 0%, transparent 50%);
  pointer-events: none; z-index: -1;
}
body.dark-theme .login-card::after {
  background: radial-gradient(circle, rgba(124, 77, 255, 0.05) 0%, transparent 50%);
}
.login-logo { text-align: center; margin-bottom: 36px; }
.logo-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  background: var(--color-primary-gradient); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: var(--shadow-primary-glow);
}
.logo-icon svg { width: 32px; height: 32px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15)); }
.logo-icon.small { width: 38px; height: 38px; margin: 0; }
.logo-icon.small svg { width: 20px; height: 20px; }
.login-logo h1 { font-size: 1.8rem; font-weight: 700; color: var(--color-text); letter-spacing: -0.02em; }
body.dark-theme .login-logo h1 { color: #fff; }
.login-subtitle { font-size: 0.9rem; color: var(--color-text-secondary); margin-top: 6px; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width); padding: 32px 20px;
  display: flex; flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--glass-border);
  z-index: 100;
}
.sidebar-header { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; padding: 0 4px; }
.sidebar-title { font-weight: 700; font-size: 1.15rem; color: var(--color-text); letter-spacing: -0.01em; }
body.dark-theme .sidebar-title { color: #fff; }
.sidebar-menu { list-style: none; flex: 1; }
.menu-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
  color: var(--color-text-secondary); margin-bottom: 6px; font-size: 0.95rem;
  font-weight: 500;
}
.menu-item svg { width: 22px; height: 22px; flex-shrink: 0; opacity: 0.7; transition: transform var(--transition); }
.menu-item:hover { background: rgba(0, 0, 0, 0.02); color: var(--color-primary); }
body.dark-theme .menu-item:hover { background: rgba(255, 255, 255, 0.03); color: #fff; }
.menu-item:hover svg { transform: translateX(2px); opacity: 1; }
.menu-item.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, #8c7ae6 100%);
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(108, 92, 231, 0.35);
  border-left: 4px solid #fff;
}
.menu-item.active svg { opacity: 1; }
.sidebar-footer { padding-top: 20px; border-top: 1px solid var(--color-border); }
.user-info { margin-bottom: 14px; padding: 0 4px; }
.user-name { display: block; font-weight: 600; font-size: 0.95rem; color: var(--color-text); }
body.dark-theme .user-name { color: #fff; }
.user-role { font-size: 0.75rem; text-transform: uppercase; margin-top: 2px; }

/* ===== MAIN CONTENT ===== */
.main-content { margin-left: var(--sidebar-width); padding: 32px 48px; flex: 1; }
.content-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px; padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.content-header h2 {
  font-size: 2.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-text) 20%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}
body.dark-theme .content-header h2 {
  background: linear-gradient(135deg, #fff 30%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.status-badge {
  display: none !important; /* Ocultado por redundancia con las tarjetas de estadísticas */
  align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 30px;
  background: var(--color-success-light); color: var(--color-success);
  font-size: 0.85rem; font-weight: 600;
  border: 1px solid rgba(0, 184, 148, 0.15);
  box-shadow: var(--shadow-sm);
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-success); box-shadow: var(--shadow-success-glow);
  animation: pulse 2s infinite;
}

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.4s ease-out; }
.page-toolbar { margin-bottom: 24px; display: flex; gap: 12px; }

/* ===== INSTANCES GRID & PREMIUM CARDS ===== */
.instances-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); 
  gap: 28px; 
}
.instance-card {
  background: var(--color-surface); 
  border-radius: var(--radius-lg);
  padding: 28px; 
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.05); 
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative; 
  overflow: hidden;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 100% 100%, rgba(108, 92, 231, 0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  transition: all var(--transition);
}
.instance-card.connected .card-glow {
  background: radial-gradient(circle at 100% 100%, rgba(0, 184, 148, 0.04) 0%, transparent 60%);
}
.instance-card:hover .card-glow {
  transform: scale(1.1);
  opacity: 1;
}
.instance-header, .instance-details-grid, .quota-container, .instance-actions {
  position: relative;
  z-index: 1;
}
.instance-card:hover {
  box-shadow: var(--shadow-lg), 0 0 25px rgba(108, 92, 231, 0.05);
  transform: translateY(-6px);
  border-color: var(--color-border-hover);
}
.instance-card.connected:hover {
  box-shadow: var(--shadow-lg), 0 0 25px rgba(0, 184, 148, 0.08);
}
.instance-card::before {
  content: ''; 
  position: absolute; 
  top: 0; 
  left: 0; 
  right: 0;
  height: 5px; 
  background: linear-gradient(90deg, var(--color-warning), var(--color-danger));
  transition: all var(--transition);
}
.instance-card.connected::before { 
  background: linear-gradient(90deg, var(--color-success), var(--color-info)); 
}
.instance-card.connecting::before { 
  background: linear-gradient(90deg, var(--color-warning), #fd79a8); 
}

.instance-header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  margin-bottom: 24px; 
}
.instance-name { 
  font-weight: 700; 
  font-size: 1.22rem; 
  color: var(--color-text); 
  letter-spacing: -0.015em;
}
body.dark-theme .instance-name { color: #fff; }
.instance-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px; 
  border-radius: 30px;
  font-size: 0.72rem; 
  font-weight: 700; 
  text-transform: uppercase;
  letter-spacing: 0.06em; 
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
}
.instance-status.connected { 
  background: var(--color-success-light); 
  color: var(--color-success); 
  border-color: rgba(0, 184, 148, 0.18); 
}
.instance-status.disconnected { 
  background: var(--color-danger-light); 
  color: var(--color-danger); 
  border-color: rgba(214, 48, 49, 0.18); 
}
.instance-status.pairing { 
  background: var(--color-warning-light); 
  color: var(--color-warning); 
  border-color: rgba(241, 196, 15, 0.18); 
}

/* Pulsing small dot inside connected badge */
.pulse-dot-small {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-success);
  display: inline-block;
  animation: pulse-small 1.5s infinite ease-in-out;
}
@keyframes pulse-small {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px var(--color-success); }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.instance-details { 
  margin-bottom: 24px; 
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.instance-detail {
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  padding: 6px 0;
  font-size: 0.88rem; 
  border-bottom: 1px solid var(--color-border);
}
.instance-detail:last-of-type { border-bottom: none; }
.card-icon {
  vertical-align: middle; 
  margin-right: 8px; 
  opacity: 0.5;
  color: var(--color-text-secondary);
  transition: transform var(--transition), opacity var(--transition);
}
.instance-detail:hover .card-icon {
  transform: scale(1.15);
  opacity: 0.8;
  color: var(--color-primary);
}
.detail-label { 
  display: inline-flex;
  align-items: center;
  color: var(--color-text-secondary); 
  font-weight: 500;
}
.detail-value { 
  font-weight: 600; 
  color: var(--color-text); 
}
body.dark-theme .detail-value { color: #fff; }

/* Quota progress bar styling */
.quota-container {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
}
.quota-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.82rem;
}
.quota-value {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text);
}
body.dark-theme .quota-value { color: #fff; }
.quota-bar-bg {
  width: 100%;
  height: 6px;
  border-radius: 10px;
  background: var(--color-border);
  overflow: hidden;
  position: relative;
}
.quota-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-info) 100%);
  transition: width 0.6s cubic-bezier(0.1, 1, 0.1, 1);
  box-shadow: 0 0 8px rgba(108, 92, 231, 0.4);
}
.instance-card.connected .quota-bar-fill {
  background: linear-gradient(90deg, var(--color-success) 0%, var(--color-info) 100%);
  box-shadow: 0 0 8px rgba(0, 184, 148, 0.3);
}

.instance-actions { 
  display: flex; 
  gap: 8px; 
  flex-wrap: wrap; 
  margin-top: 18px;
  border-top: 1px solid var(--color-border);
  padding-top: 18px;
}

/* Premium helper buttons */
.btn-info {
  background: linear-gradient(135deg, #0984e3 0%, #74b9ff 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(9, 132, 227, 0.2);
}
.btn-info:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(9, 132, 227, 0.35);
}
.btn-ghost-style {
  background: rgba(241, 196, 15, 0.05) !important;
  color: var(--color-warning) !important;
  border: 1px solid rgba(241, 196, 15, 0.25) !important;
}
.btn-ghost-style:hover {
  background: var(--color-warning) !important;
  color: #000 !important;
  border-color: var(--color-warning) !important;
  box-shadow: 0 4px 14px rgba(241, 196, 15, 0.25);
  transform: translateY(-2px);
}
.btn-danger-hover {
  background: transparent !important;
  color: var(--color-danger) !important;
  border: 1px solid rgba(214, 48, 49, 0.25) !important;
}
.btn-danger-hover:hover {
  background: var(--color-danger) !important;
  color: #fff !important;
  border-color: var(--color-danger) !important;
  box-shadow: 0 4px 14px rgba(214, 48, 49, 0.25);
  transform: translateY(-2px);
}

/* Global Stats Widget */
.instances-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
  width: 100%;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.stat-content {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-top: 4px;
}
body.dark-theme .stat-value { color: #fff; }
.stat-value-sub {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-left: 2px;
}

/* Stat card colors */
.stat-card.blue {
  border-left: 4px solid var(--color-info);
}
.stat-card.blue .stat-icon {
  background: rgba(9, 132, 227, 0.1);
  color: var(--color-info);
}
.stat-card.green {
  border-left: 4px solid var(--color-success);
}
.stat-card.green .stat-icon {
  background: rgba(0, 184, 148, 0.1);
  color: var(--color-success);
}
.stat-card.orange {
  border-left: 4px solid var(--color-warning);
}
.stat-card.orange .stat-icon {
  background: rgba(241, 196, 15, 0.1);
  color: var(--color-warning);
}
.stat-card.animate-glowing {
  animation: stat-glow 2s infinite alternate ease-in-out;
}
@keyframes stat-glow {
  0% { box-shadow: 0 4px 15px rgba(241, 196, 15, 0.05); }
  100% { box-shadow: 0 4px 25px rgba(241, 196, 15, 0.2); border-color: #f39c12; }
}

/* Instance Card Identity & Avatar */
.instance-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.instance-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}
.instance-avatar.connected {
  background: linear-gradient(135deg, var(--color-success) 0%, var(--color-info) 100%);
}
.instance-avatar.disconnected {
  background: linear-gradient(135deg, var(--color-danger) 0%, #ff7675 100%);
}
.instance-avatar.connecting {
  background: linear-gradient(135deg, var(--color-warning) 0%, #fd79a8 100%);
}
.instance-title-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 140px;
}
.instance-creation {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* 2x2 Metric Details Grid */
.instance-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.metric-box {
  background: rgba(0, 0, 0, 0.015);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--transition);
}
body.dark-theme .metric-box {
  background: rgba(255, 255, 255, 0.01);
}
.metric-box:hover {
  background: rgba(108, 92, 231, 0.02);
  border-color: rgba(108, 92, 231, 0.15);
  transform: translateY(-1px);
}
.metric-label {
  font-size: 0.76rem;
  color: var(--color-text-secondary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.metric-icon {
  opacity: 0.6;
  color: var(--color-text-secondary);
}
.metric-box:hover .metric-icon {
  color: var(--color-primary);
  opacity: 0.9;
}
.metric-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-text);
}
body.dark-theme .metric-value {
  color: #fff;
}
.metric-value.status-queue.has-items {
  color: var(--color-warning);
}
.metric-value.status-active.ok {
  color: var(--color-success);
}
.metric-value.status-active.disabled {
  color: var(--color-danger);
}


/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 80px 20px; color: var(--color-text-muted);
}
.empty-state svg { margin-bottom: 20px; opacity: 0.3; color: var(--color-primary); }
.empty-state h3 { color: var(--color-text); font-size: 1.25rem; margin-bottom: 10px; }
body.dark-theme .empty-state h3 { color: #fff; }

/* ===== DEV HUB ===== */
.devhub-layout { display: grid; grid-template-columns: 240px 1fr 360px; gap: 24px; align-items: start; }
.devhub-sidebar { padding: 24px 16px; border-radius: var(--radius-md); }
.devhub-sidebar h3, .devhub-playground h3 { font-size: 1.05rem; margin-bottom: 20px; font-weight: 700; color: var(--color-text); text-transform: uppercase; letter-spacing: 0.05em; }
body.dark-theme .devhub-sidebar h3, body.dark-theme .devhub-playground h3 { color: #fff; }
.endpoint-list { list-style: none; }
.endpoint-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
  margin-bottom: 6px; font-size: 0.9rem;
  color: var(--color-text-secondary);
}
.endpoint-item:hover { background: rgba(0,0,0,0.02); color: var(--color-text); }
body.dark-theme .endpoint-item:hover { background: rgba(255,255,255,0.02); color: #fff; }
.endpoint-item.active { background: var(--color-primary-light); color: var(--color-primary); font-weight: 600; border-left: 3px solid var(--color-primary); }
body.dark-theme .endpoint-item.active { color: #fff; }
.method-badge {
  padding: 3px 8px; border-radius: 4px;
  font-size: 0.72rem; font-weight: 700; font-family: var(--font-mono);
}
.method-badge.post { background: var(--color-success-light); color: var(--color-success); border: 1px solid rgba(0, 184, 148, 0.15); }
.method-badge.get { background: var(--color-primary-light); color: var(--color-primary); border: 1px solid rgba(108, 92, 231, 0.15); }

.endpoint-card { padding: 32px; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.endpoint-card h3 { font-size: 1.4rem; margin-bottom: 12px; color: var(--color-text); }
body.dark-theme .endpoint-card h3 { color: #fff; }
.endpoint-card .endpoint-url {
  font-family: var(--font-mono); font-size: 0.9rem;
  padding: 14px 20px; background: #2d3436; color: #dfe6e9;
  border-radius: var(--radius-sm); margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--color-border);
}
body.dark-theme .endpoint-card .endpoint-url { background: #070913; }
.endpoint-card .endpoint-url .method { color: var(--color-success); font-weight: 700; }
.devhub-playground { padding: 24px; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.playground-response {
  margin-top: 20px; padding: 20px;
  background: #2d3436; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}
body.dark-theme .playground-response { background: #070913; }
.playground-response h4 { color: var(--color-text-secondary); font-size: 0.88rem; margin-bottom: 10px; font-weight: 600; }
.playground-response pre {
  color: var(--color-success); font-family: var(--font-mono);
  font-size: 0.85rem; white-space: pre-wrap; word-break: break-all;
}

/* ===== DATA TABLE (USERS) ===== */
.table-container { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--color-surface);
  overflow: hidden;
}
.data-table th {
  padding: 16px 20px; text-align: left;
  font-size: 0.85rem; font-weight: 700; color: var(--color-text-secondary);
  background: rgba(0,0,0,0.015); border-bottom: 2px solid var(--color-border);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.data-table td {
  padding: 16px 20px; font-size: 0.93rem; color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(0,0,0,0.005); }
body.dark-theme .data-table tr:hover td { background: rgba(255,255,255,0.015); }

/* ===== MODAL & CONNECT ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px); display: flex;
  align-items: center; justify-content: center; z-index: 1000;
  animation: fadeIn 0.25s ease-out;
}
body.dark-theme .modal-overlay { background: rgba(3, 4, 9, 0.7); }
.modal {
  width: 90%; max-width: 580px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--glass-border);
  animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 32px 36px 0;
}
.modal-header h3 { font-size: 1.3rem; font-weight: 700; color: var(--color-text); }
body.dark-theme .modal-header h3 { color: #fff; }
.modal-close {
  width: 36px; height: 36px; border: none; background: rgba(0, 0, 0, 0.03);
  border-radius: 50%; font-size: 1.3rem; cursor: pointer; color: var(--color-text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
body.dark-theme .modal-close { background: rgba(255, 255, 255, 0.05); }
.modal-close:hover { background: var(--color-danger-light); color: var(--color-danger); }
.modal-body { padding: 28px 36px 36px; }

/* Stepper Connection */
.stepper { display: flex; gap: 8px; margin-bottom: 32px; }
.step {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.85rem; color: var(--color-text-muted);
  background: rgba(0, 0, 0, 0.01);
  border: 1px solid var(--color-border);
  font-weight: 500;
}
body.dark-theme .step { background: rgba(255, 255, 255, 0.02); }
.step span {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.05); color: var(--color-text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
}
body.dark-theme .step span { background: rgba(255, 255, 255, 0.05); }
.step.active { color: var(--color-text); font-weight: 600; border-color: var(--color-primary); background: var(--color-primary-light); }
body.dark-theme .step.active { color: #fff; }
.step.active span { background: var(--color-primary); color: #fff; }
.step.done span { background: var(--color-success); color: #fff; }
.step-content { display: none; }
.step-content.active { display: block; animation: fadeIn 0.3s ease-out; }

/* Method Cards */
.method-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.method-card {
  text-align: center; padding: 36px 20px;
  border: 2.5px solid var(--color-border); border-radius: var(--radius-md);
  cursor: pointer; transition: all var(--transition);
  background: rgba(0, 0, 0, 0.005);
}
body.dark-theme .method-card { background: rgba(255, 255, 255, 0.01); }
.method-card:hover {
  border-color: var(--color-primary); background: var(--color-primary-light);
  transform: translateY(-4px); box-shadow: var(--shadow-primary-glow);
}
.method-card svg { color: var(--color-primary); margin-bottom: 16px; filter: drop-shadow(0 0 8px var(--color-primary-glow)); }
.method-card h4 { font-size: 1.05rem; margin-bottom: 8px; color: var(--color-text); }
body.dark-theme .method-card h4 { color: #fff; }
.method-card p { font-size: 0.85rem; color: var(--color-text-secondary); }

/* QR Scanner */
.qr-container { text-align: center; padding: 24px 0; }
.qr-placeholder {
  width: 290px; height: 290px; margin: 0 auto 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f8fafc; border-radius: var(--radius-md);
  border: 2px dashed rgba(108, 92, 231, 0.3);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.03);
}
body.dark-theme .qr-placeholder { background: #070913; border-color: rgba(124, 77, 255, 0.3); box-shadow: inset 0 4px 12px rgba(0,0,0,0.5); }
.qr-placeholder img { width: 270px; height: 270px; border-radius: 8px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.05)); }
.qr-timer { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; }

/* Pairing Code View */
.pairing-code { text-align: center; margin-top: 28px; }
.code-blocks {
  font-family: var(--font-mono); font-size: 2.5rem; font-weight: 700;
  letter-spacing: 8px; color: var(--color-primary);
  padding: 24px; background: var(--color-primary-light);
  border-radius: var(--radius-md); margin: 20px 0;
  border: 1px solid rgba(108, 92, 231, 0.25);
  text-shadow: 0 0 10px rgba(108, 92, 231, 0.15);
}
body.dark-theme .code-blocks { background: rgba(124, 77, 255, 0.12); border-color: rgba(124, 77, 255, 0.25); text-shadow: 0 0 10px rgba(124, 77, 255, 0.3); }

/* Success View */
.success-view { text-align: center; padding: 24px 0; }
.success-icon { color: var(--color-success); margin-bottom: 20px; filter: drop-shadow(0 0 10px rgba(0, 184, 148, 0.3)); }
body.dark-theme .success-icon { filter: drop-shadow(0 0 10px rgba(0, 230, 118, 0.3)); }
.success-view h3 { font-size: 1.5rem; margin-bottom: 12px; color: var(--color-text); }
body.dark-theme .success-view h3 { color: #fff; }
.success-view p { color: var(--color-text-secondary); margin-bottom: 8px; }

/* Spinner loading indicator */
.spinner {
  width: 44px; height: 44px; border: 3px solid rgba(0, 0, 0, 0.05);
  border-top-color: var(--color-primary); border-radius: 50%;
  animation: spin 0.7s linear infinite; margin-bottom: 16px;
}
body.dark-theme .spinner { border-color: rgba(255, 255, 255, 0.05); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.25); }
}

/* ===== BASE MOBILE STYLING (HIDDEN ON DESKTOP) ===== */
.mobile-header {
  display: none;
}
.btn-sidebar-close {
  display: none;
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1001;
  animation: fadeIn 0.2s ease-out;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .devhub-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* Mobile Header */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 99;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 20px;
  }
  .btn-menu-toggle {
    background: transparent;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    padding: 4px;
  }
  .mobile-logo-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--color-text);
    letter-spacing: -0.01em;
  }

  /* Sliding Sidebar */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1002;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    box-shadow: none;
    padding-top: 20px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .btn-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    outline: none;
  }
  body.dark-theme .btn-sidebar-close {
    background: rgba(255, 255, 255, 0.05);
  }
  .btn-sidebar-close:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
  }

  /* Layout tweaks */
  .main-content { 
    margin-left: 0; 
    padding: 16px; 
    min-width: 0;
    width: 100%;
  }
  .content-header { 
    border-bottom: none; 
    margin-bottom: 16px; 
    padding-bottom: 0; 
  }
  .content-header h2 { 
    display: none; 
  }
  .content-header .theme-toggle-btn {
    display: none;
  }
  
  .instances-grid { 
    grid-template-columns: 1fr; 
    gap: 20px;
  }
  .instance-card {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }
  .method-cards { 
    grid-template-columns: 1fr; 
  }
  .login-card { 
    padding: 36px 24px; 
  }
  .modal { 
    width: 95%; 
    max-height: 95vh;
  }
  .modal-body {
    padding: 20px;
  }

  /* Ultra-compact single line stats on mobile */
  .instances-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0;
    margin-bottom: 20px;
    overflow: visible;
  }
  .stat-card {
    flex: none;
    padding: 10px 6px;
    gap: 6px;
    justify-content: center;
    border-radius: var(--radius-sm);
    box-shadow: none;
  }
  .stat-icon {
    display: none !important; /* Hide big icon block to save space */
  }
  .stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }
  .stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }
  .stat-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-text);
    margin-top: 2px;
  }
  body.dark-theme .stat-value {
    color: #fff;
  }
  .stat-value-sub {
    font-size: 0.75rem;
    font-weight: 500;
  }

  /* Compact 2x2 details grid on mobile */
  .instance-details-grid {
    gap: 12px;
  }
  .metric-box {
    padding: 10px;
  }
  .metric-value {
    font-size: 0.82rem;
  }

  /* Card action buttons layout optimization for mobile devices */
  .instance-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
  }
  .instance-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 10px 12px;
    font-size: 0.85rem;
    height: 40px; /* Uniform height for buttons */
  }
  .instance-actions .btn-connect {
    grid-column: span 2;
  }

  /* Responsive Table to Cards */
  .table-container {
    border: none;
    border-radius: 0;
  }
  .data-table, 
  .data-table tbody, 
  .data-table tr, 
  .data-table td {
    display: block;
    width: 100%;
  }
  .data-table thead {
    display: none; /* Hide headers */
  }
  .data-table tr {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
  }
  .data-table td {
    border-bottom: 1px solid var(--color-border);
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    text-align: left;
  }
  .data-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
    justify-content: flex-end;
  }
  .data-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
  }
  .data-table td.actions-td::before {
    content: ""; /* No label for actions */
  }
  body.swal2-shown {
    padding-right: 0 !important;
  }
}


/* ===== CUSTOM SWEETALERT2 STYLES ===== */
.swal2-popup.swal2-modal {
  background: var(--color-surface) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-md) !important;
  color: var(--color-text) !important;
  box-shadow: var(--shadow-lg) !important;
}
.swal2-title {
  color: var(--color-text) !important;
  font-family: var(--font-primary) !important;
}
.swal2-html-container {
  color: var(--color-text-secondary) !important;
  font-family: var(--font-primary) !important;
}
.swal2-input {
  background: var(--color-surface) !important;
  border: 1.5px solid var(--color-border) !important;
  color: var(--color-text) !important;
  border-radius: var(--radius-sm) !important;
  outline: none !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  transition: all var(--transition) !important;
}
body.dark-theme .swal2-input {
  background: rgba(10, 12, 22, 0.8) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}
.swal2-input:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px var(--color-primary-light) !important;
}
.swal2-confirm.swal2-styled {
  background: var(--color-primary-gradient) !important;
  box-shadow: var(--shadow-primary-glow) !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-primary) !important;
  font-weight: 600 !important;
}
.swal2-cancel.swal2-styled {
  background: rgba(0, 0, 0, 0.02) !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-primary) !important;
  font-weight: 600 !important;
}
body.dark-theme .swal2-cancel.swal2-styled {
  background: rgba(255, 255, 255, 0.05) !important;
}
.swal2-icon.swal2-warning {
  border-color: var(--color-warning) !important;
  color: var(--color-warning) !important;
}
.swal2-icon.swal2-error {
  border-color: var(--color-danger) !important;
  color: var(--color-danger) !important;
}
.swal2-icon.swal2-success {
  border-color: var(--color-success) !important;
  color: var(--color-success) !important;
}
.swal2-icon.swal2-success [class^='swal2-success-line'] {
  background-color: var(--color-success) !important;
}
.swal2-icon.swal2-success .swal2-success-ring {
  border: .25em solid rgba(0, 184, 148, .3) !important;
}
body.dark-theme .swal2-icon.swal2-success .swal2-success-ring {
  border: .25em solid rgba(0, 230, 118, .3) !important;
}
.swal2-validation-message {
  background: var(--color-danger-light) !important;
  color: var(--color-danger) !important;
  border: 1px solid rgba(214, 48, 49, 0.2) !important;
  border-radius: var(--radius-sm) !important;
}
body.dark-theme .swal2-validation-message {
  color: #fff !important;
}

/* ===== LOGS VIEWER ===== */
.logs-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.log-select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color var(--transition);
}
.log-select:focus {
  outline: none;
  border-color: var(--color-primary);
}
.log-filter-input {
  flex: 1;
  min-width: 150px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  transition: border-color var(--transition);
}
.log-filter-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.log-auto-refresh-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.log-auto-refresh-label input[type="checkbox"] {
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.logs-container {
  margin-top: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 400px;
  max-height: calc(100vh - 260px);
}
.logs-output {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: #c8d6e5;
  background: #1e272e;
  padding: 20px;
  margin: 0;
  overflow: auto;
  max-height: calc(100vh - 280px);
  white-space: pre-wrap;
  word-break: break-all;
  border-radius: var(--radius-md);
}
/* Log level coloring */
.log-line-info { color: #00b894; }
.log-line-warn { color: #fdcb6e; }
.log-line-error { color: #ff7675; font-weight: 500; }
.log-line-debug { color: #74b9ff; }
.log-line-highlight { background: rgba(108, 92, 231, 0.2); border-radius: 3px; }

/* Responsive */
@media (max-width: 768px) {
  .logs-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .log-filter-input {
    width: 100%;
  }
  .logs-output {
    font-size: 0.72rem;
    max-height: calc(100vh - 340px);
  }
}
