.admin-dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Dashboard Header */
.dashboard-header {
  margin-bottom: 2rem;
  position: relative;
}

.dashboard-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--theme-dark-gray);
  margin-bottom: 0.5rem;
}

.dashboard-header p {
  font-size: 1rem;
  color: var(--theme-text-muted);
}

/* Alert Styles */
.alert-shop {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: none;
  display: flex;
  align-items: center;
}

.alert-shop i {
  font-size: 1.25rem;
  margin-right: 0.75rem;
}

.alert-shop-success {
  background-color: rgba(25, 135, 84, 0.1);
  color: #155724;
}

.alert-shop-error {
  background-color: rgba(220, 53, 69, 0.1);
  color: #721c24;
}

/* Stats Section */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* Ensure stat cards are uniform in size */
.stat-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  min-height: 100px;
  /* Ensure consistent height */
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

.stat-card>i.fas {
  font-size: 1.75rem;
  color: var(--theme-dark-yellow, #FFC107);
  background-color: rgba(255, 193, 7, 0.15);
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card .stat-content {
  flex-grow: 1;
}

.stat-card .stat-content h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--theme-text-muted, #6c757d);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-content p {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--theme-dark-gray, #343a40);
  margin-bottom: 0;
}

/* Analytics Section */
.analytics-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 1rem;
}

.chart-card {
  background-color: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 1.75rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.05);
  min-height: 400px;
  /* Ensure consistent chart card height */
}

.chart-card h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--theme-dark-gray, #343a40);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--theme-light-gray, #f8f9fa);
}

.chart-card canvas {
  max-height: 350px;
  width: 100% !important;
  flex-grow: 1;
}

.chart-card p {
  color: var(--theme-text-muted, #6c757d);
  text-align: center;
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
}

.chart-card p i {
  margin-bottom: 1rem;
  opacity: 0.6;
}

/* Chart.js Enhancements */
#orderTrendsChart,
#revenueByStatusChart,
#riderActivityChart,
#topProductsChart {
  margin-top: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
  .analytics-section {
    grid-template-columns: 1fr;
    /* Stack charts on smaller screens */
  }

  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
    /* Two stat cards per row */
  }
}

@media (max-width: 768px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
    /* One stat card per row */
  }

  .stat-card {
    padding: 1.25rem;
  }

  .stat-card>i.fas {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .stat-card .stat-content p {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .admin-dashboard-container {
    padding: 1.5rem 1rem;
  }

  .dashboard-header h1 {
    font-size: 1.5rem;
  }

  .stat-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1rem;
  }

  .stat-card>i.fas {
    margin-bottom: 0.75rem;
  }
}

/* Card styling for the main content block housing the table */
.riders-page-card {
  /* Specific class for the card on this page if needed */
  background-color: var(--theme-white);
  border: 1px solid var(--theme-medium-gray);
  border-radius: 8px;
  /* Consistent with other cards */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  margin-top: 1rem;
  /* If .page-header-actions is separate */
}

.riders-page-card .card-header {
  background-color: var(--theme-light-gray);
  /* Light header for the card */
  border-bottom: 1px solid var(--theme-medium-gray);
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.riders-page-card .card-header .card-title-secondary {
  /* For "Current Riders" text */
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--theme-dark-gray);
  margin-bottom: 0;
}

.riders-page-card .card-header .card-title-secondary i {
  color: var(--theme-dark-yellow);
  /* Themed icon */
  margin-right: 0.5rem;
}

.riders-page-card .card-header #rider-search {
  /* Search input in card header */
  max-width: 280px;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  /* Uses global form-control styles, which should be themed */
}

.riders-page-card .card-body {
  padding: 0;
  /* Remove padding if table is directly inside */
}

.riders-page-card .table th {
  font-size: 0.8rem !important;
  /* Consistent with other admin tables */
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: var(--theme-light-gray) !important;
}

.riders-page-card .table td {
  font-size: 0.9rem !important;
}

