*, *::before, *::after {
  border-color: var(--border, #e5e7eb);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  cursor: pointer;
}

.btn:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 1px var(--bg-body, #fff), 0 0 0 3px rgba(59,130,246,0.5);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  cursor: pointer;
  background-color: rgb(37 99 235 / 1);
  color: rgb(255 255 255 / 1);
}

.btn-primary:hover {
  background-color: rgb(29 78 216 / 1);
}

.btn-primary:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 1px var(--bg-body, #fff), 0 0 0 3px rgba(59,130,246,0.5);
}

.btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  cursor: pointer;
  background-color: rgb(5 150 105 / 1);
  color: rgb(255 255 255 / 1);
}

.btn-success:hover {
  background-color: rgb(4 120 87 / 1);
}

.btn-success:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 1px var(--bg-body, #fff), 0 0 0 3px rgba(59,130,246,0.5);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  cursor: pointer;
  background-color: rgb(220 38 38 / 1);
  color: rgb(255 255 255 / 1);
}

.btn-danger:hover {
  background-color: rgb(185 28 28 / 1);
}

.btn-danger:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 1px var(--bg-body, #fff), 0 0 0 3px rgba(59,130,246,0.5);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  cursor: pointer;
  border-width: 1px;
  border-color: rgb(209 213 219 / 1);
  background-color: var(--bg-input, rgb(255 255 255 / 1));
  color: var(--text-primary, rgb(55 65 81 / 1));
}

.btn-secondary:hover {
  background-color: var(--bg-hover, rgb(249 250 251 / 1));
}

.btn-secondary:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 1px var(--bg-body, #fff), 0 0 0 3px rgba(59,130,246,0.5);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

.card {
  overflow: hidden;
  border-radius: 0.5rem;
  border-width: 1px;
  border-color: var(--border, rgb(229 231 235 / 1));
  background-color: var(--bg-card, rgb(255 255 255 / 1));
  box-shadow: var(--shadow-card, none);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom-width: 1px;
  border-color: var(--border, rgb(229 231 235 / 1));
  padding: 0.875rem 1.25rem;
  font-weight: 500;
  color: var(--text-primary, rgb(17 24 39 / 1));
  border-radius: 0.5rem 0.5rem 0 0;
  overflow: hidden;
}

.card-body {
  padding: 1.25rem;
}

.input {
  display: block;
  width: 100%;
  border-radius: 0.5rem;
  border-width: 1px;
  border-color: var(--border, rgb(209 213 219 / 1));
  background-color: var(--bg-input, rgb(255 255 255 / 1));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-primary, rgb(17 24 39 / 1));
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
}

.input::placeholder {
  color: var(--text-muted, rgb(156 163 175 / 1));
}

select.input, input.input {
  height: 2.25rem;
}

select.input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 0.75rem;
  cursor: pointer;
}

.label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--text-label, rgb(55 65 81 / 1));
}

.table {
  border-collapse: collapse;
  border-spacing: 0;
}

.table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--text-secondary, rgb(107 114 128 / 1));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--bg-table-head, rgb(249 250 251 / 1));
  border-bottom-width: 1px;
  border-color: var(--border, rgb(229 231 235 / 1));
}

.table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-primary, rgb(17 24 39 / 1));
  border-bottom-width: 1px;
  border-color: var(--border-light, rgb(243 244 246 / 1));
}

.table tbody tr:hover td {
  background-color: var(--bg-table-hover, rgba(239,246,255,0.4));
}

.badge-success {
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  background-color: rgb(220 252 231 / 1);
  color: rgb(22 101 52 / 1);
}

.badge-danger {
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  background-color: rgb(254 226 226 / 1);
  color: rgb(153 27 27 / 1);
}

.badge-warning {
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  background-color: rgb(254 249 195 / 1);
  color: rgb(133 77 14 / 1);
}

.badge-info {
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  background-color: rgb(219 234 254 / 1);
  color: rgb(30 64 175 / 1);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-secondary, rgb(107 114 128 / 1));
  border-radius: 0.5rem;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-link:hover {
  background-color: var(--bg-hover, rgb(239 246 255 / 1));
  color: var(--text-primary, rgb(17 24 39 / 1));
}

.sidebar-link.active {
  background-color: var(--bg-hover, rgb(239 246 255 / 1));
  color: #3b82f6;
  font-weight: 500;
}

.dark .sidebar-link.active {
  color: #60a5fa;
}

.stat-card {
  border-radius: 0.5rem;
  border-width: 1px;
  border-color: var(--border, rgb(229 231 235 / 1));
  background-color: var(--bg-card, rgb(255 255 255 / 1));
  padding: 1.25rem;
  box-shadow: var(--shadow-card, none);
}

.stat-value {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
}

.stat-label {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-muted, rgb(156 163 175 / 1));
}

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: rgb(255 255 255 / 1);
}

.toast-success { background-color: rgb(22 163 74 / 1); }
.toast-error { background-color: rgb(220 38 38 / 1); }
.toast-warning { background-color: rgb(234 179 8 / 1); }
