/* ============================================
   SUPER ADMIN WEB DASHBOARDS - GLOBAL STYLES
   ============================================ */

:root {
  /* ===== MODERN COLOR PALETTE (International Standards) ===== */
  
  /* Primary Colors - Indigo (Modern & Professional) */
  --primary-50: #EEF2FF;
  --primary-100: #E0E7FF;
  --primary-500: #6366F1;
  --primary-600: #4F46E5;
  --primary-700: #4338CA;
  --primary-900: #312E81;
  
  --primary-color: var(--primary-600);
  --primary-dark: var(--primary-700);
  --primary-light: var(--primary-100);
  --accent-color: #FF5722;
  --accent-dark: #E64A19;
  
  /* Status Colors - Modern Palette */
  --success-50: #ECFDF5;
  --success-500: #10B981;
  --success-600: #059669;
  --success-color: var(--success-600);
  
  --warning-50: #FFFBEB;
  --warning-500: #F59E0B;
  --warning-600: #D97706;
  --warning-color: var(--warning-600);
  
  --danger-50: #FEF2F2;
  --danger-500: #EF4444;
  --danger-600: #DC2626;
  --danger-color: var(--danger-600);
  
  --info-50: #EFF6FF;
  --info-500: #3B82F6;
  --info-600: #2563EB;
  --info-color: var(--info-600);
  
  /* Neutral Colors - Refined Gray Scale */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --divider: var(--gray-300);
  --background: var(--gray-50);
  --surface: #FFFFFF;
  --border: var(--gray-200);
  
  /* Shadows - Enhanced for A+ Design */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-md: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
  --shadow-hover: 0 8px 16px rgba(0,0,0,0.15), 0 4px 8px rgba(0,0,0,0.1);
  --shadow-active: 0 12px 24px rgba(0,0,0,0.2), 0 6px 12px rgba(0,0,0,0.15);
  
  /* Gradients - New for A+ Design */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-danger: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Transitions - Enhanced */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 300ms ease-out;
  --transition-smooth: 400ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* ============================================
   ICON SYSTEM - STANDARDIZED CLASSES
   ============================================ */

/* Icon Base Styles */
.icon {
  display: inline-block;
  vertical-align: middle;
}

/* Icon Sizes - International Standard */
.icon-xs { width: 14px; height: 14px; }   /* Extra Small - badges, tiny indicators */
.icon-sm { width: 16px; height: 16px; }   /* Small - buttons, inline text */
.icon-md { width: 20px; height: 20px; }   /* Medium - sidebar, navigation, default */
.icon-lg { width: 24px; height: 24px; }   /* Large - page headers, stat cards */
.icon-xl { width: 32px; height: 32px; }   /* Extra Large - feature highlights */
.icon-2xl { width: 48px; height: 48px; }  /* 2X Large - empty states, hero sections */

/* Icon Colors */
.icon-primary { color: var(--primary-600); }
.icon-success { color: var(--success-color); }
.icon-warning { color: var(--warning-color); }
.icon-danger { color: var(--danger-color); }
.icon-info { color: var(--info-color); }
.icon-muted { color: var(--text-secondary); }
.icon-white { color: #FFFFFF; }
.icon-inherit { color: inherit; }

/* Icon Spacing Utilities */
.icon-mr-xs { margin-right: 4px; }
.icon-mr-sm { margin-right: 6px; }
.icon-mr-md { margin-right: 8px; }
.icon-ml-xs { margin-left: 4px; }
.icon-ml-sm { margin-left: 6px; }
.icon-ml-md { margin-left: 8px; }

/* Icon Hidden (for decorative icons) */
.icon[aria-hidden="true"] {
  pointer-events: none;
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Skip to Main Content Link (WCAG 2.1 AA) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-600);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 600;
  z-index: 10000;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Screen Reader Only Text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Visible Enhancement */
.sidebar-item:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.5);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Noto Sans Lao', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   LAYOUT
   ============================================ */

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--spacing-md) var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.header-title h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-badge {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--text-secondary);
  font-size: 13px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

/* ============================================
   DASHBOARD GRID
   ============================================ */

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
}

