/* ================================================================
   app-usuarios.css — Módulo Usuarios Staff
   ================================================================ */

/* ── Tabla de usuarios ──────────────────────────────────────── */
.usr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 700px;
}

.usr-table thead tr {
  border-bottom: 2px solid var(--border-color);
}

.usr-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 1;
}

.usr-table th.center { text-align: center; }

.usr-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
}

.usr-table tbody tr:hover {
  background: rgba(var(--primary-rgb), 0.04);
}

.usr-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

/* ── Avatar + nombre ─────────────────────────────────────────── */
.usr-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.usr-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
  font-family: Outfit, sans-serif;
}

.usr-avatar.dev         { background: #EF44441a; color: #EF4444; }
.usr-avatar.admin       { background: #F59E0B1a; color: #F59E0B; }
.usr-avatar.conciliador { background: #3B82F61a; color: #3B82F6; }
.usr-avatar.asistente   { background: #6B72801a; color: #6B7280; }

.usr-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.usr-email {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ── Badges de rol ───────────────────────────────────────────── */
.usr-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.usr-badge.dev         { background: #EF44441a; color: #EF4444; }
.usr-badge.admin       { background: #F59E0B1a; color: #F59E0B; }
.usr-badge.conciliador { background: #3B82F61a; color: #3B82F6; }
.usr-badge.asistente   { background: #6B72801a; color: #6B7280; }

/* ── Estado toggle ───────────────────────────────────────────── */
.usr-estado {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: opacity var(--transition);
}

.usr-estado:hover { opacity: 0.7; }

.usr-estado-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.usr-estado-dot.activo   { background: #10B981; }
.usr-estado-dot.inactivo { background: #EF4444; }

.usr-estado-text {
  font-size: 0.82rem;
  font-weight: 600;
}

.usr-estado-text.activo   { color: #10B981; }
.usr-estado-text.inactivo { color: #EF4444; }

/* ── Botones de acción ───────────────────────────────────────── */
.usr-btn-action {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.85rem;
}

.usr-btn-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}

/* ── Modal de usuario ────────────────────────────────────────── */
.usr-modal {
  max-width: 500px;
  width: 92%;
  padding: 32px;
}

.usr-modal-title {
  font-family: Outfit, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-main);
}

.usr-field {
  margin-bottom: 16px;
}

.usr-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.usr-field label .req {
  color: #EF4444;
  margin-left: 2px;
}

.usr-field .form-control {
  width: 100%;
}

.usr-field .form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.usr-field .hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.usr-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* ── Empty state ─────────────────────────────────────────────── */
.usr-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}

.usr-empty i {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
  opacity: 0.4;
}

.usr-empty p {
  font-size: 0.9rem;
}

/* ── Loading ─────────────────────────────────────────────────── */
.usr-loading {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.usr-loading::before {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: usr-spin 0.7s linear infinite;
}

@keyframes usr-spin { to { transform: rotate(360deg); } }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .usr-table { min-width: 600px; }
}

@media (max-width: 768px) {
  .usr-table th:nth-child(5),
  .usr-table td:nth-child(5),
  .usr-table th:nth-child(6),
  .usr-table td:nth-child(6) {
    display: none;
  }
  .usr-avatar { width: 32px; height: 32px; font-size: 0.7rem; }
  .usr-modal { padding: 20px; width: 95%; }
}

@media (max-width: 480px) {
  .usr-table th:nth-child(3),
  .usr-table td:nth-child(3) {
    display: none;
  }
  .usr-name { font-size: 0.82rem; }
}
