/* ================================================
   Quizzman Admin Console - Main Stylesheet
   Pure CSS, no frameworks
   ================================================ */

:root {
  /* Colors - Premium Enterprise */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #64748b;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --info: #0ea5e9;
  
  /* Accent colors */
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  
  /* Neutral */
  --bg-dark: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  --gradient-glow: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(139,92,246,0.1) 100%);
  
  /* Spacing */
  --sidebar-width: 280px;
  --topbar-height: 64px;
  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.25);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.hidden { display: none !important; }
.required { color: var(--danger); }

/* Icons */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.nav-link .icon {
  margin-right: 12px;
}

.btn .icon {
  margin-right: 8px;
}

/* Screen Management */
.screen { display: none; }
.screen.active { display: flex; }

/* ============================================
   LOGIN SCREEN - Modern Enterprise Design
   ============================================ */
#login-screen {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-dark);
  z-index: 0;
}

.login-bg-pattern {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(99,102,241,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139,92,246,0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(6,182,212,0.1) 0%, transparent 40%);
  animation: bgPulse 15s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.login-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Left Side - Branding */
.login-branding {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 80px;
  color: white;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.brand-logo svg {
  width: 56px;
  height: 56px;
}

.brand-logo h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-subtitle {
  font-size: 18px;
  color: rgba(255,255,255,0.7);
  max-width: 400px;
  line-height: 1.6;
  margin-bottom: 48px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: rgba(255,255,255,0.8);
}

.feature-icon {
  font-size: 24px;
}

/* Right Side - Login Form */
.login-container {
  width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 
    0 25px 50px -12px rgba(0,0,0,0.25),
    0 0 0 1px rgba(255,255,255,0.1);
}

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

.login-header h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Step Indicator */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.step {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.step.active {
  background: var(--gradient-primary);
  border-color: var(--primary);
  color: white;
}

.step.completed {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-line {
  width: 40px;
  height: 2px;
  background: var(--border-color);
  margin: 0 8px;
  transition: all 0.3s ease;
}

.step-line.active,
.step-line.completed {
  background: var(--primary);
}

/* Step Content */
.step-content {
  text-align: center;
}

.step-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.step-content h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

/* Login Step visibility */
.login-step { display: none; }
.login-step.active { display: block; }

/* Form Elements */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

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

.input-wrapper {
  position: relative;
}

.input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.input-toggle:hover {
  opacity: 1;
}

/* OTP Input */
.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-main);
  transition: all 0.2s ease;
}

.otp-digit:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.otp-separator {
  display: flex;
  align-items: center;
  font-size: 24px;
  color: var(--text-muted);
}

/* Resend Wrapper */
.resend-wrapper {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
}

/* Login Footer */
.login-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.login-footer p {
  font-size: 12px;
  margin-bottom: 12px;
}

.security-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.badge-security {
  background: var(--bg-main);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

/* Error Message */
.error-message {
  color: white;
  background: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-top: 16px;
  font-size: 14px;
  display: none;
  text-align: center;
}

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

/* Responsive */
@media (max-width: 1024px) {
  .login-branding {
    display: none;
  }
  
  .login-container {
    width: 100%;
    background: var(--gradient-dark);
  }
}

/* Main Layout */
#main-screen {
  min-height: 100vh;
}

/* Sidebar */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--gradient-dark);
  color: white;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
  border-right: 1px solid rgba(255,255,255,0.05);
}

#sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.sidebar-logo svg {
  width: 32px;
  height: 32px;
}

.sidebar-logo span {
  font-size: 18px;
  font-weight: 700;
}

.badge-admin {
  background: var(--gradient-primary);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.nav-menu {
  list-style: none;
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.4);
  padding: 16px 16px 8px;
  margin-top: 8px;
}

.nav-section:first-child {
  margin-top: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: var(--radius);
  margin-bottom: 2px;
  font-weight: 500;
  font-size: 14px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nav-link.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

.nav-link .icon {
  margin-right: 12px;
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0,0,0,0.2);
}

.admin-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.admin-details {
  flex: 1;
}

.admin-details span {
  display: block;
}

#admin-name {
  font-weight: 600;
  font-size: 14px;
}

#admin-email {
  font-size: 12px;
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(239,68,68,0.5);
  color: #fca5a5;
  width: 100%;
}

.btn-outline-danger:hover {
  background: rgba(239,68,68,0.2);
  border-color: var(--danger);
}

/* Main Content */
#content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
  background: var(--bg-main);
}

#sidebar.collapsed + #content {
  margin-left: 0;
}

/* Topbar */
#topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

#page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.realtime-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--bg-main);
  border-radius: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-dot.connected { background: var(--success); }
.status-dot.disconnected { background: var(--danger); animation: none; }

/* Page Content */
#page-content {
  flex: 1;
  padding: 24px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gradient-glow);
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 24px;
}

/* Grid */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Welcome Banner */
.welcome-banner {
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  box-shadow: 0 10px 40px rgba(99,102,241,0.3);
}

