/* Clay - Premium Design System */

:root {
  /* Brand colors - refined palette */
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #eef2ff;
  --color-primary-50: #eef2ff;
  --color-primary-100: #e0e7ff;
  --color-primary-500: #6366f1;
  --color-primary-600: #4f46e5;
  --color-primary-700: #4338ca;

  /* Neutral palette */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* Status colors - refined with gradients */
  --color-status-pending: #fef9c3;
  --color-status-pending-text: #854d0e;
  --color-status-pending-border: #fde047;
  --color-status-progress: #dbeafe;
  --color-status-progress-text: #1e40af;
  --color-status-progress-border: #60a5fa;
  --color-status-completed: #dcfce7;
  --color-status-completed-text: #166534;
  --color-status-completed-border: #4ade80;
  --color-status-cancelled: #fee2e2;
  --color-status-cancelled-text: #991b1b;
  --color-status-cancelled-border: #f87171;

  /* Sidebar - modern dark theme */
  --color-sidebar-bg: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
  --color-sidebar-header: rgba(0, 0, 0, 0.2);
  --color-sidebar-hover: rgba(255, 255, 255, 0.08);
  --color-sidebar-active: rgba(99, 102, 241, 0.2);
  --color-sidebar-active-border: #818cf8;

  /* Shadows - layered for depth */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.03);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  --shadow-card: 0 1px 3px rgb(0 0 0 / 0.04), 0 1px 2px -1px rgb(0 0 0 / 0.04);
  --shadow-card-hover: 0 10px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;

  /* Sidebar text colors */
  --sidebar-text: rgba(255, 255, 255, 0.9);
  --sidebar-text-muted: rgba(255, 255, 255, 0.7);
  --sidebar-text-dim: rgba(255, 255, 255, 0.5);
  --sidebar-text-faint: rgba(255, 255, 255, 0.4);
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-avatar-from: #818cf8;
  --sidebar-avatar-to: #a78bfa;

  /* Chart colors */
  --chart-blue: #6366f1;
  --chart-green: #10b981;
  --chart-yellow: #f59e0b;
  --chart-red: #ef4444;
  --chart-gray: #6b7280;
  --chart-purple: #8b5cf6;
  --chart-cyan: #06b6d4;
}

/* Base body styling */
body {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  min-height: 100vh;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-700) 100%);
  color: white;
  font-weight: 500;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06), inset 0 1px 0 rgb(255 255 255 / 0.1);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-700) 0%, #3730a3 100%);
  box-shadow: 0 4px 6px -1px rgb(79 70 229 / 0.3), 0 2px 4px -2px rgb(79 70 229 / 0.2);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: white;
  color: var(--color-gray-700);
  font-weight: 500;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--color-gray-50);
  border-color: var(--color-gray-300);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  color: #dc2626;
  font-weight: 500;
  transition: all var(--transition-fast);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
}

.btn-danger:hover {
  color: #991b1b;
  background: #fef2f2;
}

/* ========================================
   STATUS BADGES - Enhanced with icons
   ======================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  border-radius: 9999px;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.status-pending {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  color: var(--color-status-pending-text);
  border-color: var(--color-status-pending-border);
}

.status-in_progress {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: var(--color-status-progress-text);
  border-color: var(--color-status-progress-border);
}

.status-completed {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: var(--color-status-completed-text);
  border-color: var(--color-status-completed-border);
}

.status-cancelled {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: var(--color-status-cancelled-text);
  border-color: var(--color-status-cancelled-border);
}

.status-scheduled {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #3730a3;
  border-color: #a5b4fc;
}

.status-on_hold {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  color: #6b21a8;
  border-color: #c4b5fd;
}

.status-correction_needed {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  color: #c2410c;
  border-color: #fdba74;
}

.status-review {
  background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
  color: #0e7490;
  border-color: #67e8f9;
}

/* ========================================
   ROLE BADGES
   ======================================== */

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #374151;
  transition: all var(--transition-fast);
}

.role-lead {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #3730a3;
  border-color: #a5b4fc;
}

.role-member {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #374151;
  border-color: #d1d5db;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  color: var(--color-gray-900);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.form-input::placeholder {
  color: var(--color-gray-400);
}

.form-input:hover {
  border-color: var(--color-gray-300);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), var(--shadow-sm);
}

/* Select styling */
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

/* ========================================
   CARDS
   ======================================== */

.card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition: all var(--transition-base);
}

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

.card-interactive {
  cursor: pointer;
}

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

/* Stat cards */
.stat-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--stat-color, var(--color-primary)) 0%, transparent 100%);
  opacity: 0.6;
}

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

