/* Modern Remote Desktop Dashboard Styles */
/* Updated: 2025-11-26 - Premium Glass Morphism Design */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Primary Colors */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  --primary-glow: rgba(99, 102, 241, 0.4);
  
  /* Secondary Colors */
  --secondary: #64748b;
  --secondary-light: rgba(100, 116, 139, 0.15);
  
  /* Status Colors */
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --danger-glow: rgba(239, 68, 68, 0.4);
  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.15);
  --success-glow: rgba(34, 197, 94, 0.4);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  --info: #0ea5e9;
  --info-light: rgba(14, 165, 233, 0.15);
  
  /* Dark Theme */
  --background: #030712;
  --background-secondary: #0f172a;
  --surface: rgba(30, 41, 59, 0.5);
  --surface-solid: #1e293b;
  --surface-hover: rgba(51, 65, 85, 0.5);
  --surface-active: rgba(71, 85, 105, 0.5);
  --border: rgba(51, 65, 85, 0.5);
  --border-light: rgba(71, 85, 105, 0.5);
  --border-glow: rgba(99, 102, 241, 0.3);
  
  /* Text */
  --text: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --gradient-success: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
  --gradient-surface: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.8) 100%);
  --gradient-glow: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
  --shadow-glow-success: 0 0 30px rgba(34, 197, 94, 0.3);
  
  /* Border Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Glass Effect */
  --glass-bg: rgba(30, 41, 59, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(20px);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
  width: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Dashboard page needs special overflow handling */
body.dashboard-page {
  overflow: hidden;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(139, 92, 246, 0.1), transparent),
    radial-gradient(ellipse 40% 30% at 0% 100%, rgba(34, 197, 94, 0.08), transparent);
  pointer-events: none;
  z-index: -1;
}

/* Selection */
::selection {
  background: var(--primary);
  color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* ===== Login Page ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.login-card h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  text-align: center;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.auth-form {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: var(--transition);
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  border-color: var(--border-light);
}

/* Header buttons - smaller */
.header-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  width: auto;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
}

.btn-icon {
  width: auto;
  padding: 0.625rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.btn-icon:hover {
  background: var(--surface-hover);
  border-color: var(--border-light);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.divider span {
  position: relative;
  background: var(--surface);
  padding: 0 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.message {
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.message.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.message.info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.login-footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== Dashboard Page ===== */
.dashboard-header {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.5rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.header-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-content h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.user-info {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.dashboard-main {
  width: 100%;
  margin: 0;
  padding: 0.5rem 1rem;
  height: calc(100vh - 57px);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-header h2::before {
  content: '';
  width: 4px;
  height: 1.5rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

/* ===== Devices List ===== */
.devices-section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  max-height: 600px;
  overflow-y: auto;
}

.devices-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.device-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.device-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition);
}

.device-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-glow);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.device-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  border-color: var(--border-glow);
}

.device-card:hover::before {
  opacity: 1;
}

.device-card:hover::after {
  opacity: 1;
}

.device-card.online {
  border-color: rgba(34, 197, 94, 0.3);
}

.device-card.online::before {
  background: var(--gradient-success);
  opacity: 1;
}

.device-card.online:hover {
  box-shadow: var(--shadow-md), var(--shadow-glow-success);
}

.device-card.offline {
  opacity: 0.6;
}

.device-card.offline::before {
  background: var(--secondary);
  opacity: 0.5;
}

.device-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.device-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.status-badge {
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 1px solid transparent;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-badge.online {
  background: var(--success-light);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.3);
}

.status-badge.online::before {
  animation: pulse-glow 2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--success);
}

@keyframes pulse-glow {
  0%, 100% { 
    opacity: 1;
    box-shadow: 0 0 8px var(--success);
  }
  50% { 
    opacity: 0.6;
    box-shadow: 0 0 4px var(--success);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-badge.offline {
  background: var(--secondary-light);
  color: var(--text-muted);
  border-color: rgba(100, 116, 139, 0.3);
}

.status-badge.pending {
  background: var(--warning-light);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.3);
}

.status-badge.pending::before {
  animation: pulse 1.5s ease-in-out infinite;
}

.status-badge.approved {
  background: var(--success-light);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.3);
}

.status-badge.connecting {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.3);
}

.status-badge.connecting::before {
  animation: pulse 1s ease-in-out infinite;
}

.device-info {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.device-info div {
  margin-bottom: 0.25rem;
}

.device-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ===== Session Section ===== */
.session-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.session-info {
  background: var(--background);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease, margin-bottom 0.3s ease;
}

.session-info.expanded {
  padding: 1rem;
  margin-bottom: 1.5rem;
  max-height: 200px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .label {
  color: var(--text-muted);
  font-weight: 500;
}

.pin-display {
  font-family: monospace;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--primary);
}

/* ===== Viewer ===== */
.viewer-container {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  max-height: 70vh;
}

#remoteVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
}

#remoteCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
}

