/* Modern Admin Dashboard Styles */
:root {
  /* Use global theme variables instead of hardcoded admin-specific ones */
  --admin-primary: var(--color-primary);
  --admin-primary-dark: var(--color-primary-dark);
  --admin-success: var(--color-success);
  --admin-warning: var(--color-warning);
  --admin-danger: var(--color-danger);
  --admin-info: var(--color-info);
  --admin-secondary: var(--color-text-secondary);
  --admin-light: var(--color-bg-secondary);
  --admin-dark: var(--color-text-primary);
  --admin-border: var(--color-border-light);
  --admin-shadow: var(--shadow-md);
  --admin-shadow-lg: var(--shadow-lg);
  --admin-radius: var(--border-radius-lg);
  --admin-radius-lg: var(--border-radius-xl);
}

/* Dark theme overrides for admin dashboard */
[data-theme='dark'] {
  /* Admin colors adjusted for dark theme */
  --admin-light: var(--color-bg-secondary);
  --admin-dark: var(--color-text-primary);
  --admin-border: var(--color-border-light);
  --admin-secondary: var(--color-text-secondary);
}

/* Main Dashboard Container */
.admin-dashboard-modern {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
  background: var(--color-bg-primary);
}

/* Dashboard Header */
.dashboard-header-modern {
  background: var(--color-bg-primary);
  border-radius: var(--admin-radius-lg);
  box-shadow: var(--admin-shadow);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--admin-border);
}

.header-content {
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.header-title h1 {
  margin: 0 0 8px 0;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--admin-dark);
  background: linear-gradient(135deg, var(--admin-primary), var(--admin-info));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-title p {
  margin: 0 0 4px 0;
  color: var(--admin-secondary);
  font-size: 1.1rem;
}

.last-refresh {
  color: var(--admin-secondary);
  font-size: 0.875rem;
  opacity: 0.8;
}

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

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--admin-primary);
  color: white;
  border: none;
  border-radius: var(--admin-radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-btn:hover:not(:disabled) {
  background: var(--admin-primary-dark);
  transform: translateY(-1px);
}

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

.refresh-icon {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.refresh-icon.spinning {
  animation: spin 1s linear infinite;
}

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

.view-tabs {
  display: flex;
  background: var(--admin-light);
  border-radius: var(--admin-radius);
  padding: 4px;
  border: 1px solid var(--admin-border);
}

.tab-btn {
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--color-bg-primary);
  color: var(--admin-primary);
  box-shadow: var(--admin-shadow);
}

.tab-btn:not(.active):hover {
  background: rgba(59, 130, 246, 0.1);
}

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

.stat-card-modern {
  background: var(--color-bg-primary);
  border-radius: var(--admin-radius-lg);
  padding: 24px;
  box-shadow: var(--admin-shadow);
  border: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

.stat-card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-color, var(--admin-primary));
}

.stat-card-modern.primary {
  --card-color: var(--admin-primary);
}
.stat-card-modern.success {
  --card-color: var(--admin-success);
}
.stat-card-modern.warning {
  --card-color: var(--admin-warning);
}
.stat-card-modern.info {
  --card-color: var(--admin-info);
}
.stat-card-modern.secondary {
  --card-color: var(--admin-secondary);
}

.stat-card-modern .stat-icon {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--card-color), rgba(0, 0, 0, 0.1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--admin-dark);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 1rem;
  color: var(--admin-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-change {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
}

.stat-change.positive {
  background: rgba(16, 185, 129, 0.1);
  color: var(--admin-success);
}

.stat-change.neutral {
  background: rgba(107, 114, 128, 0.1);
  color: var(--admin-secondary);
}

.stat-change.attention {
  background: rgba(245, 158, 11, 0.1);
  color: var(--admin-warning);
}

.stat-trend {
  font-size: 1.5rem;
  opacity: 0.7;
}

/* Dashboard Content */
.dashboard-content-modern {
  display: grid;
  gap: 24px;
}

/* Charts Section */
.charts-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--color-bg-primary);
  border-radius: var(--admin-radius-lg);
  padding: 24px;
  box-shadow: var(--admin-shadow);
  border: 1px solid var(--admin-border);
}

.chart-header {
  margin-bottom: 20px;
}

.chart-header h3 {
  margin: 0 0 4px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--admin-dark);
}

.chart-header p {
  margin: 0;
  color: var(--admin-secondary);
  font-size: 0.875rem;
}

.chart-container {
  height: 300px;
  position: relative;
}

.chart-container.doughnut {
  height: 250px;
}

/* Analytics Summary Styles */
.activity-summary {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-total {
  font-weight: 600;
  color: var(--admin-primary);
  font-size: 0.9rem;
}

.activity-period {
  font-size: 0.8rem;
  color: var(--admin-secondary);
  opacity: 0.8;
}

/* Overview Section */
.overview-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* Dashboard Cards */
.dashboard-card-modern {
  background: var(--color-bg-primary);
  border-radius: var(--admin-radius-lg);
  padding: 24px;
  box-shadow: var(--admin-shadow);
  border: 1px solid var(--admin-border);
  transition: all 0.2s ease;
}

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

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

.card-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--admin-dark);
}

/* Health Card */
.health-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.health-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.health-metric {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--admin-light);
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
}

.metric-icon {
  font-size: 1.5rem;
  opacity: 0.8;
}

.metric-content {
  flex: 1;
}

.metric-label {
  font-size: 0.875rem;
  color: var(--admin-secondary);
  margin-bottom: 2px;
}

.metric-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--admin-dark);
}

/* Activity Card */
.activity-filter select {
  padding: 8px 12px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-size: 0.875rem;
}