.stat-card-blue { --stat-color: #6366f1; }
.stat-card-green { --stat-color: #10b981; }
.stat-card-yellow { --stat-color: #f59e0b; }
.stat-card-purple { --stat-color: #8b5cf6; }

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-blue {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #4f46e5;
}

.stat-icon-green {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #059669;
}

.stat-icon-yellow {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #d97706;
}

.stat-icon-purple {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  color: #7c3aed;
}

.stat-icon-red {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #dc2626;
}

/* ========================================
   TABLES
   ======================================== */

.data-table {
  min-width: 100%;
}

.table-header {
  background: linear-gradient(180deg, var(--color-gray-50) 0%, var(--color-gray-100) 100%);
}

.table-header th {
  padding: 0.875rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid var(--color-gray-200);
}

.table-header th.text-center {
  text-align: center;
}

.table-body td {
  padding: 1rem 1.5rem;
}

.table-body tr {
  transition: background-color var(--transition-fast);
}

.table-body tr:hover {
  background: var(--color-gray-50);
}

/* ========================================
   SIDEBAR - Modern gradient design
   ======================================== */

.sidebar {
  background: var(--color-sidebar-bg);
}

/* Desktop sidebar needs position:relative for ::before pseudo-element */
@media (min-width: 768px) {
  .sidebar {
    position: relative;
  }
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at top left, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.sidebar-header {
  background: var(--color-sidebar-header);
  backdrop-filter: blur(8px);
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.625rem 1rem;
  margin: 0.125rem 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-link:hover {
  background: var(--color-sidebar-hover);
  color: white;
}

.sidebar-link.active {
  background: var(--color-sidebar-active);
  color: white;
  border-left: 3px solid var(--color-sidebar-active-border);
  margin-left: calc(0.5rem - 3px);
}

.sidebar-link svg {
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.sidebar-link:hover svg,
.sidebar-link.active svg {
  opacity: 1;
}

/* Collapsed sidebar link style */
.sidebar-link-collapsed {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.625rem;
  margin: 0.125rem 0;
  color: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-link-collapsed:hover {
  background: var(--color-sidebar-hover);
  color: white;
}

.sidebar-link-collapsed.active {
  background: var(--color-sidebar-active);
  color: white;
}

.sidebar-link-collapsed svg {
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.8;
}

.sidebar-link-collapsed:hover svg,
.sidebar-link-collapsed.active svg {
  opacity: 1;
}

/* Section headers in sidebar */
.sidebar-section {
  padding: 0.5rem 1rem;
  margin-top: 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Hide sidebar scrollbar for cleaner look */
.sidebar nav {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.sidebar nav::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

/* ========================================
   HEADER
   ======================================== */

.app-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-gray-800);
  letter-spacing: -0.01em;
}

/* ========================================
   MODALS
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeIn var(--transition-fast) ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 28rem;
  margin: 0 1rem;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  animation: slideUp var(--transition-base) ease-out;
}

/* Hide scrollbar but keep functionality for modals */
.modal-content::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

.modal-content {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content .p-4.border-b {
  background: linear-gradient(180deg, var(--color-gray-50) 0%, white 100%);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

/* ========================================
   FILTER PILLS
   ======================================== */

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.filter-pill-inactive {
  background: var(--color-gray-100);
  color: var(--color-gray-600);
}

.filter-pill-inactive:hover {
  background: var(--color-gray-200);
  color: var(--color-gray-700);
}

.filter-pill-active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-700) 100%);
  color: white;
  box-shadow: 0 2px 4px rgb(79 70 229 / 0.2);
}

/* ========================================
   ALERTS & TOASTS
   ======================================== */

.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert-info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* ========================================
   EMPTY STATES
   ======================================== */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  color: var(--color-gray-300);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: 0.25rem;
}

.empty-state-desc {
  font-size: 0.875rem;
  color: var(--color-gray-500);
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1.5rem;
}

.pagination-btn {
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  color: var(--color-gray-600);
}

.pagination-btn:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-900);
}

.pagination-btn-active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-700) 100%);
  color: white;
  box-shadow: 0 2px 4px rgb(79 70 229 / 0.2);
}

/* ========================================
   AVATAR
   ======================================== */

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.avatar-sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.75rem;
}

.avatar-lg {
  width: 3rem;
  height: 3rem;
  font-size: 1rem;
}

.avatar-gray {
  background: linear-gradient(135deg, var(--color-gray-100) 0%, var(--color-gray-200) 100%);
  color: var(--color-gray-500);
}

.avatar-primary {
  background: linear-gradient(135deg, var(--color-primary-100) 0%, var(--color-primary-light) 100%);
  color: var(--color-primary);
}

/* ========================================
   UTILITIES
   ======================================== */

[x-cloak] {
  display: none !important;
}

/* iOS Safe Area for PWA */
.safe-area-pb,
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (display-mode: standalone) {
  .safe-area-pb {
    padding-bottom: calc(env(safe-area-inset-bottom, 0) + 0.5rem);
  }
}

