/* ============================================
   TripNan - Clean & Professional Design
   Human-crafted UI with light blue accents
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Light Blue Primary Palette */
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light: #38bdf8;
  --primary-lighter: #e0f2fe;
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;
  --primary-300: #7dd3fc;

  /* Neutral Palette */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Semantic Colors */
  --success: #22c55e;
  --success-light: #dcfce7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #3b82f6;
  --info-light: #dbeafe;

  /* Backgrounds */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-input: #ffffff;

  /* Text */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Borders */
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

  /* Radius */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;
}

/* ============================================
   Base Styles
   ============================================ */

* {
  box-sizing: border-box;
}

html, body, #root {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.form-control, .form-select {
  font-size: 16px !important; /* Mencegah auto-zoom di WebView Android saat difokuskan */
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

/* ============================================
   Buttons - Clean Bootstrap Style
   ============================================ */

.btn {
  font-family: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.5;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

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

/* Primary Button */
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

.btn-primary:active {
  background: #0369a1;
  border-color: #0369a1;
}

/* Ensure icon color in primary buttons is white */
.btn-primary svg,
.btn-primary i {
  color: white !important;
  stroke: white !important;
}

/* Secondary Button */
.btn-secondary {
  background: var(--gray-100);
  color: var(--text-primary);
  border-color: var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-200);
  border-color: var(--gray-300);
  color: var(--text-primary);
}

/* Success Button */
.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-success:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: white;
}

/* Danger Button */
.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
}

/* Outline Buttons */
.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary-50);
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--gray-300);
}

.btn-outline-secondary:hover {
  background: var(--gray-50);
  color: var(--text-primary);
  border-color: var(--gray-400);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-outline-success {
  background: transparent;
  color: var(--success);
  border-color: var(--success);
}

.btn-outline-success:hover {
  background: var(--success-light);
  color: var(--success);
  border-color: var(--success);
}

/* Link Button */
.btn-link {
  background: transparent;
  color: var(--primary);
  border: none;
  padding: 0.25rem 0.5rem;
  font-weight: 500;
}

.btn-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Button Sizes */
.btn-sm {
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
}

/* ============================================
   Login Page - Clean & Professional
   ============================================ */

/* Scaffold + SingleChildScrollView + Center Equivalent */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* Wajib agar bisa di-scroll saat keyboard Android muncul */
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: linear-gradient(135deg, var(--primary-100) 0%, var(--gray-50) 50%, var(--primary-50) 100%);
}

