:root {
  --bg-dark: #08090c;
  --card-bg: rgba(18, 20, 28, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover: rgba(255, 255, 255, 0.12);
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.3);
  --online-color: #10b981;
  --online-glow: rgba(16, 185, 129, 0.35);
  --offline-color: #ef4444;
  --offline-glow: rgba(239, 68, 68, 0.25);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: 'Inter', 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --primary-gradient: linear-gradient(135deg, #0088cc 0%, #00c6ff 100%);
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-danger-bg: rgba(239, 68, 68, 0.12);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(ellipse 80% 80% at 50% -20%, rgba(59, 130, 246, 0.15), transparent),
    radial-gradient(ellipse 60% 60% at 80% 100%, rgba(16, 185, 129, 0.08), transparent);
  background-attachment: fixed;
  padding: 24px 16px;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
  gap: 12px;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.brand-icon svg {
  width: 24px;
  height: 24px;
}

.brand h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.header-right-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  color: var(--online-color);
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--online-color);
  box-shadow: 0 0 10px var(--online-color);
  animation: pulse 1.8s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px var(--online-color); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Equal Width Top Main Navigation Bar (50% / 50%) */
.top-main-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  gap: 12px;
  margin-bottom: 24px;
}

.top-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(12px);
  outline: none;
  width: 100%;
}

.top-nav-btn:hover {
  background: var(--card-hover);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.top-nav-btn.active#topTabFirebaseBtn {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.35);
}

.top-nav-btn.active#topTabTgBtn {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 25px rgba(0, 136, 204, 0.35);
}

.main-view {
  display: none;
}

.main-view.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Glass Card */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.input-card {
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.icon-bubble {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.icon-bubble svg {
  width: 18px;
  height: 18px;
}

.card-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Mode Switcher Tabs */
.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: rgba(10, 12, 18, 0.8);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

.mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mode-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-icon-sm {
  width: 16px;
  height: 16px;
}

/* File Dropzone */
.file-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background: rgba(10, 12, 18, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.file-dropzone:hover, .file-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

.dropzone-icon {
  width: 36px;
  height: 36px;
  color: var(--primary);
}

.dropzone-text {
  font-size: 0.9rem;
  color: var(--text-main);
}

.dropzone-subtext {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.divider-text {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 16px 0;
  position: relative;
}

.divider-text::before, .divider-text::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--card-border);
}

.divider-text::before { left: 0; }
.divider-text::after { right: 0; }

/* Textarea */
textarea#multi-db-input, textarea#bulkPhoneInput {
  width: 100%;
  background: rgba(10, 12, 18, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  resize: vertical;
  transition: all 0.2s ease;
}

textarea#multi-db-input:focus, textarea#bulkPhoneInput:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Forms */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-optional {
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  pointer-events: none;
}

.input-wrapper input, .form-group input {
  width: 100%;
  background: rgba(10, 12, 18, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.input-wrapper input {
  padding-left: 42px;
}

.input-wrapper input:focus, .form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

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

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-export {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--online-color);
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-export:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-copy-db {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.25));
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-copy-db:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.45));
  color: #ffffff;
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-copy-db svg {
  width: 14px;
  height: 14px;
}


.btn-icon {
  width: 18px;
  height: 18px;
}

/* Copy Button */
.btn-copy {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.btn-copy svg {
  width: 14px;
  height: 14px;
}

/* Phone Input Box for TG Checker */
.phone-input-box {
  display: flex;
  align-items: center;
  background: rgba(10, 12, 18, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 4px 6px;
}

.phone-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  padding: 8px 12px;
  outline: none;
}

.country-prefix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Export Dropdown Menu */
.export-dropdown {
  position: relative;
  display: inline-block;
}

.export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #12141c;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7);
  z-index: 100;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.export-menu button {
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.export-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.menu-icon {
  width: 14px;
  height: 14px;
  color: var(--text-dim);
}

/* DB Badges List */
.db-badges-container {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.db-badges-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.db-badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.db-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.db-badge .count-tag {
  background: rgba(59, 130, 246, 0.2);
  color: var(--primary);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
}

/* Status Messages */
.status-message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.4;
}

.status-message.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.status-message.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.status-message.info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.stat-card.online-border {
  border-left: 4px solid var(--online-color);
}

.stat-card.offline-border {
  border-left: 4px solid var(--offline-color);
}

.stat-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  margin-top: 4px;
}

.text-primary { color: var(--primary); }
.text-online { color: var(--online-color); }
.text-offline { color: var(--offline-color); }

/* Controls Bar */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  background: rgba(10, 12, 18, 0.8);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.dot-online {
  background-color: var(--online-color);
  box-shadow: 0 0 6px var(--online-color);
}

.dot-offline {
  background-color: var(--offline-color);
}

.search-and-options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}