/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

.skeleton {
  background: linear-gradient(90deg, var(--color-gray-200) 0%, var(--color-gray-100) 50%, var(--color-gray-200) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* Hover lift effect */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

/* Glass effect for overlays */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--color-primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   CALENDAR
   ======================================== */

/* Calendar swimlane styles */
.calendar-swimlane {
  display: flex;
  flex-direction: column;
}

.calendar-row {
  display: flex;
  border-bottom: 1px solid var(--color-gray-200);
  min-height: 60px;
}

.calendar-resource {
  width: 12rem;
  padding: 0.75rem;
  border-right: 1px solid var(--color-gray-200);
  font-weight: 500;
  background: var(--color-gray-50);
}

.calendar-events {
  flex: 1;
  position: relative;
  min-height: 60px;
}

/* FullCalendar event status colors */
.fc-event.status-pending {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%) !important;
  border-color: var(--color-status-pending-border) !important;
  color: var(--color-status-pending-text) !important;
}

.fc-event.status-scheduled {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%) !important;
  border-color: #a5b4fc !important;
  color: #3730a3 !important;
}

.fc-event.status-in_progress {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
  border-color: var(--color-status-progress-border) !important;
  color: var(--color-status-progress-text) !important;
}

.fc-event.status-on_hold {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%) !important;
  border-color: #c4b5fd !important;
  color: #6b21a8 !important;
}

.fc-event.status-correction_needed {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%) !important;
  border-color: #fdba74 !important;
  color: #c2410c !important;
}

.fc-event.status-review {
  background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%) !important;
  border-color: #67e8f9 !important;
  color: #0e7490 !important;
}

.fc-event.status-completed {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
  border-color: var(--color-status-completed-border) !important;
  color: var(--color-status-completed-text) !important;
}

.fc-event.status-cancelled {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
  border-color: var(--color-status-cancelled-border) !important;
  color: var(--color-status-cancelled-text) !important;
}


/* Interactive Map - ensure it stays below modals */
.leaflet-container {
  z-index: 1 !important;
}

.card:has(.leaflet-container) {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

/* ========================================
   SIDEBAR TEXT UTILITY CLASSES
   ======================================== */

.sidebar-text { color: var(--sidebar-text); }
.sidebar-text-muted { color: var(--sidebar-text-muted); }
.sidebar-text-dim { color: var(--sidebar-text-dim); }
.sidebar-text-faint { color: var(--sidebar-text-faint); }
.sidebar-border-color { border-color: var(--sidebar-border); }
.sidebar-avatar {
  background: linear-gradient(135deg, var(--sidebar-avatar-from), var(--sidebar-avatar-to));
}

/* Sidebar interactive element: hover background + text color lift.
   Combines hover bg + text in one class so we never rely on
   Tailwind generating hover variants for custom classes. */
.sidebar-interactive {
  transition: color var(--transition-fast), background-color var(--transition-fast);
}
.sidebar-interactive:hover {
  background: var(--color-sidebar-hover);
  color: var(--sidebar-text);
}

/* Sidebar flyout menu (collapsed sidebar) */
.sidebar-flyout {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.1);
}
.sidebar-flyout-heading {
  color: rgba(255, 255, 255, 0.5);
}
.sidebar-flyout-link {
  color: rgba(255, 255, 255, 0.8);
}
.sidebar-flyout-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="warm"] .sidebar-flyout {
  background: white;
  border-color: var(--color-gray-200);
  box-shadow: 0 10px 25px -5px rgb(120 90 50 / 0.15);
}
[data-theme="warm"] .sidebar-flyout-heading {
  color: var(--color-gray-400);
}
[data-theme="warm"] .sidebar-flyout-link {
  color: var(--color-gray-700);
}
[data-theme="warm"] .sidebar-flyout-link:hover {
  color: var(--color-gray-900);
  background: var(--color-gray-50);
}

/* ========================================
   WARM & SOFT THEME
   ======================================== */