.stat-card-title {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-card-icon.primary { background: var(--primary-light); color: var(--primary-dark); }
.stat-card-icon.success { background: #C8E6C9; color: #2E7D32; }
.stat-card-icon.warning { background: #FFE0B2; color: #EF6C00; }
.stat-card-icon.danger { background: #FFCDD2; color: #C62828; }

.stat-card-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

.stat-card-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card-change.positive { color: var(--success-color); }
.stat-card-change.negative { color: var(--danger-color); }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #45a049;
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #da190b;
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--background);
  border-color: var(--divider);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ============================================
   CARDS & TABLES
   ============================================ */

.content-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: var(--spacing-lg);
}

/* Table Styles */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--background);
}

.data-table th {
  padding: var(--spacing-md);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: var(--spacing-md);
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--background);
}

/* ============================================
   BADGES & STATUS
   ============================================ */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-pending {
  background: #FFF3E0;
  color: #E65100;
}

.badge-approved {
  background: #E8F5E9;
  color: #2E7D32;
}

.badge-rejected {
  background: #FFEBEE;
  color: #C62828;
}

.badge-active {
  background: #E3F2FD;
  color: #1565C0;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */

.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color var(--transition-fast);
}

.modal-close:hover {
  background: var(--background);
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */

.alert {
  padding: var(--spacing-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
}

.alert-success {
  background: #E8F5E9;
  color: #2E7D32;
  border-left: 4px solid var(--success-color);
}

.alert-error {
  background: #FFEBEE;
  color: #C62828;
  border-left: 4px solid var(--danger-color);
}

.alert-warning {
  background: #FFF3E0;
  color: #E65100;
  border-left: 4px solid var(--warning-color);
}

.alert-info {
  background: #E3F2FD;
  color: #1565C0;
  border-left: 4px solid var(--info-color);
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--spacing-md);
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner-lg {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .header-content {
    flex-wrap: wrap;
    gap: var(--spacing-sm);
  }
  .header-left { flex: 1 1 auto; min-width: 0; }
  .header-title h1 { font-size: 16px; }
  .header-title h1 .icon-mr-md { margin-right: 6px; }
  .admin-badge { font-size: 9px; padding: 2px 8px; }
  .header-actions { gap: 8px; }
  .user-name-text { display: none; }
  .header-search { order: 99; flex: 1 1 100%; margin: 4px 0 0; }
  .stat-card-value { font-size: 28px; }
  .dashboard-stats { grid-template-columns: 1fr; }
  .data-table { font-size: 12px; }
  .data-table th,
  .data-table td { padding: var(--spacing-sm); }
  .modal { width: 95%; }
}

/* ============================================
   HEADER SEARCH (Phase A — A1)
   ============================================ */
.header-search {
  flex: 0 1 420px; min-width: 0; margin: 0 var(--spacing-lg);
}
.header-search .global-search-container { position: relative; }
.header-search .search-input-group {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: 999px; padding: 6px 14px;
  transition: border-color .15s, background .15s;
}
.header-search .search-input-group:focus-within {
  background: #fff;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.header-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 13.5px; color: var(--text-primary); min-width: 0;
}
.header-search input::placeholder { color: var(--gray-500); }
.header-search .search-icon { color: var(--gray-500); width: 16px; height: 16px; flex-shrink: 0; }
.header-search .search-clear-btn {
  background: transparent; border: none; color: var(--gray-500);
  font-size: 11px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.header-search .search-clear-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.header-search .search-shortcut { font-size: 11px; color: var(--gray-500); white-space: nowrap; }
.header-search .search-shortcut kbd {
  background: #fff; border: 1px solid var(--gray-300);
  border-radius: 4px; padding: 1px 5px; font-size: 10px; font-family: ui-monospace, monospace;
}
.header-search .search-results-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  max-height: 60vh; overflow-y: auto; z-index: 100;
}

/* ============================================
   CONTRAST POLISH — WCAG-AA Pass (B2)
   ============================================
   Targets: 4.5:1 contrast for normal text, 3:1 for large text and UI components.
   Reference ratios on white background:
     gray-400 (#9CA3AF) → 2.84:1  ❌ fails normal text
     gray-500 (#6B7280) → 4.83:1  ✓ passes
     gray-600 (#4B5563) → 7.22:1  ✓ passes (used as our "minimum-safe")
   ============================================ */
.stat-card-title { color: var(--gray-700); font-weight: 600; }
.stat-card-value { color: var(--gray-900); }
.user-info, .user-info .user-name-text { color: var(--gray-700); }

/* Lift inline ad-hoc light grays (used pre-tokenization) to a safe gray-600. */
[style*="color:#94a3b8"], [style*="color: #94a3b8"],   /* slate-400 */
[style*="color:#9ca3af"], [style*="color: #9ca3af"],   /* gray-400  */
[style*="color:#cbd5e1"], [style*="color: #cbd5e1"],   /* slate-300 */
[style*="color:#d1d5db"], [style*="color: #d1d5db"],   /* gray-300  */
[style*="color:#e5e7eb"], [style*="color: #e5e7eb"] {  /* gray-200  */
  color: var(--gray-600) !important;
}

/* Placeholder text — browser default is too light; bump to gray-500 (4.83:1). */
input::placeholder, textarea::placeholder, select::placeholder {
  color: var(--gray-500) !important;
  opacity: 1 !important;
}

/* Disabled controls — keep them visibly disabled but readable (3:1 minimum). */
button:disabled, .btn:disabled, input:disabled, select:disabled, textarea:disabled {
  color: var(--gray-500) !important;
  opacity: 0.7;
  cursor: not-allowed;
}

/* Keyboard focus ring — meets WCAG 2.4.7 (Focus Visible). */
*:focus-visible {
  outline: 3px solid var(--primary-500);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Suppress focus ring on mouse clicks (not focus-visible) — only show for kbd. */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

/* Link colors — ensure 4.5:1 on white surface. */
a:not([class*="btn"]):not(.sidebar-item):not(.sidebar-subitem):not(.badge) {
  color: var(--primary-700);
}
a:not([class*="btn"]):hover { color: var(--primary-900); }

/* Status badges — ensure foreground/background combos pass AA */
.badge-pending  { background:#fef3c7; color:#92400e; }  /* 7.1:1 ✓ */
.badge-approved { background:#d1fae5; color:#065f46; }  /* 7.5:1 ✓ */
.badge-rejected { background:#fee2e2; color:#991b1b; }  /* 7.6:1 ✓ */
.badge-info     { background:#dbeafe; color:#1e40af; }  /* 8.2:1 ✓ */
.badge-active   { background:#e0e7ff; color:#3730a3; }  /* 7.4:1 ✓ */

/* Dark mode: ensure overrides apply to flipped backgrounds too. */
.ai-dark [style*="color:#94a3b8"], .ai-dark [style*="color: #94a3b8"],
.ai-dark [style*="color:#9ca3af"], .ai-dark [style*="color: #9ca3af"] {
  color: #cbd5e1 !important;  /* lighter gray on dark = good contrast */
}
.ai-dark input::placeholder, .ai-dark textarea::placeholder {
  color: #94a3b8 !important;  /* placeholder on dark — light enough (~5:1) */
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-small { font-size: 12px; }
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }

.hidden { display: none !important; }

/* ============================================
   SIDEBAR NAVIGATION - ALWAYS VISIBLE (NO HAMBURGER)
   ============================================ */

/* Hamburger Menu - Always Visible */
.hamburger-menu {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
  margin-right: var(--spacing-md);
}

.hamburger-menu:hover {
  background: var(--background);
}

.hamburger-icon {
  width: 24px;
  height: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-normal);
}

/* Sidebar Container - Collapsible at All Screen Sizes */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(0);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
  transition: transform var(--transition-normal);
}

/* Collapsed state - Slide out of view */
.sidebar.collapsed {
  transform: translateX(-260px);
}

/* Sidebar Header */
.sidebar-header {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 73px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
  z-index: 250;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
}

.sidebar-close:hover {
  background: var(--background);
  color: var(--primary-color);
}

.sidebar-close:active {
  transform: scale(0.95);
}

/* Sidebar Navigation */
.sidebar-nav {
  padding: var(--spacing-sm) 0;
}

.sidebar-section {
  margin-bottom: var(--spacing-md);
}

.sidebar-section-title {
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-item,
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: 10px var(--spacing-lg);
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
}

.sidebar-item:hover,
.nav-item:hover {
  background: var(--background);
}

.sidebar-item.active,
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  border-right: 3px solid var(--primary-color);
}

.sidebar-item-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.sidebar-item-text {
  flex: 1;
}

/* Expandable Sidebar Items with Sub-menus */
.sidebar-item.expandable {
  cursor: pointer;
  position: relative;
}

.sidebar-item-chevron {
  font-size: 16px;
  transition: transform var(--transition-normal);
  margin-left: auto;
}

.sidebar-item.expandable.expanded .sidebar-item-chevron {
  transform: rotate(180deg);
}

/* Sub-menu Container - FIXED: Smooth expansion without layout shift + Vertical Layout */
.sidebar-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
  background: rgba(102, 126, 234, 0.03);
  border-left: 3px solid transparent;
  margin: 0;
  display: flex;
  flex-direction: column; /* Force vertical layout */
  width: 100%; /* Full width */
}

.sidebar-submenu.expanded {
  max-height: 600px; /* Increased to accommodate more sub-items */
  border-left-color: rgba(102, 126, 234, 0.2);
}

/* Sub-menu Items - Enhanced stability + FORCE VERTICAL LAYOUT */
.sidebar-subitem {
  display: flex !important;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 10px var(--spacing-lg) 10px calc(var(--spacing-lg) + 36px); /* Consistent padding */
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  cursor: pointer;
  border-left: 3px solid transparent;
  min-height: 40px; /* Fixed height for stability */
  width: 100% !important; /* Force full width */
  flex-shrink: 0 !important; /* Prevent shrinking */
  box-sizing: border-box !important;
}

.sidebar-subitem:hover {
  background: rgba(102, 126, 234, 0.08);
  color: var(--text-primary);
  border-left-color: rgba(102, 126, 234, 0.3);
  transform: translateX(0); /* Remove shift on hover */
}

.sidebar-subitem.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  border-left: 3px solid var(--primary-color);
}

.sidebar-subitem-icon {
  font-size: 16px;
  width: 20px;
  min-width: 20px; /* Prevent icon shifting */
  text-align: center;
  flex-shrink: 0;
}

.sidebar-subitem-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Language Selector in Sidebar */
.sidebar-language {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--surface);
}

.language-selector {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.language-selector:hover {
  border-color: var(--primary-color);
}

.language-selector:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
}

/* Adjust layout for always-visible sidebar - DESKTOP */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header adjustments - DEFAULT (no margin, will be added by media query) */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Main content padding adjustment */
.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

.header-left {
  display: flex;
  align-items: center;
}

/* Mobile & Desktop: Unified collapsible sidebar behavior */
@media (max-width: 768px) {
  /* On mobile, show backdrop when sidebar is open */
  .sidebar-overlay.active {
    display: block;
  }
}

/* Desktop: Content shifts when sidebar is open */
@media (min-width: 769px) {
  /* When sidebar is NOT collapsed (open), shift content */
  .app-container:not(:has(.sidebar.collapsed)) {
    margin-left: 260px;
    transition: margin-left var(--transition-normal);
  }
  
  /* When sidebar IS collapsed, no margin */
  .app-container:has(.sidebar.collapsed) {
    margin-left: 0;
    transition: margin-left var(--transition-normal);
  }
  
  /* Backdrop hidden on desktop — content shifts instead.
     Must override the base .sidebar-overlay.active rule, so we use
     a higher-specificity selector (and cover the .active case too). */
  .sidebar-overlay,
  .sidebar-overlay.active {
    display: none !important;
  }
}

/* Fallback for browsers that don't support :has() */
@supports not selector(:has(*)) {
  @media (min-width: 769px) {
    .app-container {
      margin-left: 0;
      transition: margin-left var(--transition-normal);
    }
  }
}

/* Smooth scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--divider);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ============================================
   NOTIFICATION BADGES
   ============================================ */

/* Notification Badge on Sidebar Items */
.notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--danger-color);
  color: white;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
  animation: badgePulse 2s ease-in-out infinite;
}