.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 80%;
  height: 100%;
  background: radial-gradient(ellipse, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Container + Column (mainAxisSize: min) Equivalent */
.login-card {
  width: 90%;
  max-width: 400px;
  background: var(--bg-card);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 3rem 2.5rem;
  position: relative;
  border: 1px solid var(--border-light);
  margin: auto; /* Menengah-kan posisi secara vertikal & horizontal */
}

/* Beautiful Mockup Styling */
.login-card .icon-circle {
  width: 60px;
  height: 60px;
  background: var(--primary-100);
  color: var(--primary-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.login-card .input-group {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  background: var(--bg-card);
}

.login-card .input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.25rem rgba(14, 165, 233, 0.15);
}

.login-card .input-group-text {
  background: transparent;
  border: none;
  color: var(--text-muted);
}

.login-card .form-control {
  border: none;
  background: transparent;
  padding-left: 0;
}

.login-card .form-control:focus {
  box-shadow: none;
}

.login-card .btn-primary {
  border-radius: var(--radius-md);
  padding: 0.8rem;
  font-weight: 600;
  margin-top: 1rem;
  background-color: var(--primary);
  border: none;
}


.login-card h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-card .text-muted {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ============================================
   Forms
   ============================================ */

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  display: block;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

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

.input-group {
  display: flex;
}

.input-group-text {
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.input-group .form-control {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.form-select {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition: all var(--transition-fast);
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* ============================================
   Cards
   ============================================ */

.card-trip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

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

.card-body {
  padding: 1.5rem;
}

/* ============================================
   Sidebar
   ============================================ */

/* Desktop - sidebar collapsable */
@media (min-width: 769px) {
  .sidebar:not(.open) {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu-btn {
    display: none !important;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .sidebar.open ~ .main-content {
    margin-left: 280px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex !important;
  }

  .main-content {
    margin-left: 0 !important;
  }
}

/* Sidebar Container */
.sidebar {
  background: var(--bg-card);
  padding: 1.5rem;
  position: fixed;
  left: 0;
  top: 73px;
  height: calc(100vh - 73px); /* fallback */
  height: calc(100dvh - 73px);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  width: 280px;
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

/* Mobile Sidebar - Hidden by default */
@media (max-width: 768px) {
  .sidebar {
    top: 0 !important;
    bottom: 0 !important;
    height: auto !important;
    transform: translateX(-100%);
    z-index: 1050; /* Above header and overlay */
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

/* Sidebar Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.sidebar-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Sidebar Close Button */
.sidebar-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--gray-100);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  background: var(--gray-200);
  color: var(--text-primary);
}

/* Hide close button on desktop */
@media (min-width: 769px) {
  .sidebar-close-btn {
    display: none !important;
  }
}

/* Sidebar User Card */
.sidebar-user-card {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-light);
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--primary-100);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  color: var(--text-secondary);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.sidebar-nav-item:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: var(--primary-100);
  color: var(--primary-dark);
  font-weight: 600;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  min-width: 1.25rem;
  text-align: center;
}

/* Sidebar Logout */
.sidebar-logout {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Main Content */
.main-content {
  margin-left: 0;
  transition: margin-left 0.3s ease;
}

/* ============================================
   Trip Card
   ============================================ */

.trip-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.trip-card .trip-cover {
  height: 140px;
  background-color: var(--primary-100);
  position: relative;
  overflow: hidden;
}

.trip-card .trip-cover img.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.trip-card .trip-cover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
}

.trip-card .trip-code {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  z-index: 2;
  box-shadow: var(--shadow-xs);
}

.trip-card .trip-shared-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  z-index: 2;
}

/* ============================================
   Schedule Item
   ============================================ */

.schedule-item {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  position: relative;
  transition: all var(--transition);
}

.schedule-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  transition: all var(--transition);
}

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

.schedule-item:hover::before {
  width: 5px;
}

.schedule-item.completed::before {
  background: var(--success);
}

/* ============================================
   Photo Gallery - Clean Design
   ============================================ */

.photo-gallery {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.photo-gallery.single { grid-template-columns: 1fr; }
.photo-gallery.multiple-2 { grid-template-columns: repeat(2, 1fr); }
.photo-gallery.multiple-3 { grid-template-columns: repeat(3, 1fr); }
.photo-gallery.multiple-4 { grid-template-columns: repeat(2, 1fr); }
.photo-gallery.multiple-n { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.photo-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
  background: var(--gray-100);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.photo-item:hover img {
  transform: scale(1.05);
}

.photo-item .photo-number {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
}

.photo-item .photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity var(--transition);
}

.photo-item:hover .photo-overlay {
  opacity: 1;
}

.photo-item .photo-action {
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  border: none;
  cursor: pointer;
  transform: translateY(10px);
  opacity: 0;
  transition: all var(--transition);
}

.photo-item:hover .photo-action {
  transform: translateY(0);
  opacity: 1;
}

.photo-item:hover .photo-action:nth-child(2) { transition-delay: 0.05s; }
.photo-item:hover .photo-action:nth-child(3) { transition-delay: 0.1s; }

.photo-item .photo-action:hover {
  background: var(--primary);
  color: white;
}

.photo-item .photo-action.delete:hover {
  background: var(--danger);
}

/* Add Photo Button */
.add-photo-btn {
  aspect-ratio: 4/3;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--gray-50);
  transition: all var(--transition);
}

.add-photo-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-50);
}

.add-photo-btn span {
  font-size: 0.8125rem;
  font-weight: 500;
}

/* Photo Gallery Header */
.photo-gallery-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.photo-gallery-header h6 {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================
   Hero Section
   ============================================ */

.trip-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 2rem;
  color: white;
  position: relative;
  overflow: hidden;
}

.trip-hero .badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ============================================
   Module Cards
   ============================================ */

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.module-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}

.module-card .module-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
}

/* ============================================
   Progress Bar
   ============================================ */

.progress {
  height: 6px;
  border-radius: 9999px;
  background: var(--gray-200);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 9999px;
  transition: width var(--transition-slow);
}

/* ============================================
   Alerts
   ============================================ */

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
}

.alert-success {
  background: var(--success-light);
  color: #166534;
  border-left: 3px solid var(--success);
}

.alert-danger {
  background: var(--danger-light);
  color: #991b1b;
  border-left: 3px solid var(--danger);
}

.alert-warning {
  background: var(--warning-light);
  color: #92400e;
  border-left: 3px solid var(--warning);
}

/* ============================================
   Badges
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.badge.bg-light {
  background: var(--gray-100) !important;
  color: var(--text-secondary) !important;
}

.badge.bg-success {
  background: var(--success-light) !important;
  color: #166534 !important;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.4;
  color: var(--primary);
}

/* ============================================
   Animations
   ============================================ */

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