.viewer-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 1.2rem;
  z-index: 20;
}

.fullscreen-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 30;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 1.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.fullscreen-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
}

/* Fullscreen mode styles */
.viewer-container:fullscreen {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  max-height: none;
}

.viewer-container:fullscreen #remoteCanvas,
.viewer-container:fullscreen #remoteVideo {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}

/* ===== Stats Panel ===== */
.stats-panel {
  margin-top: 1rem;
}

#statsContent {
  background: var(--background);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.5rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.stat-label {
  color: var(--text-muted);
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 400px;
  width: 100%;
}

.modal-content h3 {
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pin-input {
  width: 100%;
  padding: 1rem;
  font-size: 2rem;
  text-align: center;
  letter-spacing: 0.5em;
  font-family: monospace;
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  margin: 1rem 0;
}

.pin-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state p {
  margin-bottom: 0.5rem;
}

.empty-state .btn {
  margin: 1rem auto 0;
  max-width: 200px;
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Utilities ===== */
.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.error-message {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ===== Admin Page ===== */
.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.admin-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.admin-tab {
  padding: 0.875rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition);
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab.active {
  color: var(--primary);
}

.admin-tab.active::after {
  opacity: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0.5;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-glow);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-number {
  font-size: 2.75rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card.success::before {
  background: var(--gradient-success);
}

.stat-card.success .stat-number {
  background: var(--gradient-success);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card.warning::before {
  background: var(--gradient-warning);
}

.stat-card.warning .stat-number {
  background: var(--gradient-warning);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-tab {
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab:hover {
  border-color: var(--border-light);
  color: var(--text);
}

.filter-tab.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.user-card,
.pending-user {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.user-card::before,
.pending-user::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition);
}

.user-card:hover,
.pending-user:hover {
  transform: translateX(4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow);
}

.user-card:hover::before,
.pending-user:hover::before {
  opacity: 1;
}

.user-card.approved,
.pending-user.approved {
  border-left: 4px solid var(--success);
}

.user-card.approved::before,
.pending-user.approved::before {
  background: var(--gradient-success);
  opacity: 1;
}

.user-card.pending,
.pending-user:not(.approved) {
  border-left: 4px solid var(--warning);
}

.user-card.pending::before,
.pending-user:not(.approved)::before {
  background: var(--gradient-warning);
  opacity: 1;
}

.user-info-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-email {
  font-weight: 600;
  font-size: 1rem;
}

.user-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.user-actions {
  display: flex;
  gap: 0.75rem;
}

/* ===== Dashboard Grid Layout ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

@media (min-width: 1101px) {
  .dashboard-grid {
    grid-template-columns: 1fr 420px;
  }
}

.dashboard-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.dashboard-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow-y: auto;
}

/* ===== Remote Preview Section ===== */
.remote-preview-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.remote-preview-container {
  flex: 1;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

/* Fullscreen mode for remote preview */
.remote-preview-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  z-index: 9999;
  border-radius: 0;
  border: none;
  margin: 0;
}

.remote-preview-container.fullscreen .preview-screen {
  flex: 1;
  width: 100%;
  height: 100%;
}

.remote-preview-container.fullscreen .preview-toolbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.remote-preview-container.fullscreen:hover .preview-toolbar {
  opacity: 1;
}

.remote-preview-container.fullscreen .preview-idle-content {
  transform: scale(1.2);
}

/* Fullscreen button styling */
.fullscreen-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  transition: var(--transition);
  opacity: 0;
}

.preview-screen:hover .fullscreen-toggle,
.remote-preview-container.fullscreen .fullscreen-toggle {
  opacity: 1;
}

.fullscreen-toggle:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: var(--primary);
}

.preview-screen {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-screen video,
.preview-screen canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-screen canvas {
  z-index: 2;
}

/* Preview Idle State */
.preview-idle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
  z-index: 10;
}

.preview-idle-content {
  text-align: center;
  padding: 2rem;
}

.preview-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.preview-idle-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.preview-idle-content p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.preview-features {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.feature-tag {
  padding: 0.375rem 0.75rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Preview Connecting State */
.preview-connecting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
  z-index: 10;
}

.connecting-animation {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 1.5rem;
}

.connecting-ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}

.connecting-ring:nth-child(2) {
  inset: 8px;
  border-top-color: var(--primary-light);
  animation-duration: 2s;
  animation-direction: reverse;
}

.connecting-ring:nth-child(3) {
  inset: 16px;
  border-top-color: rgba(99, 102, 241, 0.3);
  animation-duration: 2.5s;
}

.preview-connecting p {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.connecting-device {
  color: var(--primary);
  font-weight: 600;
}

/* Preview Toolbar */
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--surface-solid);
  border-top: 1px solid var(--border);
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toolbar-center {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.connection-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
}

.connection-indicator.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-glow 2s ease-in-out infinite;
}

.toolbar-btn {
  padding: 0.5rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}

.toolbar-btn:hover {
  background: var(--surface-active);
  border-color: var(--border-light);
}

.connection-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* Connection Stats Mini Grid */
.connection-stats-section {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.stats-grid-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-mini {
  text-align: center;
  padding: 0.75rem;
  background: var(--surface-hover);
  border-radius: var(--radius);
}

.stat-mini-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  font-family: monospace;
}

.stat-mini-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


/* Button Block */
.btn-block {
  width: 100%;
  margin-top: 1rem;
}

/* ===== Admin User/Device Cards ===== */
.user-header,
.device-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.user-status,
.device-status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-approved,
.status-online {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-pending,
.status-offline {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.user-details,
.device-details {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.8;
}

.user-actions,
.device-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.approve-btn,
.assign-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.approve-btn:hover,
.assign-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.approve-btn:disabled {
  background: var(--secondary-light);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.revoke-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.revoke-btn:hover {
  background: var(--danger);
  color: white;
  transform: translateY(-2px);
}

/* Admin Badge */
.admin-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.2rem 0.5rem;
  background: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
  color: #1e293b;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Make Admin Button */
.admin-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
  color: #1e293b;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.admin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* Revoke Admin Button */
.revoke-admin-btn {
  flex: 1;
  padding: 0.625rem 1rem;
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.revoke-admin-btn:hover {
  background: var(--danger);
  color: white;
  transform: translateY(-2px);
}

/* Admin Tabs Enhancement */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
}

.admin-tab {
  padding: 0.875rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-tab:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.admin-tab.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* Filter Tabs Enhancement */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 0.375rem;
}

.filter-tab {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.filter-tab.active {
  background: var(--primary);
  color: white;
}

/* Empty State Enhancement */
.empty-state {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.empty-state p:first-child {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state .muted {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.empty-state .btn {
  max-width: 200px;
  margin: 0 auto;
}

/* Modal Enhancement */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.modal-content {
  background: var(--surface-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 450px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-content p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Button Enhancements */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: var(--transition);
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  border: none;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-right {
    order: -1;
  }
  
  .remote-preview-container {
    min-height: 400px;
  }
  
  .stats-grid-mini {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-main,
  .admin-container {
    padding: 1rem;
  }

  .devices-list {
    grid-template-columns: 1fr;
  }
  
  .remote-preview-container {
    min-height: 300px;
  }
  
  .preview-toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .toolbar-center {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }
  
  .queue-item {
    flex-wrap: wrap;
  }
  
  .queue-actions {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .queue-action-btn {
    flex: 1;
  }

  .header-content,
  .admin-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .modal {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .user-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .user-actions {
    width: 100%;
  }

  .user-actions .btn {
    flex: 1;
  }
}

/* ============================================
   AGENT PAGE STYLES - Modern Glass Morphism
   ============================================ */

.agent-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Animated Background */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #06b6d4 0%, var(--primary) 100%);
  bottom: -150px;
  right: -150px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -50px) scale(1.1); }
  50% { transform: translate(-30px, 30px) scale(0.95); }
  75% { transform: translate(40px, 40px) scale(1.05); }
}

/* Agent Wrapper */
.agent-wrapper {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Agent Header */
.agent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: var(--shadow-glow);
}

.logo-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.logo-text .tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  backdrop-filter: var(--glass-blur);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse-glow 2s ease-in-out infinite;
}

.status-dot.offline {
  background: var(--text-muted);
}

.status-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px var(--success); }
  50% { opacity: 0.7; box-shadow: 0 0 20px var(--success); }
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: white;
  box-shadow: var(--shadow-glow);
}

.card-icon.pulse-icon {
  animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%, 100% { transform: scale(1); box-shadow: var(--shadow-glow); }
  50% { transform: scale(1.05); box-shadow: 0 0 40px var(--primary-glow); }
}

.card-icon.ring-animation {
  animation: ring 1s ease-in-out infinite;
}

@keyframes ring {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-10deg); }
  20%, 40% { transform: rotate(10deg); }
  50% { transform: rotate(0deg); }
}

.card-icon.connected-icon {
  background: var(--gradient-success);
  box-shadow: var(--shadow-glow-success);
}

.card-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* Input Group */
.input-group {
  position: relative;
  margin-bottom: 1rem;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  z-index: 1;
}

.input-group input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.input-group input::placeholder {
  color: var(--text-dim);
}

/* Button Styles */
.btn-glow {
  box-shadow: var(--shadow-glow);
}

.btn-glow:hover {
  box-shadow: 0 0 40px var(--primary-glow);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-light);
}

.btn i {
  margin-right: 0.5rem;
}

/* Card Footer */
.card-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.card-footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.link-primary {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.link-primary:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Device Info Grid */
.device-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.info-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1rem;
}

.info-content {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.action-buttons .btn {
  flex: 1;
}

/* Preview Window */
.preview-window {
  background: var(--background);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.preview-header i {
  margin-right: 0.5rem;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--danger);
  font-weight: 600;
  font-size: 0.75rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.preview-content {
  aspect-ratio: 16/9;
  background: #000;
}

.preview-content video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* PIN Entry */
.pin-entry {
  text-align: center;
  margin-bottom: 2rem;
}

.pin-instruction {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.pin-input-wrapper {
  display: flex;
  justify-content: center;
}

.pin-input {
  width: 200px;
  padding: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: var(--transition);
}

.pin-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Session Actions */
.session-actions {
  display: flex;
  gap: 1rem;
}

.session-actions .btn {
  flex: 1;
}

/* Session Stats */
.session-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.stat-icon {
  width: 36px;
  height: 36px;
  background: var(--success-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  font-size: 0.9rem;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* Live Banner */
.live-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  color: var(--danger);
  font-weight: 500;
  font-size: 0.9rem;
}

/* Agent Footer */
.agent-footer {
  text-align: center;
  padding: 1rem 0;
}

.security-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.security-badges .badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
  backdrop-filter: var(--glass-blur);
}

.security-badges .badge i {
  color: var(--success);
}

.copyright {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin: 0;
}

/* Message Box */
.message-box {
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  font-size: 0.9rem;
}

.message-box.error {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.message-box.success {
  background: var(--success-light);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
}

/* Session Tabs */
.session-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  min-height: 44px;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  overflow-x: auto;
}

.tabs-container {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  overflow-x: auto;
}

.tabs-empty-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.25rem 0.5rem;
  user-select: none;
}

.session-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 120px;
  max-width: 200px;
}

.session-tab:hover {
  background: var(--surface-active);
  color: var(--text);
  border-color: var(--primary);
}

.session-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.session-tab .tab-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.session-tab.active .tab-status,
.session-tab.connected .tab-status {
  background: var(--success);
  box-shadow: 0 0 8px var(--success-glow);
}

.session-tab.connecting .tab-status {
  background: var(--warning);
  animation: pulse 1s infinite;
}

.session-tab .tab-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-tab .tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.session-tab .tab-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

.session-tab.active .tab-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.tab-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--surface-hover);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tab-add-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Agent Page Responsive */
@media (max-width: 600px) {
  .agent-page {
    padding: 1rem;
  }

  .glass-card {
    padding: 1.5rem;
  }

  .device-info-grid {
    grid-template-columns: 1fr;
  }

  .session-stats {
    grid-template-columns: 1fr;
  }

  .security-badges {
    flex-direction: column;
    align-items: center;
  }

  .agent-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .logo {
    flex-direction: column;
    text-align: center;
  }
}

/* Super Admin Badge */
.super-admin-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-block;
  margin-bottom: 1rem;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

/* Invite Form */
.invite-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.invite-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.invite-form .form-group {
  flex: 1;
  min-width: 200px;
}

.transfer-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
  max-width: 500px;
}

.transfer-form .form-group {
  margin-bottom: 0;
}

/* Input Helper Section */
.helper-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.helper-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.helper-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.1rem;
}

.helper-icon.connected {
  background: var(--success-light);
  color: var(--success);
}

.helper-icon.disconnected {
  background: var(--warning-light);
  color: var(--warning);
}

.helper-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.helper-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.helper-value {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.helper-actions {
  display: flex;
  gap: 0.5rem;
}

.helper-hint {
  margin: 0.75rem 0 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.helper-hint code {
  background: var(--surface-hover);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  color: var(--primary);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

/* ===== Enhanced Login Page ===== */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: -1;
  background: var(--background);
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float-orb 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(139, 92, 246, 0.3) 100%);
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(16, 185, 129, 0.2) 100%);
  bottom: -150px;
  right: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3) 0%, rgba(236, 72, 153, 0.2) 100%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float-orb {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -30px) scale(1.05);
  }
  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }
  75% {
    transform: translate(-30px, -20px) scale(1.02);
  }
}

