/*--------------------------------------------------------------------------
 * GM Carworks — Modern SaaS Admin Dashboard Design System
 * Inspired by reference design: Dark Navy Sidebar + Coral Red Primary Accent
 *--------------------------------------------------------------------------*/

:root {
  --sidebar-bg: #0f172a;
  --sidebar-hover: rgba(225, 29, 72, 0.08);
  --sidebar-active-gradient: linear-gradient(135deg, #e11d48 0%, #a21caf 100%);
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-category: #64748b;

  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #f1f5f9;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --card-shadow-hover: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
  --card-radius: 16px;

  --logo-crimson: #e11d48;
  --logo-magenta: #a21caf;
  --primary-accent: #e11d48;
  --primary-blue: #2563eb;
  --primary-green: #10b981;
  --primary-purple: #a21caf;
  --primary-amber: #f59e0b;

  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Brand Text Gradient Utility */
.text-brand-gradient {
  background: linear-gradient(135deg, #e11d48 0%, #a21caf 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Animated UI Components & Micro-Interactions */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlowRed {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(225, 29, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

.animate-slide-up {
  animation: slideUpFade 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-delay-1 { animation-delay: 0.08s; }
.animate-delay-2 { animation-delay: 0.16s; }
.animate-delay-3 { animation-delay: 0.24s; }

.hover-lift-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.hover-lift-card:hover {
  transform: translateY(-4px) scale(1.005) !important;
  box-shadow: 0 16px 36px -8px rgba(225, 29, 72, 0.15), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

.animated-preset-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: 30px;
  padding: 8px 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.animated-preset-btn:hover {
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.08) 0%, rgba(162, 28, 175, 0.08) 100%);
  border-color: #e11d48;
  color: #be123c;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.18);
}

/* Global Canvas Styling */
body.hold-transition {
  background-color: var(--body-bg) !important;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  color: #1e293b;
}

.content-wrapper {
  background-color: var(--body-bg) !important;
  padding: 1.5rem !important;
}

/* Dark Navy Sidebar Overrides */
html body .main-sidebar {
  background-color: var(--sidebar-bg) !important;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12) !important;
}

html body .main-sidebar .brand-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 1.15rem 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
}

html body .main-sidebar .brand-text {
  font-weight: 800 !important;
  font-size: 1.2rem !important;
  letter-spacing: -0.02em !important;
  color: #ffffff !important;
}

/* Sidebar Section Headers */
.sidebar-category-header {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--sidebar-category);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1.1rem 1rem 0.35rem 1rem;
  margin: 0;
}

html body .nav-sidebar .nav-item {
  margin: 0.2rem 0.65rem !important;
}

html body .nav-sidebar .nav-link {
  border-radius: 10px !important;
  color: var(--sidebar-text) !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  padding: 0.6rem 0.85rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  transition: var(--transition-smooth) !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
  cursor: pointer !important;
}

html body .nav-sidebar .nav-link * {
  pointer-events: none !important;
}

@media (hover: hover) and (pointer: fine) {
  html body .nav-sidebar .nav-link:hover:not(.active) {
    background: var(--sidebar-hover) !important;
    color: #fb7185 !important;
    transform: translateX(4px) !important;
  }

  html body .nav-sidebar .nav-link:hover:not(.active) .nav-icon {
    color: #e11d48 !important;
  }
}

html body .nav-sidebar .nav-link.active {
  background: var(--sidebar-active-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.4) !important;
  font-weight: 700 !important;
  transform: translateX(4px) !important;
}

html body .nav-sidebar .nav-link.active .nav-icon {
  color: #ffffff !important;
}

html body .nav-sidebar .nav-icon {
  font-size: 1rem !important;
  width: 1.35rem !important;
  text-align: center !important;
}

/* Sidebar Badge Pills */
.sidebar-badge {
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.15em 0.55em;
  margin-left: auto;
}

.sidebar-badge-grey { background: #374151; color: #f3f4f6; }
.sidebar-badge-red { background: #ef4444; color: #ffffff; }
.sidebar-badge-blue { background: #2563eb; color: #ffffff; }
.sidebar-badge-amber { background: #f59e0b; color: #ffffff; }

/* Sidebar Upgrade Pro Promo Box */
.sidebar-upgrade-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-radius: 16px;
  padding: 1.25rem;
  margin: 1.5rem 0.85rem 1rem;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-upgrade-btn {
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  border-radius: 10px;
  width: 100%;
  padding: 0.55rem;
  margin-top: 0.75rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transition: var(--transition-smooth);
}

.sidebar-upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
  color: #ffffff;
}

/* Top Navigation Bar */
html body .main-header.navbar {
  background-color: #ffffff !important;
  border-bottom: 1px solid var(--card-border) !important;
  padding: 0.75rem 1.5rem !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

.dashboard-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.15rem;
  letter-spacing: -0.03em;
}

.dashboard-page-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

.date-picker-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Cards Base */
.card-custom {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  transition: var(--transition-smooth);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-custom:hover {
  box-shadow: var(--card-shadow-hover);
}

/* Modern Task Delete Button */
.btn-delete-task {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease-in-out;
  background: transparent;
}

.btn-delete-task:hover {
  background: #fee2e2 !important;
}

.btn-delete-task:hover i {
  color: #ef4444 !important;
  opacity: 1 !important;
}

/* Modal Backdrop & Z-Index Guarantee */
.modal-backdrop {
  z-index: 1040 !important;
}

.modal {
  z-index: 1055 !important;
}

.card-custom-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-custom-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
}

/* Revenue Overview Metrics Header */
.revenue-metric-summary {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.revenue-metric-item {
  display: flex;
  flex-direction: column;
}

.revenue-metric-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.35rem;
}

.revenue-metric-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  display: flex;
  align-items: center;
}

.revenue-metric-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

/* Top 5 Sparkline Metric Cards Flex Grid */
.sparkline-flex-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

.sparkline-flex-container .col {
  flex: 1 1 0px;
  min-width: 0;
}

@media (max-width: 991.98px) {
  .sparkline-flex-container .col {
    flex: 1 1 calc(33.333% - 1rem);
    min-width: 160px;
  }
}

@media (max-width: 575.98px) {
  .sparkline-flex-container .col {
    flex: 1 1 100%;
  }
}

.sparkline-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem;
  border: 1px solid #f1f5f9;
  box-shadow: var(--card-shadow);
  transition: var(--transition-smooth);
  position: relative;
}

.sparkline-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.sparkline-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.sparkline-icon.blue { background: #eff6ff; color: #2563eb; }
.sparkline-icon.green { background: #ecfdf5; color: #10b981; }
.sparkline-icon.red { background: #fef2f2; color: #ef4444; }
.sparkline-icon.purple { background: #f5f3ff; color: #8b5cf6; }
.sparkline-icon.amber { background: #fffbeb; color: #f59e0b; }

.sparkline-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.sparkline-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.sparkline-change {
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.sparkline-change.up { color: #10b981; }
.sparkline-change.down { color: #ef4444; }
.sparkline-change.neutral { color: #94a3b8; }

.sparkline-svg {
  width: 100%;
  height: 36px;
  margin-top: 0.5rem;
}

/* Fleet Copilot AI Assistant Widget */
.copilot-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #f1f5f9;
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
}

.copilot-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.copilot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.copilot-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.copilot-chip:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
  transform: translateX(4px);
}

.copilot-input-wrapper {
  position: relative;
  margin-top: 1rem;
}

.copilot-input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 3rem 0.75rem 1rem;
  font-size: 0.875rem;
}

.copilot-send-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #8b5cf6;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.copilot-send-btn:hover {
  background: #7c3aed;
}

/* Quick Actions Grid */
.quick-action-btn {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 14px;
  padding: 1rem 0.5rem;
  text-align: center;
  transition: var(--transition-smooth);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.quick-action-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(99, 102, 241, 0.3);
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.quick-action-title {
  font-size: 0.775rem;
  font-weight: 700;
  color: #334155;
}

/* Status Pill Badges */
.badge-pill-custom {
  padding: 0.35em 0.85em;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-active { background: #d1fae5; color: #059669; }
.badge-completed { background: #dbeafe; color: #2563eb; }
.badge-upcoming { background: #fef3c7; color: #d97706; }
.badge-overdue { background: #fee2e2; color: #dc2626; }
.badge-blue { background: #e0f2fe; color: #0284c7; }

/* Top Vehicles Progress Bar */
.vehicle-rank-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f1f5f9;
  font-weight: 700;
  font-size: 0.75rem;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-bar-custom {
  height: 8px;
  border-radius: 9999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
  transition: width 1s ease-in-out;
}

/* Dropdown Filter Menu Custom Styling */
.dropdown-menu {
  z-index: 1050 !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
  padding: 0.5rem !important;
  min-width: 140px !important;
}

.dropdown-item {
  border-radius: 8px !important;
  padding: 0.45rem 0.85rem !important;
  font-weight: 600 !important;
  color: #475569 !important;
  transition: var(--transition-smooth) !important;
}

.dropdown-item:hover {
  background-color: #f1f5f9 !important;
  color: #1e293b !important;
}

.dropdown-item.active, .dropdown-item:active {
  background-color: #eff6ff !important;
  color: #2563eb !important;
  font-weight: 700 !important;
}
