:root {
  /* Ultra-Premium Modern Color System */
  --bg-color: #f8fafc;
  --bg-gradient: radial-gradient(circle at 10% 20%, rgba(239, 246, 255, 0.7) 0%, rgba(248, 250, 252, 1) 90%);
  --surface-color: #ffffff;
  --surface-border: #e2e8f0;
  --surface-hover: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  --accent-color: #4f46e5;
  --accent-hover: #4338ca;
  --accent-light: #eef2ff;
  --accent-border: #c7d2fe;
  
  --success-color: #10b981;
  --success-hover: #059669;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  
  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  
  --warning-color: #f59e0b;
  --warning-light: #fffbeb;
  --warning-border: #fef3c7;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

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

body {
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  min-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden {
  display: none !important;
}

/* ============================================================================
   SPLASH SCREEN (PWA / APP OPEN ANIMATION - WHITE THEME)
   ============================================================================ */
.splash-screen {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
  color: #0f172a;
  min-width: 1200px;
}

.splash-screen.fade-out,
.splash-screen.hidden {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
  visibility: hidden;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: splashFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.splash-logo-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-glow {
  position: absolute;
  inset: -15px;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.28) 0%, rgba(234, 179, 8, 0.06) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(14px);
  animation: glowPulse 3s ease-in-out infinite alternate;
}

.splash-logo-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 24px;
  box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.12), 0 0 20px rgba(234, 179, 8, 0.2);
  animation: logoScalePulse 3s ease-in-out infinite alternate;
}

.splash-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: #0f172a;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.splash-loading-bar {
  width: 160px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
}

.splash-loading-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, transparent, #eab308, #ca8a04, transparent);
  border-radius: 99px;
  animation: loadingShimmer 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.splash-status-text {
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

@keyframes splashFadeIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes glowPulse {
  0% { transform: scale(0.9); opacity: 0.25; }
  100% { transform: scale(1.25); opacity: 0.55; }
}

@keyframes logoScalePulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

@keyframes loadingShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

/* ============================================================================
   LOGIN VIEW (WHITE & LIGHT THEME)
   ============================================================================ */
.login-view {
  min-height: 100vh;
  min-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #f8fafc;
  padding: 20px;
}

.login-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.12;
}

.orb-1 {
  width: 450px;
  height: 450px;
  background: #3b82f6;
  top: -120px;
  left: -120px;
  animation: floatOrb 12s ease-in-out infinite alternate;
}

.orb-2 {
  width: 550px;
  height: 550px;
  background: #eab308;
  bottom: -160px;
  right: -160px;
  animation: floatOrb 15s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0); }
  100% { transform: translate(40px, 40px); }
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-wrap {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.login-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.login-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 13.5px;
}

.login-view .input-group label {
  color: var(--text-primary);
}

.login-view .input-wrap input {
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
}

.login-view .input-wrap input:focus {
  background: #ffffff;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.login-view .input-icon {
  color: #64748b;
}

/* ============================================================================
   FORMS & INPUTS
   ============================================================================ */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.input-group label .req {
  color: var(--danger-color);
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
  pointer-events: none;
  display: flex;
}

.input-wrap input,
.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 11px 16px;
  padding-left: 42px;
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  font-family: var(--font-family);
  transition: all 0.2s ease;
  outline: none;
}

.input-group input:not(.input-wrap input),
.input-group select {
  padding-left: 16px;
}

.input-wrap input:focus,
.input-group input:focus,
.input-group select:focus {
  background: #ffffff;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-error {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: var(--danger-color);
  font-size: 13px;
  text-align: center;
  display: none;
  font-weight: 500;
}

