/* Card Styles */
.card {
  border-radius: 0.75rem;
  overflow: hidden;
  background-color: white;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  background-color: var(--gray-50);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  background-color: var(--gray-50);
}

.card-img {
  width: 100%;
  object-fit: cover;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  background-color: #EEF2FF;
  color: var(--primary);
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--gray-900);
  background-color: white;
  background-clip: padding-box;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background-color: white;
}

.form-select {
  display: block;
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--gray-900);
  background-color: white;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-select:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-check {
  display: block;
  min-height: 1.5rem;
  padding-left: 1.5em;
  margin-bottom: 0.125rem;
}

.form-check-input {
  width: 1em;
  height: 1em;
  margin-top: 0.25em;
  vertical-align: top;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: 1px solid var(--gray-300);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  print-color-adjust: exact;
}

.form-check-input[type="checkbox"] {
  border-radius: 0.25em;
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}

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

.badge-secondary {
  background-color: var(--secondary);
}

.badge-accent {
  background-color: var(--accent);
}

.badge-danger {
  background-color: var(--danger);
}

.badge-warning {
  background-color: var(--warning);
  color: var(--gray-900);
}

.badge-info {
  background-color: var(--info);
}

.badge-success {
  background-color: var(--success);
}

/* Alert Styles */
.alert {
  position: relative;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.alert-primary {
  color: #1E3A8A;
  background-color: #EFF6FF;
  border-color: #DBEAFE;
}

.alert-success {
  color: #065F46;
  background-color: #D1FAE5;
  border-color: #A7F3D0;
}

.alert-danger {
  color: #991B1B;
  background-color: #FEE2E2;
  border-color: #FECACA;
}

.alert-warning {
  color: #92400E;
  background-color: #FFF7ED;
  border-color: #FED7AA;
}

/* Avatar styles */
.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--gray-200);
  color: var(--gray-600);
  font-weight: 500;
  overflow: hidden;
}

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

.avatar-md {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1rem;
}

.avatar-lg {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.25rem;
}

.avatar-xl {
  width: 5rem;
  height: 5rem;
  font-size: 1.75rem;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Navbar styles */
.navbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background-color: white;
  border-bottom: 1px solid var(--gray-200);
}

.navbar-brand {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  text-decoration: none;
}

.navbar-nav {
  display: flex;
  flex-direction: row;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.nav-link {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease-in-out;
  cursor: pointer;
}

.nav-link:hover, .nav-link:focus {
  color: var(--primary);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

/* Sidebar styles */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 0;
  background-color: white;
  border-right: 1px solid var(--gray-200);
  width: 280px;
  transition: all 0.3s ease;
}

.sidebar-sticky {
  position: relative;
  top: 0;
  height: calc(100vh);
  padding-top: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  padding: 1.5rem 1.5rem 0.5rem;
  color: var(--gray-500);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.sidebar .nav-link {
  font-weight: 500;
  color: var(--gray-600);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
  background-color: var(--gray-50);
  color: var(--gray-900);
}

.sidebar .nav-link.active {
  color: var(--primary);
  background-color: #EEF2FF;
  border-left-color: var(--primary);
}

/* Progress bar */
.progress {
  display: flex;
  height: 0.5rem;
  overflow: hidden;
  font-size: 0.75rem;
  background-color: var(--gray-200);
  border-radius: 0.5rem;
}

.progress-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  background-color: var(--primary);
  transition: width 0.6s ease;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-text {
  visibility: hidden;
  width: auto;
  min-width: 120px;
  background-color: var(--gray-900);
  color: #fff;
  text-align: center;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.75rem;
  font-weight: 500;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Main content area with sidebar offset */
.main-content {
  margin-left: 280px;
  transition: margin-left 0.3s ease;
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }
  
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
}

/* Spinner */
.spinner {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
}

.spinner div {
  position: absolute;
  width: 2rem;
  height: 2rem;
  border: 0.25rem solid var(--primary);
  border-radius: 50%;
  animation: spinner 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: var(--primary) transparent transparent transparent;
}

.spinner div:nth-child(1) {
  animation-delay: -0.45s;
}

.spinner div:nth-child(2) {
  animation-delay: -0.3s;
}

.spinner div:nth-child(3) {
  animation-delay: -0.15s;
}

@keyframes spinner {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}