/* components.css — Botones, inputs, tablas, cards,
                    badges, modales, toasts, forms

/*BOTONES*/
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.5;
}

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

/* Variantes */
.btn--primary {
  background-color: #2563eb;
  color: #ffffff;
}

.btn--primary:hover:not(:disabled) {
  background-color: #1d4ed8;
}

.btn--secondary {
  background-color: #ffffff;
  color: #334155;
  border-color: #e2e8f0;
}

.btn--secondary:hover:not(:disabled) {
  background-color: #f8fafc;
}

.btn--danger {
  background-color: #dc2626;
  color: #ffffff;
}

.btn--danger:hover:not(:disabled) {
  background-color: #b91c1c;
}

/* Tamaños */
.btn--sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

.btn--lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  width: 100%;
  justify-content: center;
}

/*FORMULARIOS*/
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #1e293b;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-control::placeholder {
  color: #94a3b8;
}

/* Campo de solo lectura (usado en edición de técnicos) */
.form-control[readonly] {
  background-color: #f1f5f9;
  color: #64748b;
  cursor: default;
}

.form-error {
  font-size: 0.75rem;
  color: #dc2626;
  margin-top: 0.25rem;
}

/*CARDS*/
.card {
  background-color: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.card__title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.card__body {
  padding: 1.5rem;
}

/* Stat card (para el dashboard) */
.stat-card {
  background-color: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.stat-card__label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.stat-card__value {
  font-size: 1.875rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 0.25rem;
}

/*TABLAS*/
.table-wrapper {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table thead {
  background-color: #f8fafc;
}

.table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #475569;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.table td {
  padding: 0.75rem 1rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

/*BADGES (estados de órdenes, técnicos, etc.)*/
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* EstadoOrden */
.badge--pendiente {
  background-color: #fffbeb;
  color: #d97706;
}

.badge--en_proceso {
  background-color: #ecfeff;
  color: #0891b2;
}

.badge--completado {
  background-color: #f0fdf4;
  color: #16a34a;
}

.badge--entregado {
  background-color: #eff6ff;
  color: #2563eb;
}

.badge--cancelado {
  background-color: #fef2f2;
  color: #dc2626;
}

/* EstadoTecnico */
.badge--disponible {
  background-color: #f0fdf4;
  color: #16a34a;
}

.badge--ocupado {
  background-color: #fffbeb;
  color: #d97706;
}

/* EstadoUsuario / EstadoProveedor */
.badge--activo {
  background-color: #f0fdf4;
  color: #16a34a;
}

.badge--inactivo {
  background-color: #f1f5f9;
  color: #64748b;
}

/*MODAL*/
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  /* Oculto por defecto */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background-color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  transform: translateY(-16px);
  transition: transform 0.2s ease;
}

.modal--lg {
  max-width: 650px;
}


.modal-overlay.is-open .modal {
  transform: translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal__title {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal__close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: color 0.2s ease;
}

.modal__close:hover {
  color: #334155;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/*TOASTS (notificaciones flotantes)*/
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 300;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  font-size: 0.875rem;
  font-weight: 500;
  animation: toast-in 0.3s ease;
  min-width: 280px;
}

.toast--success {
  background-color: #16a34a;
  color: white;
}

.toast--error {
  background-color: #dc2626;
  color: white;
}

.toast--warning {
  background-color: #d97706;
  color: white;
}

@keyframes toast-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/*ESTADO VACÍO (cuando una tabla no tiene datos)*/
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #94a3b8;
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state__text {
  font-size: 0.875rem;
}

/*ALERT BANNER (mensajes de error en página)*/
.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert--error {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.alert--success {
  background-color: #f0fdf4;
  color: #16a34a;
  border: 1px solid #86efac;
}