/* Glass Card Enhancement */
.glass-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* Login Logo Animation */
.login-logo {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-glow {
  position: absolute;
  inset: -10px;
  background: var(--gradient-primary);
  border-radius: 50%;
  opacity: 0.3;
  filter: blur(20px);
  animation: pulse-glow 3s ease-in-out infinite;
}

.logo-icon {
  font-size: 3rem;
  position: relative;
  z-index: 1;
  animation: float 3s ease-in-out infinite;
}

/* Highlight Text */
.highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

/* Security Badges in Login */
.login-footer .security-badges {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.login-footer .badge {
  padding: 0.5rem 0.875rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.login-footer .badge i {
  color: var(--primary);
}

/* Enhanced Form Inputs */
.login-card .form-group input {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.login-card .form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(15, 23, 42, 0.8);
}

.login-card .form-group input::placeholder {
  color: var(--text-dim);
}

/* Button Glow Effect */
.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-primary);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  filter: blur(15px);
  transition: opacity 0.3s ease;
}

.btn-glow:hover::after {
  opacity: 0.6;
}

/* Enhanced Admin Panel */
.admin-container {
  position: relative;
  z-index: 1;
}

.admin-header {
  background: rgba(30, 41, 59, 0.8);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Device Card Enhancements */
.device-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.device-card:hover {
  transform: translateY(-8px) scale(1.02);
}

/* Stat Card Pulse Animation */
.stat-card.warning .stat-number {
  animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Queue Badge Animation */
.queue-badge {
  animation: bounce-subtle 2s ease-in-out infinite;
}

@keyframes bounce-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