.search-box input {
  width: 100%;
  background: rgba(10, 12, 18, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 8px 12px 8px 36px;
  color: var(--text-main);
  font-size: 0.85rem;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

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

.toggle-switch input {
  display: none;
}

.slider {
  width: 38px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  position: relative;
  transition: 0.2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #fff;
  top: 3px;
  left: 3px;
  transition: 0.2s ease;
}

.toggle-switch input:checked + .slider {
  background-color: var(--primary);
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Results Grid */
.results-container {
  min-height: 240px;
}

.empty-state {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  max-width: 540px;
  margin: 32px auto;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--text-dim);
}

.empty-icon svg {
  width: 32px;
  height: 32px;
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-main);
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* Device Card */
.device-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.device-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.device-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.device-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.device-status-badge.online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--online-color);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.device-status-badge.offline {
  background: rgba(239, 68, 68, 0.15);
  color: var(--offline-color);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

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

.status-dot.offline {
  background-color: var(--offline-color);
}

.device-source-tag {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 4px;
}

.device-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.field-value-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 12, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.field-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-main);
  word-break: break-all;
}

.phone-value {
  color: #6ee7b7;
  font-weight: 600;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-card {
  background: #111726;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
}

.modal-header h2 { font-size: 1.2rem; font-weight: 600; }
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.modal-body { padding: 1.5rem; }

.modal-tabs { display: flex; gap: 0.5rem; margin: 1rem 0; }
.modal-tab-btn {
  flex: 1; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--card-border);
  color: var(--text-muted); padding: 0.6rem; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem;
}
.modal-tab-btn.active {
  background: rgba(59, 130, 246, 0.15); border-color: var(--primary); color: var(--primary); font-weight: 600;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.alert { padding: 0.85rem 1rem; border-radius: var(--radius-md); font-size: 0.85rem; margin-bottom: 1rem; }
.alert-info { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); color: #93c5fd; }
.logout-section { margin-top: 1.5rem; }
.logout-section hr { border: none; border-top: 1px solid var(--card-border); margin-bottom: 1rem; }
.logout-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; }

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--card-border);
}
.status-badge.mode-demo { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); color: #f59e0b; }
.status-badge.mode-live { background: var(--color-success-bg); border-color: rgba(16, 185, 129, 0.3); color: var(--online-color); }

.table-header-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 1.5rem 0 1rem 0; flex-wrap: wrap; gap: 1rem; }
.table-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.filter-group { display: flex; background: rgba(255, 255, 255, 0.05); padding: 3px; border-radius: var(--radius-sm); }
.filter-btn { background: transparent; border: none; color: var(--text-muted); padding: 0.35rem 0.75rem; font-size: 0.8rem; border-radius: var(--radius-sm); cursor: pointer; }
.filter-btn.active { background: rgba(255, 255, 255, 0.15); color: var(--text-main); font-weight: 600; }

.table-container { overflow-x: auto; border: 1px solid var(--card-border); border-radius: var(--radius-md); background: rgba(10, 12, 18, 0.5); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.88rem; }
.data-table th { background: rgba(255, 255, 255, 0.03); color: var(--text-muted); font-weight: 600; padding: 0.85rem 1rem; border-bottom: 1px solid var(--card-border); }
.data-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--card-border); color: var(--text-main); }

.hidden { display: none !important; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--primary); font-size: 0.85rem; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