/* Status Badges in Table */
/* The PHP uses Bootstrap's bg-* classes. We can theme these. */
.table .badge.bg-success {
  background-color: var(--status-delivered-bg, #D4EDDA) !important;
  /* Using one of the theme's success-like colors */
  color: var(--status-delivered-text, #155724) !important;
}

.table .badge.bg-secondary {
  background-color: var(--status-cancelled-bg, #E2E3E5) !important;
  /* Using a muted/cancelled color */
  color: var(--status-cancelled-text, #41464b) !important;
}

.table .badge.bg-danger {
  background-color: var(--status-error-bg, #F8D7DA) !important;
  /* Consistent error/danger */
  color: var(--status-error-text, #721C24) !important;
}

.table .badge.bg-warning.text-dark {
  /* For pending_approval */
  background-color: var(--status-pending-bg, #FFF3CD) !important;
  color: var(--status-pending-text, #664d03) !important;
}

.table .badge.bg-info {
  /* Fallback */
  background-color: var(--status-processing-bg, #D1ECF1) !important;
  color: var(--status-processing-text, #0c5460) !important;
}

/* Ensure these vars are defined in :root or use direct hex codes if not */
/* Or, modify PHP to use .status-badge .status-active, .status-inactive etc. and style those */


/* Action Buttons in Table */
.riders-page-card .table .btn-group-sm>.btn {
  /* Targetting buttons within small group */
  font-size: 0.75rem !important;
  padding: 0.25rem 0.5rem !important;
}

/* Theming for specific outline buttons if needed (primary and danger are usually fine) */
.riders-page-card .table .btn-outline-info {
  /* View button */
  --bs-btn-color: var(--theme-dark-yellow);
  --bs-btn-border-color: var(--theme-dark-yellow);
  --bs-btn-hover-color: var(--theme-white);
  /* Or dark text */
  --bs-btn-hover-bg: var(--theme-dark-yellow);
  --bs-btn-hover-border-color: var(--theme-dark-yellow);
  /* ... other states for consistency ... */
}


/* Modal Styling (General - should apply to Add, Edit, View, Delete modals) */
/* Modal styles are mostly inherited from global modal styles in theme.css.
   Only add overrides or specific styles here if needed. */

#addRiderModal .modal-title i,
#editRiderModal .modal-title i,
#viewRiderModal .modal-title i,
#deleteRiderModal .modal-title i {
  color: var(--theme-dark-yellow);
  /* Themed icons in modal titles */
}

/* View Rider Modal Specifics */
#viewRiderModal .modal-body strong {
  color: var(--theme-dark-gray);
  font-weight: 500;
}

#viewRiderModal .modal-body span:not(.badge) {
  /* For the actual data values */
  color: var(--theme-text-muted);
}

#viewRiderModal #view_status_badge .badge {
  /* Ensure badge in view modal is styled */
  font-size: 0.9rem;
  /* Slightly larger for better readability in modal */
}


/* Add/Edit Rider Modal Forms */
/* These will use the globally themed .form-control, .form-select, .form-label from theme.css */
/* If specific layout adjustments needed for the .row.g-3 inside modals: */

/* Make sure required asterisks are visible */
.modal-body .form-label .text-danger {
  font-weight: bold;
}


/* Delete Rider Modal (Header is already bg-danger via Bootstrap class in PHP) */
#deleteRiderModal .modal-body p strong {
  color: var(--theme-dark-gray);
}

#deleteRiderModal .modal-body .text-danger {
  /* "This action cannot be undone" */
  font-weight: 500;
}

/* These should already be in your theme.css from riders.php refactor */
.table .badge.text-bg-warning {
  /* Pending */
  background-color: var(--status-pending-bg, #FFF3CD) !important;
  color: var(--status-pending-text, #664d03) !important;
}

.table .badge.text-bg-info {
  /* Assigned */
  background-color: var(--status-processing-bg, #D1ECF1) !important;
  /* Using 'processing' theme colors */
  color: var(--status-processing-text, #0c5460) !important;
}

.table .badge.text-bg-primary {
  /* Shipped - you might want a specific theme color */
  background-color: var(--theme-dark-yellow) !important;
  /* Example: using primary theme color */
  color: var(--theme-dark-gray) !important;
}

.table .badge.text-bg-success {
  /* Delivered */
  background-color: var(--status-delivered-bg, #D4EDDA) !important;
  color: var(--status-delivered-text, #155724) !important;
}

.table .badge.text-bg-danger {
  /* Cancelled */
  background-color: var(--status-error-bg, #F8D7DA) !important;
  color: var(--status-error-text, #721C24) !important;
}

.table .badge.text-bg-secondary {
  /* Default/Other */
  background-color: var(--status-cancelled-bg, #E2E3E5) !important;
  /* A general muted color */
  color: var(--status-cancelled-text, #41464b) !important;
}