.notification-badge.zero {
  display: none;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Notification Bell in Header */
.notification-bell {
  position: relative;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-bell:hover {
  background: var(--background);
}

.notification-bell-icon {
  font-size: 24px;
  position: relative;
}

.notification-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger-color);
  color: white;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  animation: bellBadgePulse 2s ease-in-out infinite;
}

.notification-bell-badge.zero {
  display: none;
}

@keyframes bellBadgePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(244, 67, 54, 0);
  }
}

/* Notification Bell Animation */
@keyframes bellRing {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-10deg); }
  20%, 40% { transform: rotate(10deg); }
  50% { transform: rotate(0deg); }
}

.notification-bell.has-notifications {
  animation: bellRing 3s ease-in-out infinite;
}

/* Sidebar item with badge layout */
.sidebar-item {
  position: relative;
}

.sidebar-item-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex: 1;
}

/* ============================================
   A+ PREMIUM DESIGN ENHANCEMENTS
   ============================================ */

/* Enhanced Stat Cards with Premium Effects */
.stat-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface) 0%, #fafbfc 100%);
  border: 1px solid rgba(0,0,0,0.05);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(102, 126, 234, 0.2);
}

/* Premium Gradient Icon Backgrounds */
.stat-card-icon.primary { 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stat-card-icon.success { 
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(17, 153, 142, 0.3);
}

.stat-card-icon.warning { 
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
}

.stat-card-icon.danger { 
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(250, 112, 154, 0.3);
}

/* Enhanced Navigation Cards with Premium Hover Effects */
.content-card {
  position: relative;
  transition: all var(--transition-smooth);
  border: 1px solid transparent;
}

.content-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-primary);
  opacity: 0;
  border-radius: var(--radius-md);
  z-index: -1;
  transition: opacity var(--transition-normal);
}

