/* =============================================
   Twende Admin Dashboard - Main Stylesheet
   ============================================= */

:root {
  --primary:       #FF6B00;
  --primary-dark:  #CC5500;
  --primary-light: #FF8C33;
  --sidebar-bg:    #1A1A2E;
  --sidebar-hover: #16213E;
  --sidebar-active:#0F3460;
  --bg:            #F5F6FA;
  --surface:       #FFFFFF;
  --border:        #E2E8F0;
  --text-primary:  #1A202C;
  --text-secondary:#718096;
  --text-muted:    #A0AEC0;
  --success:       #38A169;
  --warning:       #D69E2E;
  --danger:        #E53E3E;
  --info:          #3182CE;
  --purple:        #805AD5;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 24px rgba(0,0,0,0.12);
  --transition:    0.2s ease;
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

/* ── Reset ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }
ul { list-style: none; }

/* ── Scrollbar ────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =============================================
   Login Screen
   ============================================= */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1A1A2E 0%, #0F3460 60%, #16213E 100%);
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(255,107,0,0.3);
}

.login-logo h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,0,0.12);
  background: var(--surface);
}

.form-control::placeholder { color: var(--text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  outline: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(255,107,0,0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(255,107,0,0.4);
  transform: translateY(-1px);
}

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

.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: #2F855A; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #C53030; }

.btn-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border: 2px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

.login-error {
  background: #FFF5F5;
  border: 1px solid #FED7D7;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  display: none;
}

.login-error.show { display: block; }

/* =============================================
   App Layout
   ============================================= */
#app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition), width var(--transition);
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255,107,0,0.3);
}

.sidebar-brand {
  color: white;
}

.sidebar-brand h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-brand span {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.3);
  padding: 16px 20px 8px;
}

.nav-item,
a.nav-item:link,
a.nav-item:visited {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 0;
  margin: 2px 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.nav-item:hover,
a.nav-item:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(255,107,0,0.25);
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-item .nav-label { flex: 1; }

.nav-item .nav-badge {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.nav-item.active .nav-badge { background: rgba(255,255,255,0.3); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name {
  color: white;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
}

/* ── Main Area ────────────────────────────── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Top Bar ──────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 20px;
  transition: background var(--transition);
}

.topbar-menu-btn:hover { background: var(--bg); }

.topbar-title {
  flex: 1;
}

.topbar-title h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-title p {
  font-size: 12px;
  color: var(--text-secondary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-admin {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-admin-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}

.topbar-admin-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-admin-role {
  font-size: 11px;
  color: var(--text-secondary);
}

.btn-logout {
  background: none;
  border: 2px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #FFF5F5;
}

/* ── Page Content ─────────────────────────── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px;
}

/* =============================================
   Stat Cards
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
}

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

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

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

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-title {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* =============================================
   Cards / Panels
   ============================================= */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-body { padding: 24px; }

/* =============================================
   Tables
   ============================================= */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:nth-child(even) { background: rgba(0,0,0,0.012); }

tbody tr:hover { background: rgba(255,107,0,0.04) !important; cursor: pointer; }

tbody td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-primary);
  vertical-align: middle;
}

.cell-muted { color: var(--text-secondary); font-size: 12px; }

.cell-id {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}

/* =============================================
   Badges
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.badge-success { background: #F0FFF4; color: #276749; }
.badge-danger  { background: #FFF5F5; color: #9B2C2C; }
.badge-warning { background: #FFFAF0; color: #7B4B0B; }
.badge-info    { background: #EBF8FF; color: #1A4971; }
.badge-purple  { background: #FAF5FF; color: #44337A; }
.badge-gray    { background: #F7FAFC; color: #4A5568; }
.badge-orange  { background: #FFFAF0; color: #7B341E; }

/* =============================================
   Search & Filters
   ============================================= */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-input .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}

.search-input input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
}

.search-input input:focus { border-color: var(--primary); }

.filter-select {
  padding: 9px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.filter-select:focus { border-color: var(--primary); }

.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.filter-tab:hover:not(.active) { color: var(--text-primary); }

/* =============================================
   Pagination
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.pagination-controls {
  display: flex;
  gap: 4px;
  align-items: center;
}

.page-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255,107,0,0.05);
}

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

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

/* Google Places Autocomplete dropdown — must sit above modals
   (modal-overlay is z-index: 1000, pac-container default is also 1000
   so the modal wins on DOM order; bump pac-container well above). */
.pac-container {
  z-index: 100000 !important;
}

/* =============================================
   Modal
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  /* Opaque backdrop so the view behind doesn't bleed through —
     the modal feels like a dedicated page rather than a popup. */
  background: var(--bg, #F1F5F9);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 20px;
  overflow-y: auto;
  animation: fadeIn 0.15s ease;
}

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

.modal-box,
.modal {
  background: var(--surface, #FFFFFF);
  border-radius: var(--radius, 12px);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  animation: slideUp 0.2s ease;
}

.modal-box.modal-sm { max-width: 420px; }
.modal-box.modal-lg { max-width: 800px; }

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--border); color: var(--text-primary); }

.modal-body { padding: 24px; }

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

/* Detail Grid inside Modal */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-item label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.detail-item p {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* =============================================
   Toast Notifications
   ============================================= */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  min-width: 260px;
  pointer-events: all;
  border-left: 4px solid var(--text-muted);
  animation: slideInRight 0.25s ease;
  transition: opacity 0.25s, transform 0.25s;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.toast.hiding { opacity: 0; transform: translateX(100%); }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-message { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }
.toast-close { background: none; border: none; font-size: 16px; color: var(--text-muted); cursor: pointer; padding: 0; }
.toast-close:hover { color: var(--text-primary); }

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info    { border-left-color: var(--info); }

/* =============================================
   Loading Spinner
   ============================================= */
.spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
  display: inline-block;
}