.form-error:not(:empty) {
  display: block;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn-primary {
  background: var(--accent-color);
  color: #ffffff;
  border: none;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

.btn-success {
  background: var(--success-color);
  color: #ffffff;
  border: none;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background: var(--success-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(16, 185, 129, 0.25);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-outline {
  background: #ffffff;
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.btn-outline:hover {
  background: var(--surface-hover);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn-danger {
  background: #ffffff;
  color: var(--danger-color);
  border: 1px solid var(--danger-border);
  box-shadow: var(--shadow-xs);
}

.btn-danger:hover {
  background: var(--danger-color);
  color: #ffffff;
  border-color: var(--danger-color);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

/* ============================================================================
   APP LAYOUT & SIDEBAR
   ============================================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
  min-width: 1200px;
  width: 100%;
}

.sidebar {
  width: 270px;
  min-width: 270px;
  background: var(--surface-color);
  border-right: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 24px 20px;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-logo-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  background: #0f172a;
}

.sidebar-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text h1 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11.5px;
  color: var(--text-secondary);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent-color);
}

.nav-count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  background: #e2e8f0;
  border-radius: 10px;
  color: var(--text-secondary);
}

.nav-item.active .nav-count {
  background: var(--accent-border);
  color: var(--accent-color);
}

.sidebar-footer {
  border-top: 1px solid var(--surface-border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.logout-item:hover {
  background: var(--danger-light);
  color: var(--danger-color);
}

/* ============================================================================
   MAIN CONTENT & TAB PANES (SECTION TOGGLING)
   ============================================================================ */
.main-content {
  flex: 1;
  min-width: 930px;
  padding: 32px 40px;
  overflow-y: auto;
}

/* CRITICAL: Hides inactive tab panes completely */
.tab-pane {
  display: none !important;
}

.tab-pane.active {
  display: block !important;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--success-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-color);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

.btn-icon:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: #cbd5e1;
  transform: rotate(45deg);
}

/* ============================================================================
   STATS BANNER CARDS
   ============================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.blue { background: #eef2ff; color: #4f46e5; border: 1px solid #c7d2fe; }
.stat-icon.green { background: #ecfdf5; color: #10b981; border: 1px solid #a7f3d0; }
.stat-icon.amber { background: #fffbeb; color: #f59e0b; border: 1px solid #fef3c7; }
.stat-icon.purple { background: #faf5ff; color: #a855f7; border: 1px solid #e9d5ff; }

.stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================================
   DEVICE CARDS & SESSIONS LIST
   ============================================================================ */
.device-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.device-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  overflow: visible; /* Prevents 3-dots dropdown menu from being clipped */
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
}

.device-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.device-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.device-main-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.device-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  flex-shrink: 0;
}

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

.device-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.device-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.device-id-code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-secondary);
}

.device-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
}

.pill {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.active { background: #ecfdf5; color: var(--success-color); border: 1px solid #d1fae5; }
.pill.stale { background: #fffbeb; color: var(--warning-color); border: 1px solid #fef3c7; }
.pill.kill { background: #fef2f2; color: var(--danger-color); border: 1px solid #fee2e2; }

.device-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.device-sessions {
  border-top: 1px solid var(--surface-border);
  background: #f8fafc;
}

.sessions-toggle {
  width: 100%;
  padding: 14px 24px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.sessions-toggle:hover {
  color: var(--text-primary);
}

.sessions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px 12px;
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 12px;
  font-size: 12px;
}

.batch-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
}

.batch-select-wrap:hover {
  color: var(--text-primary);
}

.batch-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-color);
}

.session-count {
  background: #e2e8f0;
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
}

.sessions-list {
  padding: 0 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-item {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-xs);
  gap: 12px;
  transition: border-color 0.15s ease;
  position: relative;
}

.session-item.selected {
  border-color: var(--accent-color);
  background: #f8faff;
}

.session-item:hover {
  border-color: #cbd5e1;
}

.session-info-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.session-icon {
  width: 32px;
  height: 32px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.session-icon img {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.session-text-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.session-host-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.session-host {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.ls-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--success-light);
  color: #047857;
  border: 1px solid var(--success-border);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.ls-tag {
  background: #f1f5f9;
  color: #475569;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: ui-monospace, monospace;
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 3-Dots Dropdown Menu */
.menu-container {
  position: relative;
  display: inline-block;
}

.btn-dots {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-dots:hover {
  background: #f1f5f9;
  color: var(--text-primary);
  border-color: var(--surface-border);
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  width: 185px;
  padding: 6px;
  z-index: 9999;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.dropdown-menu.show {
  display: flex;
  animation: scaleUp 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Captures Gallery Modal Styles */
.captures-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.captures-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.captures-tab-btn.active {
  background: var(--accent-light);
  color: var(--accent-color);
  border-color: var(--accent-border);
}

.captures-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 14px;
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 14px;
  font-size: 12.5px;
}

.captures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px;
}

.capture-card {
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.capture-card.selected {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.capture-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.capture-card-img-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  background: #0f172a;
}

.capture-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.capture-card-top-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.capture-card-top-bar * {
  pointer-events: auto;
}

.capture-del-btn {
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
  backdrop-filter: blur(4px);
}

.capture-del-btn:hover {
  background: var(--danger-color);
}

.capture-card-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  background: #ffffff;
}

.capture-card-time {
  font-weight: 600;
  color: var(--text-primary);
}

.capture-card-url {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.12s ease;
}

.dropdown-item:hover {
  background: #f1f5f9;
}

.dropdown-item.danger {
  color: var(--danger-color);
}

.dropdown-item.danger:hover {
  background: var(--danger-light);
}

/* ============================================================================
   TABLES
   ============================================================================ */
.section-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 14px 18px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--surface-border);
  background: #f8fafc;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 14px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--surface-border);
  color: var(--text-primary);
  transition: background 0.12s ease;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f8fafc;
}

/* ============================================================================
   PROFILE CARD
   ============================================================================ */
.profile-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 520px;
  box-shadow: var(--shadow-md);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.profile-header h3 {
  font-size: 19px;
  color: var(--text-primary);
  font-weight: 700;
}

/* ============================================================================
   MODALS
   ============================================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-xl);
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.modal-card.modal-lg {
  max-width: 650px;
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-header h2 {
  font-size: 19px;
  color: var(--text-primary);
  font-weight: 700;
}

.modal-close {
  background: #f1f5f9;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.15s ease;
  display: flex;
}

.modal-close:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

.ls-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ls-code-view {
  background: #0f172a;
  color: #f8fafc;
  padding: 16px;
  border-radius: var(--radius-md);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  max-height: 350px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.modal-confirm {
  text-align: center;
}

.confirm-icon {
  font-size: 44px;
  margin-bottom: 14px;
}

.modal-confirm h3 {
  font-size: 19px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.modal-confirm p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-confirm .modal-actions {
  justify-content: center;
}

/* ============================================================================
   TOASTS
   ============================================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%) scale(0.95);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success-color);
  background: var(--success-light);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  flex-shrink: 0;
}

/* ============================================================================
   TOGGLES & CHECKBOXES
   ============================================================================ */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-row input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 42px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 24px;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

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

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

/* Empty States */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  background: var(--surface-color);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  font-weight: 500;
}

/* Role-based display */
body:not(.role-admin) .admin-only {
  display: none !important;
}

body:not(.role-agent) .agent-only {
  display: none !important;
}

/* Filter Select Control */
.filter-select {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.filter-select:hover {
  background: var(--surface-hover);
  border-color: #cbd5e1;
}

/* Blocked Domains Card & Forms */
.blocked-domains-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.quick-add-domain-form {
  display: flex;
  gap: 12px;
  align-items: center;
}

.domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  font-size: 12px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.filter-input {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  outline: none;
  font-size: 13px;
  font-family: var(--font-family);
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.filter-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
