:root {
  /* Modern Color Palette - Figma inspired */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  
  /* Neutrals */
  --bg-base: #fafbfc;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
}

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

body {
  background: 
    radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.02) 0%, transparent 100%),
    var(--bg-base);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding-bottom: 3rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Modern Card Design */
.card,
.glass-card,
.card-glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Navbar - Clean & Minimal */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.navbar-brand {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary) !important;
  padding: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo svg {
  flex-shrink: 0;
}

.brand-text {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 0.875rem !important;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary) !important;
  background: var(--border-light);
}

.nav-link:active {
  transform: scale(0.98);
}

.nav-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 0.5rem;
  display: none;
}

@media (min-width: 992px) {
  .nav-divider {
    display: block;
  }
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--border-light);
  margin-right: 0.5rem;
}

.nav-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  display: none;
}

@media (min-width: 992px) {
  .nav-user-name {
    display: block;
  }
}

.navbar-toggler {
  border: none;
  padding: 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

/* Modern Buttons */
.btn {
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

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

.btn-outline-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

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

.btn-outline-secondary:hover {
  background: var(--border-light);
  border-color: var(--border);
  color: var(--text-primary);
}

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

.btn-outline-dark:hover {
  background: var(--text-primary);
  color: white;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Form Controls */
.form-control,
.form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  background: var(--surface);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  outline: none;
}

.form-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* Table Styling */
.table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.table thead th {
  background: linear-gradient(to bottom, var(--bg-base), rgba(249, 250, 251, 0.5));
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 0.75rem;
  border: none;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.table tbody td {
  padding: 0.875rem 0.75rem;
  border-top: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
  background: white;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
  background: var(--bg-base) !important;
  transform: scale(1.002);
}

.table tbody tr:first-child td {
  border-top: none;
}

.table-responsive {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: white;
}

.table .fw-semibold {
  color: var(--text-primary);
  font-size: 0.875rem;
}

.table .text-muted {
  font-size: 0.75rem;
}

/* Time Display */
.time-display {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.time-display-date {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.time-display-time {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  line-height: 1.3;
}

/* Responsive Table */
@media (max-width: 768px) {
  .table thead th {
    padding: 0.75rem 0.5rem;
    font-size: 0.6875rem;
  }
  
  .table tbody td {
    padding: 0.75rem 0.5rem;
    font-size: 0.8125rem;
  }
  
  .table .fw-semibold {
    font-size: 0.8125rem;
  }
  
  .time-display-date {
    font-size: 0.75rem;
  }
  
  .time-display-time {
    font-size: 0.625rem;
  }
  
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Badges */
.badge {
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.badge-soft,
.text-bg-success,
.text-bg-secondary {
  border: 1px solid;
}

.badge.bg-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  color: white;
}

.text-bg-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: #059669;
}

.text-bg-secondary {
  background: rgba(107, 114, 128, 0.1);
  border-color: rgba(107, 114, 128, 0.2);
  color: var(--text-secondary);
}

/* Modal Improvements */
.modal-content {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
}

.modal-title {
  font-weight: 600;
  font-size: 1.125rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

.btn-close {
  opacity: 0.5;
}

.btn-close:hover {
  opacity: 1;
}

/* QR Code Box */
.qr-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  min-height: 280px;
}

.code-pill {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
  font-size: 0.8125rem;
  word-break: break-all;
  color: var(--text-secondary);
}

/* Toast Notifications */
#toastWrap {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-item.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-danger {
  border-left: 3px solid var(--danger);
}

.toast-info {
  border-left: 3px solid var(--info);
}

/* Utilities */
.text-muted {
  color: var(--text-secondary) !important;
}

.fw-semibold {
  font-weight: 600;
}

.small {
  font-size: 0.875rem;
}

hr {
  border-color: var(--border);
  opacity: 1;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
  .page-title {
    font-size: 1.5rem;
  }
  
  #toastWrap {
    right: 1rem;
    left: 1rem;
  }
  
  .toast-item {
    min-width: auto;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background: rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
}

/* Footer */
.site-footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copyright {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* Enhanced Card Designs */
.card.stat-card {
  position: relative;
  overflow: hidden;
}

.card.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* Status Indicators */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: block;
}

.status-indicator.status-active::before {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-indicator.status-inactive::before {
  background: var(--text-tertiary);
}

/* Code Display */
code {
  background: var(--border-light);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
  font-size: 0.875em;
  color: var(--primary);
}

/* Link Styling */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-tertiary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