/* =============================================
   Skeleton Loading
   ============================================= */
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.sk {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}

/* =============================================
   Empty State
   ============================================= */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p { font-size: 13px; }

/* =============================================
   Form Elements in Modals
   ============================================= */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group-modal {
  margin-bottom: 16px;
}

.form-group-modal label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group-modal .form-control { background: var(--surface); }

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* =============================================
   Charts Placeholder
   ============================================= */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.chart-placeholder {
  height: 220px;
  background: linear-gradient(135deg, var(--bg) 0%, rgba(255,107,0,0.04) 100%);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  border: 2px dashed var(--border);
}

.chart-placeholder .chart-icon { font-size: 36px; }
.chart-placeholder p { font-size: 13px; font-weight: 500; }
.chart-placeholder span { font-size: 11px; }

/* =============================================
   Driver Highlight (pending)
   ============================================= */
tbody tr.row-highlight {
  background: rgba(255,107,0,0.04) !important;
}

/* =============================================
   Overlay for mobile sidebar
   ============================================= */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.2);
  }

  .sidebar-overlay { display: block; }

  .topbar-menu-btn { display: flex; }

  .main-area { width: 100%; }

  .page-content { padding: 20px 16px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .charts-grid { grid-template-columns: 1fr; }

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

  .detail-grid { grid-template-columns: 1fr; }

  .card-header { padding: 16px; }
  .card-body { padding: 0; }

  .filter-bar { gap: 8px; }
  .search-input { max-width: 100%; }

  .topbar { padding: 0 16px; }
  .topbar-admin-name, .topbar-admin-role { display: none; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 22px; }
  .modal-box { margin: 0; }
  .pagination { flex-direction: column; align-items: flex-start; }
  .login-card { padding: 32px 24px; }
}

/* =============================================
   Utility
   ============================================= */
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono { font-family: 'Courier New', monospace; }
.text-muted { color: var(--text-secondary); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.gap-8 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; display: inline-block; }

/* Highlight rows that are pending action */
.pending-row { border-left: 3px solid var(--warning) !important; }

/* Online indicator dot */
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(56,161,105,0.25);
  animation: pulse 2s infinite;
}

.offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(56,161,105,0.25); }
  50% { box-shadow: 0 0 0 5px rgba(56,161,105,0.1); }
}

/* Section heading inside page */
.section-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

/* =============================================
   Document Gallery
   ============================================= */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.doc-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  background: #f9f9f9;
}

.doc-card .doc-label {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  background: #f0f0f0;
  border-bottom: 1px solid #e0e0e0;
  color: var(--text-primary);
}

.doc-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  cursor: pointer;
  display: block;
  transition: opacity var(--transition);
}

.doc-card img:hover { opacity: 0.88; }

.doc-card .no-doc {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 13px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: pointer;
  animation: fadeIn 0.15s ease;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

@media (max-width: 600px) {
  .doc-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Reject reason input */
.reject-input {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  border: 2px solid var(--danger);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  color: var(--text-primary);
}

/* Action buttons in table cells */
.action-btns {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

/* Mini stat card for payment/referral stats */
.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.mini-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow);
}

.mini-stat .value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.mini-stat .label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* =============================================
   Support Page - Ticket Detail
   ============================================= */
.ticket-description {
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.ticket-response {
  background: #EBF8FF;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid #BEE3F8;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ── Toggle Switch ────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 30px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #CBD5E0;
  border-radius: 30px;
  transition: background-color 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #38A169;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(26px);
}

/* ── Live Indicator ──────────────────────── */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 16px;
  transition: all 0.3s ease;
}

.live-indicator.connected {
  background: rgba(56, 161, 105, 0.12);
  color: var(--success);
}

.live-indicator.disconnected {
  background: rgba(229, 62, 62, 0.12);
  color: var(--danger);
}

.live-indicator.reconnecting {
  background: rgba(214, 158, 46, 0.12);
  color: var(--warning);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
}

.live-indicator.connected .live-dot {
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56, 161, 105, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(56, 161, 105, 0); }
}

/* ── Real-time stat flash ────────────────── */
.stat-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card.flash {
  animation: stat-flash 0.8s ease;
}

@keyframes stat-flash {
  0% { transform: scale(1); box-shadow: var(--shadow); }
  25% { transform: scale(1.03); box-shadow: 0 0 20px rgba(255, 107, 0, 0.3); }
  100% { transform: scale(1); box-shadow: var(--shadow); }
}

/* ── Activity feed item animation ────────── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  animation: slide-in 0.3s ease;
}

.activity-item.new {
  background: rgba(255, 107, 0, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 4px;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Notification badge ──────────────────── */
.nav-item .nav-badge {
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0 5px;
  animation: badge-pop 0.3s ease;
}

@keyframes badge-pop {
  from { transform: scale(0); }
  50%  { transform: scale(1.2); }
  to   { transform: scale(1); }
}

/* =============================================
   Service Area Map
   ============================================= */
#service-area-map {
  width: 100%;
  height: 500px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 2px solid var(--border);
}

#live-monitor-map {
  width: 100%;
  height: 500px;
  border-radius: 12px;
  border: 2px solid var(--border);
}

/* ── Toggle Switch ───────────────────────────────── */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .3s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}
input:checked + .slider { background-color: #4CAF50; }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round { border-radius: 26px; }
.slider.round:before { border-radius: 50%; }

/* Analytics chart grid responsive */
@media (max-width: 768px) {
  .chart-grid { grid-template-columns: 1fr !important; }
}