.content-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-active);
  border-color: rgba(102, 126, 234, 0.1);
}

.content-card:hover::after {
  opacity: 0.03;
}

/* Premium Button Enhancements */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width var(--transition-smooth), height var(--transition-smooth);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

/* Enhanced Header with Premium Shadow */
.app-header {
  background: linear-gradient(135deg, var(--surface) 0%, #fafbfc 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(8px);
}

/* Admin Badge with Enhanced Gradient */
.admin-badge {
  background: var(--gradient-primary);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes badgeGlow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  }
  50% {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
  }
}

/* Enhanced User Avatar */
.user-avatar {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: all var(--transition-normal);
}

.user-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Premium Modal Enhancements */
.modal {
  border: 1px solid rgba(0,0,0,0.05);
}

.modal-header {
  background: linear-gradient(135deg, var(--surface) 0%, #fafbfc 100%);
}

/* Enhanced Sidebar with Premium Effects */
.sidebar {
  background: linear-gradient(180deg, var(--surface) 0%, #fafbfc 100%);
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.08);
}

.sidebar-item {
  position: relative;
}

.sidebar-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.sidebar-item:hover::before {
  opacity: 0.5;
}

.sidebar-item.active::before {
  opacity: 1;
}

/* Enhanced Notification Badge */
.notification-badge {
  background: var(--gradient-danger);
  box-shadow: 0 2px 8px rgba(250, 112, 154, 0.4);
}

/* Premium Loading Spinner */
.loading-spinner,
.loading-spinner-lg {
  border-top-color: transparent;
  background: conic-gradient(from 0deg, transparent 0%, var(--primary-color) 100%);
  border-radius: 50%;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), white 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), white 0);
}