.activity-feed {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item-modern {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--admin-border);
  transition: all 0.2s ease;
}

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

.activity-item-modern:hover {
  background: var(--color-bg-secondary);
  margin: 0 -12px;
  padding: 16px 12px;
  border-radius: var(--admin-radius);
}

.activity-icon-modern {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.activity-content-modern {
  flex: 1;
}

.activity-description {
  font-size: 0.95rem;
  color: var(--admin-dark);
  margin-bottom: 4px;
  line-height: 1.4;
}

.activity-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--admin-secondary);
}

.activity-type {
  background: var(--color-bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.activity-status {
  flex-shrink: 0;
}

.admin-dashboard-modern .status-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.status-badge.success {
  background: var(--admin-success);
  color: white;
}

.status-badge.danger {
  background-color: #fee2e2;
  color: #dc2626;
}

.status-badge.info {
  background-color: #dbeafe;
  color: #2563eb;
}

.status-badge.secondary {
  background-color: #f3f4f6;
  color: #6b7280;
}

.no-activity-modern {
  text-align: center;
  padding: 40px 20px;
  color: var(--admin-secondary);
}

.no-activity-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* Quick Actions */
.quick-actions-modern {
  background: var(--color-bg-primary);
  border-radius: var(--admin-radius-lg);
  padding: 24px;
  box-shadow: var(--admin-shadow);
  border: 1px solid var(--admin-border);
}

.quick-actions-modern h3 {
  margin: 0 0 20px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--admin-dark);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.action-btn-modern {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--color-bg-primary);
  border: 2px solid var(--admin-border);
  border-radius: var(--admin-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  width: 100%;
}

.action-btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--admin-shadow-lg);
  border-color: var(--btn-color, var(--admin-primary));
}

.action-btn-modern.primary {
  --btn-color: var(--admin-primary);
}
.action-btn-modern.success {
  --btn-color: var(--admin-success);
}
.action-btn-modern.warning {
  --btn-color: var(--admin-warning);
}
.action-btn-modern.info {
  --btn-color: var(--admin-info);
}
.action-btn-modern.secondary {
  --btn-color: var(--admin-secondary);
}
.action-btn-modern.tertiary {
  --btn-color: #8b5cf6;
}

.action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--admin-radius);
  background: linear-gradient(135deg, var(--btn-color), rgba(0, 0, 0, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.action-content {
  flex: 1;
}

.action-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--admin-dark);
  margin-bottom: 4px;
}

.action-desc {
  font-size: 0.875rem;
  color: var(--admin-secondary);
  line-height: 1.4;
}

/* Loading & Error States */
.admin-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
}

.admin-loading p {
  color: var(--admin-secondary);
  font-size: 1.1rem;
}

.admin-error {
  background: var(--color-bg-primary);
  border-radius: var(--admin-radius-lg);
  padding: 40px;
  text-align: center;
  box-shadow: var(--admin-shadow);
  border: 1px solid var(--admin-border);
  max-width: 500px;
  margin: 40px auto;
}

.error-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.7;
}

.admin-error h2 {
  color: var(--admin-danger);
  margin-bottom: 12px;
}

.admin-error p {
  color: var(--admin-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.retry-btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--admin-radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.retry-btn.secondary {
  background: var(--color-bg-secondary);
  color: var(--admin-secondary);
  border: 1px solid var(--admin-border);
}

.retry-btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

/* Admin Page Loading - Centered within admin content area */
.admin-page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px); /* Account for header and padding */
  width: 100%;
}

/* Responsive Design - Sidebar-aware breakpoints */
/* Large desktop screens - sidebar + content fits comfortably */

/* Medium desktop - account for sidebar width */

/* Small desktop/large tablet - sidebar significantly reduces available width */

/* Small tablets and large mobile screens */

/* Mobile phone screens */

/* Very small mobile screens */

/* Fix for webkit background clip */
.header-title h1 {
  background-clip: text;
  -webkit-background-clip: text;
}

.stat-card-modern .stat-icon {
  background-clip: text;
  -webkit-background-clip: text;
}

.action-icon {
  font-size: 1.1rem;
}

/* Error State */
.admin-error {
  text-align: center;
  padding: 60px 20px;
}

.admin-error h2 {
  margin: 0 0 10px 0;
  color: var(--color-danger);
}

.admin-error p {
  margin: 0 0 20px 0;
  color: var(--color-text-secondary);
}

.retry-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.retry-btn:hover {
  background: var(--color-primary-dark);
}

/* Responsive Design */


/* Activity action type styling */
.activity-action {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  margin-left: 8px;
}

.activity-action.created {
  background-color: var(--color-success-light);
  color: var(--color-success);
}

.activity-action.updated {
  background-color: var(--color-info-light);
  color: var(--color-info);
}

.activity-action.deleted {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
}

.activity-action.viewed {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

/* Dark theme activity action overrides */
[data-theme='dark'] .activity-action.created {
  background-color: var(--color-success-light);
  color: var(--color-success-dark);
}

[data-theme='dark'] .activity-action.updated {
  background-color: var(--color-info-light);
  color: var(--color-info-dark);
}

[data-theme='dark'] .activity-action.deleted {
  background-color: var(--color-danger-light);
  color: var(--color-danger-dark);
}

[data-theme='dark'] .activity-action.viewed {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-muted);
}

/* Enhance activity items for deleted items */
.activity-item-modern.deleted {
  border-left: 3px solid var(--color-danger);
  background-color: var(--color-danger-light);
}

/* Dark theme deleted activity items */
[data-theme='dark'] .activity-item-modern.deleted {
  border-left: 3px solid var(--color-danger);
  background-color: var(--color-danger-light);
}

/* Mantine component hover effects */
.action-button-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
