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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f8f9fa;
  min-height: 100vh;
  color: #1a1a1a;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px;
}

/* Header */
.header {
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-left h1 {
  font-size: 32px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.header-left p {
  color: #6b7280;
  font-size: 15px;
}

.auto-update-badge {
  background: #10b981;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auto-update-badge.paused {
  background: #6b7280;
}

.pulse {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.timer {
  font-size: 12px;
  opacity: 0.9;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 28px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.stat-label {
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .value {
  color: #1a1a1a;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -1px;
}

/* Control Panel */
.control-panel {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.button-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1a;
  color: white;
}

.btn:hover {
  background: #2d2d2d;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-secondary {
  background: white;
  color: #1a1a1a;
  border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-toggle {
  background: #10b981;
}

.btn-toggle:hover {
  background: #059669;
}

.btn-toggle.paused {
  background: #6b7280;
}

.btn-toggle.paused:hover {
  background: #4b5563;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f9fafb;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  min-width: 280px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  width: 100%;
  color: #1a1a1a;
}

.search-box input::placeholder {
  color: #9ca3af;
}

/* Status Bar */
.status-bar {
  background: white;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  border: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-text {
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

.progress-bar-container {
  width: 300px;
  height: 6px;
  background: #f3f4f6;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #1a1a1a;
  width: 0%;
  transition: width 0.3s ease;
}

/* Table */
.table-container {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.table-header {
  background: #fafbfc;
  padding: 16px 0;
  display: grid;
  grid-template-columns: 2fr 120px 120px 120px 120px 120px 140px;
  gap: 16px;
  align-items: center;
  font-weight: 500;
  color: #6b7280;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e5e7eb;
}

.table-header > div {
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-buttons {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sort-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 9px;
  padding: 2px;
  line-height: 1;
  transition: color 0.15s;
}

.sort-btn:hover {
  color: #1a1a1a;
}

.table-content {
  max-height:fit-content;
  overflow-y: auto;
}

.site-row {
  display: grid;
  grid-template-columns: 2fr 120px 120px 120px 120px 120px 140px;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.15s;
}

.site-row:hover {
  background: #fafbfc;
}

.site-row:last-child {
  border-bottom: none;
}

.site-name {
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  color: #1a1a1a;
  font-size: 14px;
}

.expand-icon {
  color: #9ca3af;
  font-size: 10px;
  transition: transform 0.2s;
}

.expand-icon.expanded {
  transform: rotate(90deg);
}

.stat-value {
  text-align: center;
  font-weight: 600;
  padding: 0 24px;
  font-size: 15px;
}

.stat-value.success { color: #10b981; font-size: medium; }
.stat-value.danger { color: #ef4444; font-size: medium; }
.stat-value.warning { color: #f59e0b; font-size: medium; }
.stat-value.accent { color: #6366f1; }
.stat-value.dark { color: #1a1a1a; font-size: medium; }

.stat-value.stat-value-success { color: #10b981;font-size: large; }
.stat-value.stat-value-danger { color: #ef4444;font-size: large; }
.stat-value.stat-value-warning { color: #f59e0b;font-size: large; }
.stat-value.accent { color: #6366f1;  font-size: medium; }
.stat-value { color: #1a1a1a;font-size: large; }

.status-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.complete {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.pending {
  background: #e0e7ff;
  color: #3730a3;
}

/* Device Details */
.device-details {
  background: #fafbfc;
  padding: 24px;
  display: none;
  border-top: 1px solid #f3f4f6;
  margin-left: 40px;
  margin-right: 10px;
  border-left: 2px solid #e5e7eb;
  border-radius: 0 0 8px 8px;
}

.device-details.show {
  display: block;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

/* Gateway Section */
.gateway-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.gateway-section h4,
.devices-section h4 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gateway-status-empty {
  color: #9ca3af;
  font-size: 13px;
  padding: 12px 0;
  text-align: center;
}

.gateway-status-summary {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f3f4f6;
  flex-wrap: wrap;
}

.gateway-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.gateway-icon {
  font-size: 12px;
}

.gateway-icon.online { color: #10b981; }
.gateway-icon.offline { color: #ef4444; }
.gateway-icon.total { color: #6b7280; }

.gateway-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gateway-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  transition: all 0.15s ease;
}

.gateway-item:hover {
  border-color: #d1d5db;
  background: white;
}

.gateway-item.online {
  border-left: 3px solid #10b981;
}

.gateway-item.offline {
  border-left: 3px solid #ef4444;
}

.gateway-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gateway-name {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

.gateway-desc {
  font-size: 12px;
  color: #6b7280;
}

.gateway-status-badge {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gateway-status-badge.online {
  background: #d1fae5;
  color: #065f46;
}

.gateway-status-badge.offline {
  background: #fee2e2;
  color: #991b1b;
}

/* Devices Section */
.devices-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.device-type-group {
  margin-bottom: 24px;
}

.device-type-header {
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.device-type-icon {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #6366f1;
}

.device-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: all 0.15s ease;
}

.device-item:hover {
  border-color: #d1d5db;
  background: #fafbfc;
}

/* Custom Checkbox */
.checkbox-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.device-checkbox {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
  top: 0;
  left: 0;
  z-index: 2;
}

.checkbox-box {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  background: white;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.checkbox-wrapper:hover .checkbox-box {
  border-color: #9ca3af;
}

.device-checkbox:checked ~ .checkbox-box {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

.checkmark {
  width: 10px;
  height: 10px;
  display: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.device-checkbox:checked ~ .checkbox-box .checkmark {
  display: block;
  opacity: 1;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online { background: #10b981; }
.status-dot.offline { background: #ef4444; }
.status-dot.never { background: #f59e0b; }

.device-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #6b7280;
  font-size: 13px;
  flex: 1;
  min-width: 0;
}

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

.device-info strong {
  color: #1a1a1a;
  font-weight: 500;
}

.device-gateway {
  display: inline-block;
  padding: 2px 8px;
  background: #f3f4f6;
  border-radius: 4px;
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
}

.device-gateway.no-gateway {
  background: #fee2e2;
  color: #991b1b;
}

/* File Input */
input[type="file"] {
  display: none;
}

.file-label {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1a;
  color: white;
}

.file-label:hover {
  background: #2d2d2d;
}

.file-label:active {
  transform: scale(0.98);
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-success {
  border-left: 4px solid #10b981;
  color: #065f46;
}

.notification-error {
  border-left: 4px solid #ef4444;
  color: #991b1b;
}

.notification-warning {
  border-left: 4px solid #f59e0b;
  color: #92400e;
}

.notification-info {
  border-left: 4px solid #3b82f6;
  color: #1e40af;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f4f6;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-message {
  color: white;
  font-size: 16px;
  font-weight: 500;
  margin-top: 20px;
}

/* Scrollbar */
.table-content::-webkit-scrollbar {
  width: 6px;
}

.table-content::-webkit-scrollbar-track {
  background: #f9fafb;
}

.table-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.table-content::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.empty-state {
  padding: 60px 24px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 1200px) {
  .table-header, .site-row {
    grid-template-columns: 2fr 100px 100px 100px 100px 100px 120px;
  }
  
  .details-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  .control-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .button-group {
    justify-content: center;
  }

  .search-box {
    min-width: 100%;
  }
  
  .gateway-status-summary {
    flex-direction: column;
    gap: 12px;
  }

  .gateway-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
/* Tenant Row Styles */
.tenant-row {
  display: grid;
  grid-template-columns: 2fr 120px 120px 120px 120px 120px 140px;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background 0.15s;
  background: linear-gradient(to right, #f9fafb 0%, #ffffff 100%);
  font-weight: 500;
}

.tenant-row:hover {
  background: linear-gradient(to right, #f3f4f6 0%, #fafbfc 100%);
}

.tenant-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: #1a1a1a;
  font-size: 15px;
}

.tenant-icon {
  font-size: 16px;
}

.site-count {
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Sub-site Styles (sites under tenants) */
.site-row.sub-site {
  background: #fafbfc;
  padding-left: 40px;
  border-bottom: 1px solid #f3f4f6;
}

.site-row.sub-site:hover {
  background: #f3f4f6;
}

.site-row.sub-site .site-name {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.indent-marker {
  color: #9ca3af;
  margin-right: 8px;
  font-size: 14px;
}

/* Enhanced expand icon for tenants */
.tenant-row .expand-icon {
  color: #6b7280;
  font-size: 12px;
  transition: transform 0.2s;
  font-weight: bold;
}

.tenant-row .expand-icon.expanded {
  transform: rotate(90deg);
}

/* Adjust existing site-row to work with hierarchy */
.site-row {
  display: grid;
  grid-template-columns: 2fr 120px 120px 120px 120px 120px 140px;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.15s;
}

.site-row:hover {
  background: #fafbfc;
}

.site-row:last-child {
  border-bottom: none;
}

.site-name {
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  color: #1a1a1a;
  font-size: 14px;
}

.expand-icon {
  color: #9ca3af;
  font-size: 10px;
  transition: transform 0.2s;
}

.expand-icon.expanded {
  transform: rotate(90deg);
}

/* Enhanced device details for hierarchical view */
.device-details {
  background: #fafbfc;
  padding: 24px;
  display: none;
  border-top: 1px solid #f3f4f6;
  margin-left: 40px;
  margin-right: 10px;
  border-left: 2px solid #e5e7eb;
  border-radius: 0 0 8px 8px;
}

.sub-site .device-details {
  margin-left: 80px;
  background: #f9fafb;
}

.device-details.show {
  display: block;
}

/* logout in dashboard */

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-logout {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: #ef4444;
  border: 1px solid #e5e7eb;
}

.btn-logout:hover {
  background: #fef2f2;
  border-color: #fecaca;
  transform: translateY(-1px);
}

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

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 16px;
  }
  
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
}

/* Login Page

/* Login Page Body - Premium White/Light */
body.login-page {
  background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 50%, #bcccdc 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

body.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
  animation: gradientShift 20s ease infinite;
}

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

/* Login Container */
body.login-page .login-container {
  background: white;
  border-radius: 24px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.12),
    0 0 100px rgba(99, 102, 241, 0.08);
  overflow: hidden;
  max-width: 1100px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 650px;
  position: relative;
  z-index: 1;
  animation: slideUp 0.6s ease-out;
  border: 1px solid rgba(99, 102, 241, 0.1);
}

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

/* Login Left Panel - Premium Light Gradient */
body.login-page .login-left {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  padding: 70px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  position: relative;
  overflow: hidden;
}

body.login-page .login-left::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  animation: loginPulse 8s ease-in-out infinite;
}

body.login-page .login-left::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -20%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  animation: loginPulse 10s ease-in-out infinite reverse;
}

@keyframes loginPulse {
  0%, 100% { 
    transform: scale(1) rotate(0deg);
    opacity: 0.6;
  }
  50% { 
    transform: scale(1.1) rotate(5deg);
    opacity: 1;
  }
}

body.login-page .login-left-content {
  position: relative;
  z-index: 1;
}

body.login-page .logo {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -1px;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.login-page .logo-icon {
  font-size: 42px;
  filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.3));
}

body.login-page .tagline {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 50px;
  line-height: 1.7;
  font-weight: 300;
}

body.login-page .features {
  list-style: none;
}

body.login-page .feature-item {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.95);
  animation: fadeInLeft 0.6s ease-out backwards;
}

body.login-page .feature-item:nth-child(1) { animation-delay: 0.2s; }
body.login-page .feature-item:nth-child(2) { animation-delay: 0.3s; }
body.login-page .feature-item:nth-child(3) { animation-delay: 0.4s; }
body.login-page .feature-item:nth-child(4) { animation-delay: 0.5s; }

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

body.login-page .feature-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

/* Login Right Panel - Pure White */
body.login-page .login-right {
  padding: 70px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: white;
  position: relative;
}

body.login-page .login-header {
  margin-bottom: 48px;
  animation: fadeInLogin 0.6s ease-out 0.3s backwards;
}

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

body.login-page .login-header h1 {
  font-size: 36px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 12px;
  letter-spacing: -1px;
}


/* Form Styles */
body.login-page #loginForm {
  animation: fadeInLogin 0.6s ease-out 0.4s backwards;
}

body.login-page .form-group {
  margin-bottom: 28px;
}

body.login-page .form-label {
  display: block;
  margin-bottom: 10px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.login-page .form-input {
  width: 100%;
  padding: 16px 18px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 15px;
  transition: all 0.3s ease;
  background: #f9fafb;
  color: #1a1a1a;
  font-weight: 500;
}

body.login-page .form-input:focus {
  outline: none;
  border-color: #6366f1;
  background: white;
  box-shadow: 
    0 0 0 4px rgba(99, 102, 241, 0.1),
    0 4px 12px rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
}

body.login-page .form-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

body.login-page .form-input.error {
  border-color: #ef4444;
  background: #fef2f2;
}

body.login-page .form-input.error:focus {
  box-shadow: 
    0 0 0 4px rgba(239, 68, 68, 0.1),
    0 4px 12px rgba(239, 68, 68, 0.15);
}

body.login-page .error-message {
  color: #ef4444;
  font-size: 13px;
  margin-top: 8px;
  display: none;
  font-weight: 500;
}

body.login-page .error-message.show {
  display: block;
  animation: shakeError 0.3s ease;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Remember & Forgot */
body.login-page .remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

body.login-page .remember-forgot .checkbox-wrapper {
  display: flex;
  align-items: center;
  padding-left: 1px;
  gap: 15px;
}

body.login-page .remember-forgot .checkbox-wrapper input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #6366f1;
}

body.login-page .remember-forgot .checkbox-wrapper label {
  font-size: 14px;
  color: #6b7280;
  cursor: pointer;
  font-weight: 500;
}

body.login-page .forgot-link {
  font-size: 14px;
  color: #6366f1;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
}

body.login-page .forgot-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #6366f1;
  transition: width 0.3s ease;
}

body.login-page .forgot-link:hover::after {
  width: 100%;
}

body.login-page .forgot-link:hover {
  color: #4f46e5;
}

/* Login Button - Premium Gradient */
body.login-page .login-button {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
}

body.login-page .login-button::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;
}

body.login-page .login-button:hover::before {
  left: 100%;
}

body.login-page .login-button:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

body.login-page .login-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

body.login-page .login-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

body.login-page .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spinLogin 0.8s linear infinite;
  display: none;
}

body.login-page .login-button.loading .spinner {
  display: block;
}

body.login-page .login-button.loading .button-text {
  display: none;
}

@keyframes spinLogin {
  to { transform: rotate(360deg); }
}

/* Alerts */
body.login-page .alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 28px;
  font-size: 14px;
  font-weight: 500;
  display: none;
  animation: slideDownAlert 0.3s ease;
}

@keyframes slideDownAlert {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.login-page .alert.show {
  display: block;
}

body.login-page .alert-error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border: 1px solid #fca5a5;
}

body.login-page .alert-success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border: 1px solid #6ee7b7;
}

/* Decorative Elements */
body.login-page .login-right::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

body.login-page .login-right::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 968px) {
  body.login-page .login-container {
    grid-template-columns: 1fr;
    max-width: 500px;
  }

  body.login-page .login-left {
    display: none;
  }

  body.login-page .login-right {
    padding: 50px 40px;
  }
}

@media (max-width: 480px) {
  body.login-page .login-right {
    padding: 40px 30px;
  }

  body.login-page .login-header h1 {
    font-size: 28px;
  }

  body.login-page .form-input {
    padding: 14px 16px;
  }

  body.login-page .login-button {
    padding: 14px 20px;
  }
}

/* Focus visible for accessibility */
body.login-page .login-button:focus-visible,
body.login-page .form-input:focus-visible,
body.login-page .forgot-link:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Status bar hidden */
.status-bar {
  display: none;
}

/* Toast Notification Container */
.notification-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

/* Toast Notification Styles */
.toast-notification {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 320px;
  max-width: 420px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.12),
    0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  border-left: 4px solid;
  position: relative;
  overflow: hidden;
}

.toast-notification::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.2;
  animation: toastProgress 3s linear;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

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

/* Toast Types */
.toast-success {
  border-left-color: #10b981;
  color: #065f46;
}

.toast-error {
  border-left-color: #ef4444;
  color: #991b1b;
}

.toast-warning {
  border-left-color: #f59e0b;
  color: #92400e;
}

.toast-info {
  border-left-color: #3b82f6;
  color: #1e40af;
}

/* Toast Icon */
.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: #d1fae5;
  color: #065f46;
}

.toast-error .toast-icon {
  background: #fee2e2;
  color: #991b1b;
}

.toast-warning .toast-icon {
  background: #fef3c7;
  color: #92400e;
}

.toast-info .toast-icon {
  background: #dbeafe;
  color: #1e40af;
}

/* Toast Content */
.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-message {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: #1a1a1a;
}

/* Toast Close Button */
.toast-close {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}

/* Loading State in Table */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 20px;
}

.loading-state .loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f4f6;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-state p {
  color: #6b7280;
  font-size: 15px;
  font-weight: 500;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Simplified Auto-update Badge */
.auto-update-badge {
  background: #10b981;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* Responsive Toast Notifications */
@media (max-width: 768px) {
  .notification-container {
    top: 16px;
    right: 16px;
    left: 16px;
  }

  .toast-notification {
    min-width: auto;
    max-width: none;
  }

  .search-box {
    min-width: 100%;
  }
}

/* Empty State Enhancement */
.empty-state {
  padding: 80px 24px;
  text-align: center;
  color: #9ca3af;
  font-size: 15px;
  font-weight: 500;
}

.empty-state::before {
  content: "ðŸ“Š";
  display: block;
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/*  PROFILE DROPDOWN & SETTINGS MODAL STYLES


/* Profile Dropdown Button */
.profile-dropdown {
  position: relative;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

.profile-button:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.profile-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.dropdown-arrow {
  font-size: 10px;
  color: #9ca3af;
  transition: transform 0.2s ease;
}

.profile-button:hover .dropdown-arrow {
  color: #1a1a1a;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  padding: 16px;
  border-bottom: 1px solid #f3f4f6;
}

.dropdown-user-info strong {
  display: block;
  font-size: 15px;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.dropdown-user-info small {
  display: block;
  font-size: 13px;
  color: #6b7280;
}

.dropdown-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 8px 0;
}

.dropdown-item {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: #f9fafb;
  color: #1a1a1a;
}

.dropdown-item:first-of-type {
  border-radius: 12px 12px 0 0;
}

.dropdown-item.logout-item {
  color: #ef4444;
  border-radius: 0 0 12px 12px;
}

.dropdown-item.logout-item:hover {
  background: #fef2f2;
  color: #dc2626;
}

.dropdown-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}


/* Modal Header */
.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: #9ca3af;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}


/* Profile Info Card */
.profile-info {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  padding: 24px;
  border-radius: 12px;
  color: white;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.profile-details h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-details p {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
}

/* Tabs */
.modal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  border-bottom: 2px solid #f3f4f6;
}

.tab-button {
  padding: 12px 24px;
  background: transparent;
  border: none;
  font-size: 15px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.tab-button:hover {
  color: #1a1a1a;
  background: #f9fafb;
  border-radius: 8px 8px 0 0;
}

.tab-button.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Password Input Wrapper */
.password-input-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 18px;
  padding: 6px;
  transition: all 0.2s ease;
  border-radius: 6px;
  font-weight: 500;
}

.password-toggle:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}

/* Password Requirements */
.password-requirements {
  margin-top: 16px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  font-size: 13px;
}

.password-requirements strong {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: #111827;
  font-weight: 600;
}

.password-requirements ul {
  margin: 0;
  padding-left: 20px;
  list-style: none;
  color: #6b7280;
}

.password-requirements li {
  margin: 6px 0;
  font-size: 13px;
  color: #6b7280;
  position: relative;
  padding-left: 8px;
}

.password-requirements li::before {
  content: "\2022";
  position: absolute;
  left: -12px;
  color: #9ca3af;
}

.password-requirements li.valid {
  color: #059669;
}

.password-requirements li.valid::before {
  content: '\2022';
  color: #059669;
  font-weight: bold;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #f3f4f6;
}

/* User Badge */
.user-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-badge.admin {
  background: #dbeafe;
  color: #1e40af;
}

.user-badge.user {
  background: #f3f4f6;
  color: #374151;
}

.user-badge.locked {
  background: #fee2e2;
  color: #991b1b;
  margin-left: 8px;
}

/* Stats Grid Mini (for users tab) */
.stats-grid-mini {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card-mini {
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.stat-card-mini .label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-card-mini .value {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
}

/* User Item in Users List */
.user-item {
  padding: 16px;
  background: #f9fafb;
  border-radius: 10px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.user-item:hover {
  border-color: #d1d5db;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.user-info-section {
  flex: 1;
}

.user-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.user-main strong {
  font-size: 15px;
  color: #1a1a1a;
}

.user-meta {
  font-size: 13px;
  color: #6b7280;
}

.user-dates {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

.current-user-badge {
  padding: 8px 16px;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

/* Button Spinner */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.btn-primary.loading .btn-spinner {
  display: block;
}

.btn-primary.loading .btn-text {
  display: none;
}

/* Danger Button Small */
.btn-danger-small {
  padding: 8px 16px;
  font-size: 13px;
  color: #ef4444;
  background: white;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-danger-small:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
  .profile-modal {
    width: 100%;
    max-height: 95vh;
  }

  .modal-body {
    padding: 20px;
  }

  .profile-info {
    flex-direction: column;
    text-align: center;
  }

  .modal-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-button {
    white-space: nowrap;
    padding: 10px 16px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions button {
    width: 100%;
  }

  .user-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .btn-danger-small {
    width: 100%;
  }

  .stats-grid-mini {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   ENHANCED PROFILE & USER MANAGEMENT STYLES
   Add these to your styles.css (append to existing)
   ============================================ */

/* Enhanced Form Styles */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
}

.form-input:focus + .form-hint {
  color: #6366f1;
}

/* Password Strength Indicator */
.password-strength {
  margin-top: 8px;
}

.strength-bar {
  height: 4px;
  background: #f3f4f6;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.strength-fill {
  height: 100%;
  transition: all 0.3s ease;
}

.strength-text {
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

/* Create User Container */
.create-user-container {
  margin-bottom: 24px;
}

.btn-create-user {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}

.btn-create-user:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35);
}

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

.btn-icon {
  font-size: 20px;
  line-height: 1;
}

/* Create User Form */
.create-user-form {
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
}

.form-header h4 {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.btn-close-form {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #9ca3af;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-close-form:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}

/* Enhanced Users List */
.users-list {
  display: grid;
  gap: 16px;
}

/* User Card */
.user-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.user-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.user-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.user-card:hover::before {
  opacity: 1;
}

.user-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

.user-card-name {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-card-email {
  font-size: 14px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 16px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-value {
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}

/* Delete User Button */
.btn-delete-user {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  color: #ef4444;
  background: white;
  border: 2px solid #fca5a5;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-delete-user:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #dc2626;
  transform: translateY(-1px);
}

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

/* Current User Badge (full width) */
.current-user-badge {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #6b7280;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  border: 2px solid #d1d5db;
}


/* Enhanced Alert Styles */
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  display: none;
  animation: slideDown 0.3s ease;
  border-left: 4px solid;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert.show {
  display: block;
}

.alert-error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border-left-color: #ef4444;
}

.alert-success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border-left-color: #10b981;
}

.alert-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border-left-color: #f59e0b;
}

/* Enhanced Button Submit */
.btn-submit {
  position: relative;
  overflow: hidden;
}

.btn-submit::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 0.6s, height 0.6s;
}

.btn-submit:active::before {
  width: 300px;
  height: 300px;
}




/* Responsive Design */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .user-card-meta {
    grid-template-columns: 1fr;
  }

  .profile-modal {
    width: 95%;
    max-height: 95vh;
  }

  .modal-body {
    padding: 20px;
  }

  .create-user-form {
    padding: 20px;
  }

  .user-avatar {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .user-card-name {
    font-size: 15px;
  }

  .user-card-email {
    font-size: 13px;
  }
}

/* Loading Animation Enhancement */
@keyframes spin {
  to { 
    transform: rotate(360deg); 
  }
}

.btn-spinner {
  animation: spin 0.8s linear infinite;
}

/* Focus Styles for Accessibility */
.btn-create-user:focus-visible,
.btn-delete-user:focus-visible,
.btn-close-form:focus-visible,
.password-toggle:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Smooth Transitions */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* PROFILE & USER MANAGEMENT */

/* Modal Header */
.modal-header {
  padding: 24px 32px;
  border-bottom: 1px solid #e5e7eb;
  background: #fafbfc;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1;
  padding: 0;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

/* Modal Body */
.modal-body {
  padding: 32px;
  overflow-y: auto;
  max-height: calc(90vh - 160px);
  background: #ffffff;
  width: 70vh;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f9fafb;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Profile Info Card */
.profile-info {
  background: #f9fafb;
  padding: 24px;
  border-radius: 8px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid #e5e7eb;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  flex-shrink: 0;
}

.profile-details h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #111827;
}

.profile-details p {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
}

/* Tabs - Clean Design */
.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border-bottom: 1px solid #e5e7eb;
}

.tab-button {
  padding: 12px 24px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s ease;
}

.tab-button:hover {
  color: #111827;
}

.tab-button.active {
  color: #111827;
  border-bottom-color: #111827;
  font-weight: 600;
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Form Styles - Professional */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
}

.form-label::after {
  content: none;
}

.form-input,
.form-input[type="text"],
.form-input[type="email"],
.form-input[type="password"],
select.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s ease;
  background: #ffffff;
  color: #111827;
}

.form-input:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

.form-input::placeholder {
  color: #9ca3af;
}

.form-input:disabled {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}

/* Form Row for Two Columns */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Form Hint */
.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}


/* Password Strength Meter */
.password-strength {
  margin-top: 10px;
}

.strength-bar {
  height: 3px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.strength-fill {
  height: 100%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-text {
  font-size: 12px;
  font-weight: 500;
  text-align: right;
}


/* Form Actions */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

/* Buttons - Professional Style */
.btn-primary {
  padding: 12px 24px;
  background: #111827;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background: #1f2937;
}

.btn-primary:active {
  background: #374151;
}

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

.btn-secondary {
  padding: 12px 24px;
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* Button Loading State */
.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}

.btn-primary.loading .btn-spinner {
  display: block;
}

.btn-primary.loading .btn-text {
  display: none;
}

/* User Badge - Clean */
.user-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.user-badge.admin {
  background: #dbeafe;
  color: #1e40af;
}

.user-badge.user {
  background: #f3f4f6;
  color: #374151;
}

.user-badge.locked {
  background: #fee2e2;
  color: #991b1b;
  margin-left: 6px;
}

/* USERS TAB 

/* Stats Grid */
.stats-grid-mini {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card-mini {
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.stat-card-mini .label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-card-mini .value {
  font-size: 24px;
  font-weight: 600;
  color: #111827;
}

/* Create User Container */
.create-user-container {
  margin-bottom: 24px;
}

.btn-create-user {
  width: 100%;
  padding: 14px 20px;
  background: #111827;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-create-user:hover {
  background: #1f2937;
}

.btn-icon {
  font-size: 16px;
  line-height: 1;
}

/* Create User Form */
.create-user-form {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.form-header h4 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.btn-close-form {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #6b7280;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s ease;
  line-height: 1;
  padding: 0;
}

.btn-close-form:hover {
  background: #e5e7eb;
  color: #111827;
}

/* Users List */
.users-list {
  display: grid;
  gap: 12px;
}


/* Delete Button */
.btn-delete-user {
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  color: #dc2626;
  background: white;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-delete-user:hover {
  background: #fef2f2;
  border-color: #f87171;
}

/* Current User Badge */
.current-user-badge {
  width: 100%;
  padding: 10px 16px;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  border: 1px solid #e5e7eb;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-body {
    padding: 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .user-card-meta {
    grid-template-columns: 1fr;
  }

  .profile-modal {
    width: 95%;
  }

  .stats-grid-mini {
    grid-template-columns: 1fr;
  }
}

.btn-icon::before {
  content: '+';
  font-weight: 600;
  font-size: 18px;
}

.btn-create-user .btn-icon {
  font-style: normal;
}

/* ============================================
   PROFESSIONAL HEADER STYLES
   ============================================ */

.main-header {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Enhanced Profile Button */
.profile-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 8px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.profile-button:hover {
  background: #fafbfc;
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.profile-avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.profile-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.profile-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.2;
}

.profile-role {
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
}

/* Page Header Section */
.page-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.page-header-content h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

h2.page-title {
  font-size: 28px;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.page-description {
  font-size: 15px;
  color: #6b7280;
  margin: 0;
}

.page-actions {
  display: flex;
  gap: 12px;
}

.btn-icon-action {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon-action:hover {
  background: #fafbfc;
  border-color: #d1d5db;
  color: #1a1a1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

/* Enhanced Stats Cards */
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

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

.stat-icon-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
}

.stat-icon-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.stat-icon-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.stat-icon-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-card .label {
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .value {
  color: #1a1a1a;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.stat-change {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.stat-change-positive {
  color: #059669;
}

.stat-change-negative {
  color: #dc2626;
}

/* Enhanced Control Panel */
.control-panel {
  background: white;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  border: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.control-panel-left {
  flex: 1;
  max-width: 500px;
}

.control-panel-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f9fafb;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.search-box:focus-within {
  background: white;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box svg {
  color: #9ca3af;
  flex-shrink: 0;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  width: 100%;
  color: #1a1a1a;
  font-weight: 500;
}

.search-box input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.view-options {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.view-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.view-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #1a1a1a;
}

.view-btn.active {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: white;
}

/* Enhanced Table Container */
.table-container {
  background: white;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Enhanced Auto-update Badge */
.auto-update-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Responsive Design & Mobile Optimization */

/* Tablet and smaller desktops */
@media (max-width: 1024px) {
  .container {
    padding: 24px;
  }

  .header-container {
    padding: 14px 24px;
  }

  .brand-title {
    font-size: 16px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .page-header {
    flex-direction: column;
    gap: 16px;
  }

  .control-panel {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .control-panel-left {
    max-width: none;
  }

  .control-panel-right {
    justify-content: space-between;
  }

  .table-header, .site-row {
    grid-template-columns: 1.5fr 100px 100px 100px 100px 100px 120px;
    gap: 12px;
  }
}

/* Mobile Devices (Phones) */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
  }

  .header-left h1 {
    font-size: 24px;
  }

  .header-container {
    padding: 12px 20px;
  }

  .brand-info, .profile-user-info {
    display: none;
  }

  .header-actions {
    gap: 12px;
  }

  .auto-update-badge {
    padding: 6px 12px;
  }

  .auto-update-badge span:not(.pulse) {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat-card {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .stat-label {
    margin-bottom: 0;
  }

  .stat-card .value {
    font-size: 28px;
  }

  .control-panel {
    gap: 16px;
  }

  .button-group {
    width: 100%;
    justify-content: space-between;
  }

  .btn {
    flex: 1;
    justify-content: center;
    padding: 12px;
    font-size: 13px;
  }

  .search-box {
    width: 100%;
    min-width: 0;
  }

  .status-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .progress-bar-container {
    width: 100%;
  }

  /* Responsive Table - Synchronized Horizontal Scroll */
  .table-container {
    width: 100%;
    overflow-x: auto; /* This is the ONLY element that should scroll horizontally */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    max-width: calc(100vw - 32px);
  }

  /* Disable any individual scrolling on inner elements to force them to move with the parent */
  .table-content {
    overflow-x: visible !important;
    width: max-content;
    min-width: 100%;
  }

  .table-header, 
  .site-row {
    width: max-content;
    min-width: 100%;
    display: grid;
    grid-template-columns: 200px 100px 100px 100px 100px 100px 140px;
    gap: 0;
  }

  .table-header > div, 
  .site-name, 
  .stat-value {
    padding: 12px 16px;
    font-size: 13px;
    white-space: nowrap;
  }

  .site-row {
    padding: 0;
    border-bottom: 1px solid #f3f4f6;
  }

  .status-badge {
    padding: 4px 8px;
    font-size: 11px;
  }

  .device-details {
    margin-left: 0;
    margin-right: 0;
    padding: 16px;
  }

  .details-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .page-title {
    font-size: 24px;
  }

  .page-description {
    font-size: 14px;
  }
}

/* Small Phones */
@media (max-width: 480px) {
  .container {
    padding: 12px;
  }

  .header-left h1 {
    font-size: 20px;
  }

  .stat-card .value {
    font-size: 24px;
  }

  .btn {
    font-size: 12px;
    padding: 10px 8px;
  }
}

