/* Admin Panel Styles - Modern UI */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --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;
  --sidebar-bg: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --card-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #1e1b4b 0%, #4f46e5 50%, #7c3aed 100%);
}

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--card-shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.login-header {
  background: var(--gray-900);
  color: white;
  padding: 32px;
  text-align: center;
}

.login-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.login-header p { color: var(--gray-400); font-size: 14px; }

.login-form { padding: 32px; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--gray-700);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.error-message {
  background: var(--danger-light);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
  border-left: 4px solid var(--danger);
}

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

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(79,70,229,0.4); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Admin Layout */
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header h2::before {
  content: "";
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
  border-radius: 8px;
}

.sidebar-nav { list-style: none; padding: 16px 12px; flex: 1; }

.sidebar-nav li { margin-bottom: 4px; }

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.2s;
  font-weight: 500;
}

.sidebar-nav li a:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-nav li a.active { background: rgba(255,255,255,0.15); color: white; }

.sidebar-nav li a::before {
  content: "";
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.7;
}

.sidebar-nav li:nth-child(1) a::before { content: "📊"; }
.sidebar-nav li:nth-child(2) a::before { content: "👥"; }
.sidebar-nav li:nth-child(3) a::before { content: "🚪"; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  background: var(--gray-50);
}

.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 28px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.page-header p { color: var(--gray-500); font-size: 15px; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--card-shadow);
  transition: all 0.2s;
}

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

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.users-icon { background: var(--primary-light); }
.users-icon::before { content: "👥"; }
.pending-icon { background: var(--warning-light); }
.pending-icon::before { content: "⏳"; }
.active-icon { background: var(--success-light); }
.active-icon::before { content: "✓"; color: var(--success); font-weight: bold; }
.queries-icon { background: #f3e8ff; }
.queries-icon::before { content: "💬"; }

.stat-content h3 { font-size: 32px; font-weight: 700; color: var(--gray-900); }
.stat-content p { color: var(--gray-500); font-size: 14px; margin-top: 2px; }

/* Cards */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}

.card-header h2 { font-size: 18px; font-weight: 600; color: var(--gray-900); }
.card-body { padding: 24px; }

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

.data-table th,
.data-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
}

.data-table th {
  font-weight: 600;
  color: var(--gray-500);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--gray-50);
}

.data-table tbody tr { transition: background 0.2s; }
.data-table tbody tr:hover { background: var(--gray-50); }

.data-table .loading-row td,
.data-table .empty-state,
.data-table .error-state {
  text-align: center;
  padding: 48px;
  color: var(--gray-400);
}

.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 6px; margin-bottom: 4px; }

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-pending { background: var(--warning-light); color: #b45309; }
.status-pending::before { content: "●"; font-size: 8px; }
.status-approved { background: var(--success-light); color: #047857; }
.status-approved::before { content: "●"; font-size: 8px; }
.status-disabled { background: var(--danger-light); color: #b91c1c; }
.status-disabled::before { content: "●"; font-size: 8px; }

/* Stats Row */
.stats-row { display: flex; gap: 48px; flex-wrap: wrap; }

.stat-item { display: flex; flex-direction: column; gap: 4px; }
.stat-item .stat-label { color: var(--gray-500); font-size: 14px; }
.stat-item .stat-value { font-size: 28px; font-weight: 700; color: var(--gray-900); }

/* Filters */
.filters-card { padding: 20px 24px; }

.filters-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group { display: flex; flex-direction: column; gap: 6px; }

.filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}

.filter-group select,
.filter-group input {
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 14px;
  min-width: 160px;
  transition: all 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.page-btn {
  padding: 10px 16px;
  border: 2px solid var(--gray-200);
  background: white;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

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

.modal-header h2 { font-size: 20px; font-weight: 700; }

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border: none;
  border-radius: 10px;
  font-size: 20px;
  cursor: pointer;
  color: var(--gray-500);
  transition: all 0.2s;
}

.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* User Details */
.user-details .detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}

.user-details .detail-row:last-child { border-bottom: none; }
.user-details .detail-label { color: var(--gray-500); font-size: 14px; }
.user-details .detail-value { font-weight: 600; color: var(--gray-900); }

.user-details h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-700);
  padding-bottom: 12px;
  margin-top: 16px;
  border-bottom: 2px solid var(--gray-100);
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  background: var(--gray-900);
  color: white;
  border-radius: 12px;
  font-weight: 500;
  box-shadow: var(--card-shadow-lg);
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

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

/* Responsive */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { width: 70px; }
  .sidebar-header h2 span, .sidebar-nav li a span, .sidebar-footer { display: none; }
  .sidebar-header h2::before { margin: 0 auto; }
  .sidebar-nav li a { justify-content: center; padding: 14px; }
  .sidebar-nav li a::before { margin: 0; }
  .main-content { margin-left: 70px; padding: 20px; }
  .stats-grid { grid-template-columns: 1fr; }
  .filters-row { flex-direction: column; }
  .filter-group, .filter-group select, .filter-group input { width: 100%; }
}