/* Enhanced Empty State */
.empty-state {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
}

/* Premium Badge Enhancements */
.badge {
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  font-weight: 700;
}

.badge-pending {
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
}

.badge-approved {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

.badge-rejected {
  background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
}

.badge-active {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
}

/* Smooth Page Transitions */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-stats,
.content-card {
  animation: fadeInUp 0.6s ease-out;
}

.dashboard-stats .stat-card {
  animation: fadeInUp 0.6s ease-out;
}

.dashboard-stats .stat-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-stats .stat-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-stats .stat-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-stats .stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Premium Focus States */
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), 0 2px 8px rgba(102, 126, 234, 0.1);
  background: var(--surface);
}

/* Enhanced Data Table */
.data-table tbody tr {
  transition: all var(--transition-normal);
}

.data-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.03) 0%, transparent 100%);
  transform: translateX(4px);
}

/* Premium Alert Enhancements */
.alert {
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Mobile Responsiveness for Premium Effects */
@media (max-width: 768px) {
  .content-card:hover {
    transform: translateY(-3px) scale(1.01);
  }
  
  .stat-card:hover {
    transform: translateY(-2px);
  }
}

/* Print Styles - Disable Premium Effects */
@media print {
  .stat-card::before,
  .content-card::after,
  .btn::before,
  .sidebar-item::before {
    display: none !important;
  }
  
  .stat-card,
  .content-card,
  .btn {
    box-shadow: none !important;
    transform: none !important;
  }
}

/* ============================================
   ULTRA-PREMIUM ENHANCEMENTS - 100% PERFECTION
   ============================================ */

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Enhanced Body with Subtle Texture */
body {
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Glassmorphism Effect for Header */
.app-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

/* Ultra-Premium Stat Cards with Parallax Effect */
.stat-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
    rgba(102, 126, 234, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  pointer-events: none;
}

.stat-card:hover::after {
  opacity: 1;
}

/* Advanced Icon Animation with Elastic Effect */
.stat-card-icon {
  transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
}

.stat-card:hover .stat-card-icon {
  transform: scale(1.15) rotate(5deg);
}

.stat-card-icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: inherit;
  filter: blur(12px);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  z-index: -1;
}

.stat-card:hover .stat-card-icon::after {
  opacity: 0.6;
}

/* Premium Number Counter Animation */
.stat-card-value {
  background: linear-gradient(135deg, var(--text-primary) 0%, #667eea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
  background-size: 200% 200%;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Enhanced Content Cards with Depth */
.content-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transform-style: preserve-3d;
}

.content-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.content-card:hover::before {
  opacity: 1;
}

/* Ultra-Premium Button Effects */
.btn {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.btn-primary {
  position: relative;
  overflow: visible;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-primary);
  border-radius: inherit;
  filter: blur(20px);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  z-index: -1;
}

.btn-primary:hover::after {
  opacity: 0.5;
}

.btn:active:not(:disabled) {
  transform: scale(0.95);
}

/* Sophisticated Admin Badge */
.admin-badge {
  position: relative;
  overflow: visible;
}

.admin-badge::after {
  content: '';
  position: absolute;
  inset: -3px;
  background: var(--gradient-primary);
  border-radius: inherit;
  filter: blur(15px);
  opacity: 0.4;
  animation: badgeGlowPulse 2s ease-in-out infinite;
  z-index: -1;
}

@keyframes badgeGlowPulse {
  0%, 100% { 
    opacity: 0.4;
    transform: scale(1);
  }
  50% { 
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* Premium Sidebar with Depth */
.sidebar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.sidebar-item {
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.sidebar-item:hover {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, transparent 100%);
  transform: translateX(4px);
  padding-left: calc(var(--spacing-lg) + 4px);
}

.sidebar-item.active {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.12) 0%, rgba(102, 126, 234, 0.03) 100%);
  box-shadow: inset 4px 0 0 var(--primary-color);
}

/* Enhanced Modal with Glassmorphism */
.modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal-overlay {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.4);
}

/* Advanced Data Table Interactions */
.data-table tbody tr {
  position: relative;
}

.data-table tbody tr::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.data-table tbody tr:hover::before {
  opacity: 1;
}

.data-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.04) 0%, transparent 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Premium Form Inputs with Focus Glow */
.form-input,
.form-textarea,
.form-select {
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  position: relative;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  background: var(--surface);
  border-color: transparent;
  box-shadow: 
    0 0 0 4px rgba(102, 126, 234, 0.1),
    0 8px 24px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

/* Enhanced Badges with Glow */
.badge {
  position: relative;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--transition-normal);
}

