/* ===== 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; }
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: hidden;
  transition: background var(--transition), color var(--transition);
}

/* Background glowing blobs */
body::before {
  content: ''; position: absolute; top: -10%; left: 10%; width: 40vw; height: 40vw;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.06) 0%, transparent 70%);
  z-index: -1; pointer-events: none;
}
body.dark-theme::before {
  background: radial-gradient(circle, rgba(124, 77, 255, 0.12) 0%, transparent 70%);
}

body::after {
  content: ''; position: absolute; bottom: 10%; right: 10%; width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(9, 132, 227, 0.04) 0%, transparent 70%);
  z-index: -1; pointer-events: none;
}
body.dark-theme::after {
  background: radial-gradient(circle, rgba(0, 229, 255, 0.08) 0%, transparent 70%);
}

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; }

/* ===== FLOATING THEME TOGGLE ===== */
.theme-toggle-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1100;
  transition: all var(--transition);
  color: var(--color-text-secondary);
  box-shadow: var(--shadow-md);
  outline: none;
}
.theme-toggle-btn:hover {
  transform: scale(1.1) 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;
  border-right: 1px solid var(--color-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: var(--color-primary-gradient); color: #fff;
  box-shadow: var(--shadow-primary-glow);
}
.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);
}
.content-header h2 { font-size: 1.8rem; font-weight: 700; color: var(--color-text); letter-spacing: -0.02em; }
body.dark-theme .content-header h2 { color: #fff; }
.status-badge {
  display: flex; 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 ===== */
.instances-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.instance-card {
  background: var(--color-surface); border-radius: var(--radius-md);
  padding: 28px; border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm); transition: all var(--transition);
  position: relative; overflow: hidden;
}
.instance-card:hover {
  box-shadow: var(--shadow-md); transform: translateY(-4px);
  border-color: var(--color-border-hover);
}
.instance-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px; background: linear-gradient(90deg, var(--color-warning), var(--color-danger));
}
.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: 20px; }
.instance-name { font-weight: 700; font-size: 1.15rem; color: var(--color-text); }
body.dark-theme .instance-name { color: #fff; }
.instance-status {
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; border: 1px solid transparent;
}
.instance-status.connected { background: var(--color-success-light); color: var(--color-success); border-color: rgba(0, 184, 148, 0.15); }
.instance-status.disconnected { background: var(--color-danger-light); color: var(--color-danger); border-color: rgba(214, 48, 49, 0.15); }
.instance-status.pairing { background: var(--color-warning-light); color: var(--color-warning); border-color: rgba(241, 196, 15, 0.15); }

.instance-details { margin-bottom: 24px; }
.instance-detail {
  display: flex; justify-content: space-between; padding: 8px 0;
  font-size: 0.88rem; border-bottom: 1px solid var(--color-border);
}
.instance-detail:last-child { border-bottom: none; }
.detail-label { color: var(--color-text-secondary); }
.detail-value { font-weight: 600; color: var(--color-text); }
body.dark-theme .detail-value { color: #fff; }
.instance-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== 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;
    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;
  }

  /* Theme toggle positioning on mobile */
  .theme-toggle-btn {
    top: 10px;
    right: 16px;
    width: 40px;
    height: 40px;
  }

  /* 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: 0 20px 20px 20px; }
  .content-header { border-bottom: none; margin-bottom: 20px; padding-bottom: 0; }
  .content-header h2 { display: none; } /* Page title already shown on subpages context or mobile title */
  
  .instances-grid { grid-template-columns: 1fr; }
  .method-cards { grid-template-columns: 1fr; }
  .login-card { padding: 36px 28px; }
  .modal { width: 95%; }
}


/* ===== 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;
}
