:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --secondary: #64748b;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --light: #f8fafc;
  --dark: #0f172a;
  --border: #e2e8f0;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.card {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  transition: all 0.2s ease-in-out;
}

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

.card-img-top {
  height: 200px;
  object-fit: cover;
  border-radius: 0.75rem 0.75rem 0 0;
}

.btn {
  border-radius: 0.5rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease-in-out;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

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

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

.form-control, .form-select {
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  transition: all 0.2s ease-in-out;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgb(30 64 175 / 0.25);
}

.navbar {
  backdrop-filter: blur(10px);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
}

.nav-link {
  font-weight: 500;
  transition: color 0.2s ease-in-out;
}

.alert {
  border-radius: 0.75rem;
  border: none;
  padding: 1rem 1.25rem;
}

.alert-success {
  background: rgb(220 252 231);
  color: var(--success);
}

.alert-danger {
  background: rgb(254 226 226);
  color: var(--danger);
}

.alert-warning {
  background: rgb(254 243 199);
  color: var(--warning);
}

.table {
  border-radius: 0.75rem;
  overflow: hidden;
}

.table th {
  background: var(--light);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
}

.badge {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
}

.payment-method {
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.payment-method:hover {
  border-color: var(--primary);
  background: rgb(30 64 175 / 0.05);
}

.payment-method.selected {
  border-color: var(--primary);
  background: rgb(30 64 175 / 0.1);
}

.sidebar {
  min-height: calc(100vh - 76px);
  background: white;
  border-right: 1px solid var(--border);
}

.sidebar .nav-link {
  color: var(--secondary);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  margin: 0.25rem 0.75rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: var(--light);
  color: var(--primary);
}

.main-content {
  padding: 2rem;
}

@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }
  
  .card-img-top {
    height: 150px;
  }
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shadow-sm {
  box-shadow: var(--shadow);
}

.shadow {
  box-shadow: var(--shadow-lg);
}

/* ULTIMATE modal stability fixes - completely disable all animations */
/* Replaced: Use prefers-reduced-motion to minimize animations without breaking modals */
@media (prefers-reduced-motion: reduce) {
  .modal .modal-dialog,
  .modal .modal-content {
    transition: none !important;
    transform: none !important;
  }
  .modal-backdrop {
    transition: none !important;
  }
}

/* Stable backdrop opacity */
.modal-backdrop {
  opacity: 0.5;
}
.bg-gradient-primary {
  background: linear-gradient(135deg, #0d6efd, #0b5ed7);
}

@media (max-width: 576px) {
  .carousel-caption h3 {
    font-size: 1.5rem;
  }
  .carousel-caption h4 {
    font-size: 1rem;
  }
  .carousel-caption .btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
  }
}

/* Center carousel caption block */
.carousel-caption-custom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  padding: 0 1rem;
  z-index: 10;
}

/* Responsive typography & button sizing */
@media (max-width: 576px) {
  .carousel-caption-custom h3 {
    font-size: 1.5rem;
  }
  .carousel-caption-custom h4 {
    font-size: 1rem;
  }
  .carousel-caption-custom .btn {
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem;
  }
}

@media (max-width: 576px) {
  .carousel-caption h3 {
    font-size: 1.5rem;
  }
  .carousel-caption h4 {
    font-size: 1rem;
  }
  .carousel-caption .btn {
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem;
  }
}