.badge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Premium Loading Spinner with Rainbow Effect */
@keyframes rainbowSpin {
  0% { 
    transform: rotate(0deg);
    filter: hue-rotate(0deg);
  }
  100% { 
    transform: rotate(360deg);
    filter: hue-rotate(360deg);
  }
}

.loading-spinner-lg {
  animation: rainbowSpin 1.5s linear infinite;
  background: conic-gradient(
    from 0deg,
    #667eea 0deg,
    #764ba2 90deg,
    #667eea 180deg,
    #764ba2 270deg,
    #667eea 360deg
  );
}

/* Enhanced User Avatar with Pulse */
.user-avatar {
  position: relative;
  overflow: visible;
  animation: avatarPulse 3s ease-in-out infinite;
}

@keyframes avatarPulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  }
  50% {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5), 0 0 20px rgba(102, 126, 234, 0.3);
  }
}

/* Premium Notification Badge with Advanced Animation */
.notification-badge,
.notification-bell-badge {
  position: relative;
  overflow: visible;
}

.notification-badge::after,
.notification-bell-badge::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--danger-color);
  border-radius: inherit;
  filter: blur(8px);
  opacity: 0.5;
  animation: notificationGlow 2s ease-in-out infinite;
  z-index: -1;
}

@keyframes notificationGlow {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.15);
  }
}