.welcome-content h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.welcome-content p {
  opacity: 0.9;
  max-width: 500px;
}

.welcome-stats {
  display: flex;
  gap: 32px;
}

.quick-stat {
  text-align: center;
  padding: 16px 24px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

.quick-stat-value {
  font-size: 28px;
  font-weight: 700;
  display: block;
}

.quick-stat-label {
  font-size: 12px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Stats Card Enhanced */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card-purple .stat-icon-bg { background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%); }
.stat-card-blue .stat-icon-bg { background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%); }
.stat-card-green .stat-icon-bg { background: linear-gradient(135deg, #22c55e 0%, #10b981 100%); }
.stat-card-orange .stat-icon-bg { background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%); }

.stat-icon-bg {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-info {
  flex: 1;
}

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

.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.stat-card .stat-change {
  font-size: 12px;
  margin-top: 8px;
  color: var(--text-secondary);
}

.stat-card .stat-change.positive { color: var(--success); }
.stat-card .stat-change.negative { color: var(--danger); }

/* Quick Actions */
.quick-actions-card .card-body { padding: 16px 24px; }

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  background: var(--bg-main);
}

.quick-action:hover {
  background: var(--gradient-glow);
  transform: translateY(-2px);
}

.qa-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.qa-text {
  font-size: 13px;
  font-weight: 500;
}

/* Service Health */
.service-health-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
}

.service-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 12px;
}

.service-dot.healthy { background: var(--success); box-shadow: 0 0 8px var(--success); }
.service-dot.warning { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.service-dot.error { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.service-name { flex: 1; font-weight: 500; }
.service-status { color: var(--text-muted); font-size: 13px; }

/* Resource Meters */
.resource-meters {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.resource-meter .rm-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.rm-bar {
  height: 8px;
  background: var(--bg-main);
  border-radius: 4px;
  overflow: hidden;
}

.rm-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

.empty-state p {
  font-weight: 500;
  color: var(--text-secondary);
}

.empty-state small {
  font-size: 13px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-main);
}

.btn-link {
  background: none;
  color: var(--primary);
  padding: 5px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  padding: 8px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

.btn-block {
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 8px;
}

/* Inputs */
.input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-otp {
  text-align: center;
  font-size: 24px;
  letter-spacing: 8px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 20px;
  padding-right: 36px;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  background: var(--primary);
  color: white;
}

.badge-success { background: var(--success); }
.badge-warning { background: var(--warning); color: #000; }
.badge-danger { background: var(--danger); }
.badge-secondary { background: var(--secondary); }

/* Table */
.table-container {
  overflow-x: auto;
}

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

.table th, .table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  background: var(--bg-main);
}

.table th.sortable {
  cursor: pointer;
  user-select: none;
}

.table th.sortable:hover {
  background: var(--border-color);
}

.table th .sort-icon {
  margin-left: 5px;
  opacity: 0.5;
}

.table th.sorted .sort-icon {
  opacity: 1;
}

.table tbody tr:hover {
  background: rgba(79, 70, 229, 0.05);
}

.table .actions {
  display: flex;
  gap: 5px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
}

.pagination-info {
  color: var(--text-muted);
  font-size: 13px;
}

.pagination-buttons {
  display: flex;
  gap: 5px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: none;
}

.modal-overlay.active { display: block; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  z-index: 201;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.passcode-input {
  display: flex;
  gap: 10px;
}

.passcode-input .input {
  flex: 1;
}

.danger-label {
  color: var(--danger);
  font-weight: 600;
}

/* Toast */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 15px 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 13px;
  color: var(--text-secondary);
}

.search-input {
  position: relative;
}

.search-input input {
  padding-left: 35px;
}

.search-input::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

/* Activity Feed */
.activity-feed {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-content strong {
  color: var(--text-primary);
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
}

/* Log Viewer */
.log-viewer {
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  padding: 15px;
  border-radius: var(--radius);
  height: 400px;
  overflow-y: auto;
}

.log-line {
  white-space: pre-wrap;
  word-break: break-all;
  padding: 2px 0;
}

.log-line.error { color: #f44747; }
.log-line.warn { color: #cca700; }
.log-line.info { color: #3794ff; }

/* Metric Cards for PM2 */
.metric-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.metric-item {
  flex: 1;
  text-align: center;
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Chart Container */
.chart-container {
  height: 200px;
  position: relative;
}

/* Diff Viewer */
.diff-viewer {
  font-family: monospace;
  font-size: 12px;
}

.diff-line {
  padding: 2px 8px;
}

.diff-line.added {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.diff-line.removed {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* Responsive */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
  }
  
  #sidebar.active {
    transform: translateX(0);
  }
  
  #content {
    margin-left: 0;
  }
  
  .filter-bar {
    flex-direction: column;
  }
}

/* User info badge for login */
.user-info-badge {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}
.user-info-badge strong {
  color: var(--primary);
}