.animate-fade-in {
  animation: fadeIn var(--transition-slow) ease forwards;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.animate-scale-in {
  animation: scaleIn var(--transition) ease forwards;
}

/* ============================================
   Image Preview Modal
   ============================================ */

.image-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.image-preview-modal img {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.image-preview-modal .close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.image-preview-modal .close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Skeleton Loading
   ============================================ */

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

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

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

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

/* ============================================
   Dividers
   ============================================ */

hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ============================================
   Icon Circles
   ============================================ */

.icon-circle-primary {
  background: var(--primary-100);
  color: var(--primary);
}

.icon-circle-success {
  background: var(--success-light);
  color: var(--success);
}

.icon-circle-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.icon-circle-danger {
  background: var(--danger-light);
  color: var(--danger);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .card-body {
    padding: 1rem;
  }

  .login-card {
    padding: 1.5rem;
  }
}

/* ============================================
   Utility Classes
   ============================================ */

.spin {
  animation: spin 1s linear infinite;
}

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

.text-muted {
  color: var(--text-muted) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.text-success {
  color: var(--success) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.border-top {
  border-top: 1px solid var(--border) !important;
}

/* Spacing */
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-2 { margin-left: 0.5rem !important; }

/* Flex */
.flex-grow-1 { flex-grow: 1 !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

/* Width */
.w-100 { width: 100% !important; }

/* Text */
.text-center { text-align: center !important; }
.text-end { text-align: end !important; }
.small { font-size: 0.8125rem !important; }
.fw-bold { font-weight: 600 !important; }
.fw-semibold { font-weight: 500 !important; }

/* Display */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none { display: none !important; }
.d-md-none { display: none !important; }

@media (max-width: 767px) {
  .d-md-none { display: flex !important; }
  .d-md-flex { display: flex !important; }
}

/* Position */
.position-fixed { position: fixed !important; }
.position-absolute { position: absolute !important; }

/* Overflow */
.overflow-auto { overflow: auto !important; }

/* Cursor */
.cursor-pointer { cursor: pointer !important; }

/* Opacity */
.opacity-25 { opacity: 0.25 !important; }
.opacity-75 { opacity: 0.75 !important; }
.opacity-50 { opacity: 0.5 !important; }

/* Borders */
.rounded-circle { border-radius: 50% !important; }

/* Z-index */
.z-2 { z-index: 2 !important; }
.z-10 { z-index: 10 !important; }
.z-100 { z-index: 100 !important; }
.z-1000 { z-index: 1000 !important; }
.z-9999 { z-index: 9999 !important; }

/* Border Radius */
.rounded { border-radius: var(--radius) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }

/* Input Color */
input[type="color"] {
  padding: 0.25rem;
  height: auto;
  width: 50px;
}

/* ============================================
   Dark Mode Definitions
   ============================================ */
body.dark-mode {
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-sidebar: #1e293b;
  --bg-input: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --border: #334155;
  
  --primary: #38bdf8;
  --primary-dark: #0ea5e9;
  --primary-light: #7dd3fc;
  --primary-lighter: #0c4a6e;
  --primary-50: #0c4a6e;
  
  --gray-50: #0f172a;
  --gray-100: #1e293b;
  --gray-200: #334155;
  
  background-color: var(--bg-body) !important;
  color: var(--text-primary) !important;
}

body.dark-mode .bg-light {
  background-color: var(--gray-800) !important;
}

body.dark-mode .card-trip,
body.dark-mode .sidebar,
body.dark-mode .bg-white,
body.dark-mode .module-card,
body.dark-mode .auth-card {
  background-color: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-primary);
}

body.dark-mode .form-control,
body.dark-mode .form-select {
  background-color: var(--bg-input);
  border-color: var(--border);
  color: var(--text-primary);
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
  background-color: var(--bg-input);
  border-color: var(--primary);
  color: var(--text-primary);
}

body.dark-mode .text-dark {
  color: var(--text-primary) !important;
}

body.dark-mode .text-muted {
  color: var(--text-muted) !important;
}

body.dark-mode .btn-light {
  background-color: var(--gray-200) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

body.dark-mode .btn-light:hover {
  background-color: var(--gray-100) !important;
}

body.dark-mode .btn-white {
  background-color: transparent;
  color: var(--text-secondary);
}

body.dark-mode .dropdown-menu {
  background-color: var(--bg-card);
  border-color: var(--border);
}

body.dark-mode .dropdown-item {
  color: var(--text-primary);
}

body.dark-mode .dropdown-item:hover {
  background-color: var(--gray-200);
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .settings-sidebar {
    min-height: 60vh;
  }
}

@media (max-width: 767px) {
  .settings-layout.mobile-menu-active .settings-content-container {
    display: none !important;
  }
  .settings-layout.mobile-content-active .settings-menu-container {
    display: none !important;
  }
}

/* Dynamic Background Adaptations */
.sidebar:not(.dark-mode *), .bg-white:not(.dark-mode *), .bg-light:not(.dark-mode *), .card:not(.dark-mode *), .settings-layout:not(.dark-mode *) {
  color: var(--text-primary);
}