[data-theme="warm"] {
  /* Primary: teal */
  --color-primary: #0d9488;
  --color-primary-hover: #0f766e;
  --color-primary-light: #f0fdfa;
  --color-primary-50: #f0fdfa;
  --color-primary-100: #ccfbf1;
  --color-primary-500: #14b8a6;
  --color-primary-600: #0d9488;
  --color-primary-700: #0f766e;

  /* Warm neutrals */
  --color-gray-50: #faf8f6;
  --color-gray-100: #f5f0ec;
  --color-gray-200: #e8e0d8;
  --color-gray-300: #d4c8bc;
  --color-gray-400: #a89888;
  --color-gray-500: #7a6e62;
  --color-gray-600: #5c5248;
  --color-gray-700: #443c34;
  --color-gray-800: #2c2620;
  --color-gray-900: #1a1614;

  /* Sidebar: light warm */
  --color-sidebar-bg: linear-gradient(180deg, #faf8f6 0%, #f0ebe5 100%);
  --color-sidebar-header: rgba(0, 0, 0, 0.03);
  --color-sidebar-hover: rgba(13, 148, 136, 0.08);
  --color-sidebar-active: rgba(13, 148, 136, 0.12);
  --color-sidebar-active-border: #14b8a6;

  /* Sidebar text: dark on light */
  --sidebar-text: #2c2620;
  --sidebar-text-muted: #5c5248;
  --sidebar-text-dim: #7a6e62;
  --sidebar-text-faint: #a89888;
  --sidebar-border: rgba(0, 0, 0, 0.08);
  --sidebar-avatar-from: #14b8a6;
  --sidebar-avatar-to: #f59e0b;

  /* Warmer shadows */
  --shadow-sm: 0 1px 2px 0 rgb(120 90 50 / 0.04);
  --shadow-md: 0 4px 6px -1px rgb(120 90 50 / 0.06), 0 2px 4px -2px rgb(120 90 50 / 0.04);
  --shadow-lg: 0 10px 15px -3px rgb(120 90 50 / 0.06), 0 4px 6px -4px rgb(120 90 50 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(120 90 50 / 0.06), 0 8px 10px -6px rgb(120 90 50 / 0.04);
  --shadow-card: 0 1px 3px rgb(120 90 50 / 0.05), 0 1px 2px -1px rgb(120 90 50 / 0.04);
  --shadow-card-hover: 0 10px 25px -5px rgb(120 90 50 / 0.1), 0 8px 10px -6px rgb(120 90 50 / 0.05);

  /* Larger border radii */
  --radius-sm: 0.5rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;

  /* Warm chart colors */
  --chart-blue: #14b8a6;
  --chart-purple: #f59e0b;
}

/* Warm theme: body background */
[data-theme="warm"] body,
body[data-theme="warm"] {
  background: linear-gradient(135deg, #fdfcfa 0%, #faf5ef 50%, #f5ede3 100%);
}

/* Warm theme: pill-shaped buttons */
[data-theme="warm"] .btn-primary {
  border-radius: 9999px;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  box-shadow: 0 1px 2px rgb(13 148 136 / 0.2), 0 1px 1px rgb(13 148 136 / 0.1), inset 0 1px 0 rgb(255 255 255 / 0.15);
}

[data-theme="warm"] .btn-primary:hover {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  box-shadow: 0 4px 6px -1px rgb(13 148 136 / 0.3), 0 2px 4px -2px rgb(13 148 136 / 0.2);
}

[data-theme="warm"] .btn-secondary {
  border-radius: 9999px;
}

/* Warm theme: sidebar no overlay gradient */
[data-theme="warm"] .sidebar::before {
  background: none;
}

/* Warm theme: form focus ring */
[data-theme="warm"] .form-input:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15), var(--shadow-sm);
}

/* Warm theme: filter pills */
[data-theme="warm"] .filter-pill-active {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  box-shadow: 0 2px 4px rgb(13 148 136 / 0.2);
}

/* Warm theme: pagination active */
[data-theme="warm"] .pagination-btn-active {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  box-shadow: 0 2px 4px rgb(13 148 136 / 0.2);
}

/* Warm theme: focus ring */
[data-theme="warm"] :focus-visible {
  outline-color: #0d9488;
}

/* Warm theme: gradient text */
[data-theme="warm"] .gradient-text {
  background: linear-gradient(135deg, #0d9488 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Warm theme: stat card accent colors */
[data-theme="warm"] .stat-card-blue { --stat-color: #14b8a6; }
[data-theme="warm"] .stat-card-purple { --stat-color: #f59e0b; }

/* Warm theme: stat icon backgrounds */
[data-theme="warm"] .stat-icon-blue {
  background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
  color: #0d9488;
}

[data-theme="warm"] .stat-icon-purple {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #d97706;
}

/* Warm theme: role badges */
[data-theme="warm"] .role-lead {
  background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
  color: #0f766e;
  border-color: #5eead4;
}

/* Warm theme: sidebar link colors override */
[data-theme="warm"] .sidebar-link {
  color: var(--sidebar-text-muted);
}

[data-theme="warm"] .sidebar-link:hover {
  color: var(--sidebar-text);
}

[data-theme="warm"] .sidebar-link.active {
  color: #0d9488;
}

[data-theme="warm"] .sidebar-link-collapsed {
  color: var(--sidebar-text-muted);
}

[data-theme="warm"] .sidebar-link-collapsed:hover {
  color: var(--sidebar-text);
}

[data-theme="warm"] .sidebar-link-collapsed.active {
  color: #0d9488;
}

[data-theme="warm"] .sidebar-section {
  color: var(--sidebar-text-faint);
}