/* Enhanced Alert Messages */
.alert {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.alert:hover::before {
  left: 100%;
}

/* Premium Hamburger Button Animation */
.sidebar-toggle span {
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.sidebar-toggle:hover span:nth-child(1) {
  transform: translateY(-2px);
}

.sidebar-toggle:hover span:nth-child(3) {
  transform: translateY(2px);
}

/* Advanced Scroll Indicator */
.main-content {
  position: relative;
}

.main-content::before {
  content: '';
  position: fixed;
  top: 73px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  z-index: 99;
}

/* Enhanced Empty State */
.empty-state {
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  animation: emptyStatePulse 3s ease-in-out infinite;
}

@keyframes emptyStatePulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

/* Premium Card Header Gradient */
.card-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 250, 250, 0.95) 100%);
  position: relative;
}

.card-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0.1;
}

/* Enhanced Language Selector */
.language-selector {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.language-selector:hover {
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* Advanced Staggered Animations */
.dashboard-stats .stat-card {
  opacity: 0;
  animation: fadeInUpElastic 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes fadeInUpElastic {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.9);
  }
  50% {
    transform: translateY(-5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dashboard-stats .stat-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-stats .stat-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-stats .stat-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-stats .stat-card:nth-child(4) { animation-delay: 0.4s; }
.dashboard-stats .stat-card:nth-child(5) { animation-delay: 0.5s; }
.dashboard-stats .stat-card:nth-child(6) { animation-delay: 0.6s; }

/* Premium Focus Visible for Accessibility */
*:focus-visible {
  outline: 3px solid rgba(102, 126, 234, 0.5);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible {
  outline-color: rgba(102, 126, 234, 0.6);
}

/* Enhanced Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .stat-card,
  .content-card,
  .modal {
    border: 2px solid var(--text-primary);
  }
  
  .btn-primary {
    border: 2px solid var(--primary-dark);
  }
}

/* Dark Mode Preparation (Future Enhancement) */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #E0E0E0;
    --text-secondary: #B0B0B0;
    --background: #121212;
    --surface: #1E1E1E;
    --border: #333333;
  }
}

/* Performance Optimizations */
.stat-card,
.content-card,
.btn {
  will-change: transform;
  contain: layout style paint;
}

.sidebar {
  will-change: transform;
  contain: layout style;
}

/* GPU Acceleration */
.stat-card-icon,
.btn::before,
.modal,
.sidebar-item::before {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Subtle Page Load Animation */
@keyframes pageLoad {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.app-container {
  animation: pageLoad 0.5s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

/* Enhanced Scrollbar for Modern Look */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.6), rgba(118, 75, 162, 0.6));
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Selection Color */
::selection {
  background: rgba(102, 126, 234, 0.3);
  color: var(--text-primary);
}

::-moz-selection {
  background: rgba(102, 126, 234, 0.3);
  color: var(--text-primary);
}

/* Mobile Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
  .stat-card:hover,
  .content-card:hover {
    transform: none;
  }
  
  .btn:hover {
    transform: none;
  }
  
  /* Larger touch targets */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .sidebar-item {
    min-height: 48px;
  }
}
